[nem-en] patch for matching compiler

Kamil Skalski kamil.skalski at gmail.com
Sun Oct 23 23:43:33 CEST 2005


05-10-23, mgrzeskowiak at tlen.pl <mgrzeskowiak at tlen.pl> napisał(a):
> Hi
>
> Finally I managed to get new matching compiler to the state
> where it is quite usable. I attached a patch to revision

That is great (and huge) stuff :-)

Just some short comments for now:

> -new-matching: this flag turns on the new matching compiler
>   (it is still off by default)
> -dump-decision-trees: this is mainly for debugging trees
>   created by DecisionTreeBuilder
> -no-dag: disable detection of shared subtrees in decision
>   tree

These flags should be hidden (no help available for them).

> ncc/external/InternalTypes.n
>   Add static property TupleType.NamePrefix. It is used in
>   DecisionTreeCompiler and DecisionTreeBuilder to check
>   if IField is from some tuple.
>   I don't know if there is a better way to perform this test.

I wrote the function:
  public static IsTupleMember (ty : IMember) : bool
  {
    def dt = ty.DeclaringType;
    def typarms = dt.TyparmsCount;
    typarms > 0 && dt.Equals (InternalType.GetTupleType (typarms))
  }


>
> ncc/typing/DecisionTreeBuilder.n

We should avoid throwing exceptions in normal execution, because it is
slow (especially on MS.NET runtime).

> ncc/testsuite/Makefile, ncc/testsuite/test.n:
>   Two small changes to fix problems on Mono 1.1.9:
>   1) new code to pass additional arguments to .Net engine
>   2) catch and ignore InvalidOperationException thrown from
>      runtime.Kill ()
>   These changes just fix the problems I don't know if
>   ignoring InvalidOperationException is the right thing to do.

Well, we will need to investigate this for sure.

I attach the refreshed patch with those changes.
I also fixed some wrong place of warning in testcase.

--
Kamil Skalski
http://nazgul.omega.pl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: new-matching.patch
Type: application/octet-stream
Size: 32402 bytes
Desc: not available
Url : /mailman/pipermail/devel-en/attachments/20051023/9e8cdbdb/new-matching-0001.obj


More information about the devel-en mailing list