Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Partial revert of low-ranking optimization that broke build

  • Loading branch information...
commit 3fd815c2d31babd7713e635edf3c2d6b7a51a79d 1 parent 90e4727
@sorear authored
Showing with 27 additions and 5 deletions.
  1. +5 −2 Makefile
  2. +9 −0 lib/CLRBackend.cs
  3. +13 −3 src/niecza
View
7 Makefile
@@ -76,7 +76,7 @@ clean:
@rm -f run/*.dll.so
@rm -fr *~
-reboot: all
+half_reboot: all
# setup a clean build area
rm -rf stage2/ stage3/
mkdir -p stage2/obj stage2/run stage2/boot stage2/boot/obj \
@@ -90,7 +90,10 @@ reboot: all
stage2/boot/obj
cp -a lib run stage2/boot
cd stage2 && $(RUN_CLR) boot/run/Niecza.exe -C CORE JSYNC
- cd stage2 && $(MAKE)
+ cp test.pl stage2/
+ cd stage2 && $(MAKE) test
+
+reboot: half_reboot
# verify that the new Niecza can build itself correctly
cp stage2/obj/Kernel.dll stage2/obj/CrossDomainReceiver.dll \
stage2/obj/CLRBackend.exe stage3/boot/obj
View
9 lib/CLRBackend.cs
@@ -3503,6 +3503,15 @@ class NamProcessor {
JScalar.I(z[4]) * RxFrame.IC_PASS_CAP),
th.Scan(z[5])));
};
+ handlers["rxincorp"] = delegate(NamProcessor th, object[] z) {
+ CpsOp strs = th.sub.unit.StringListConst(JScalar.SA(0,z[1]));
+
+ return
+ CpsOp.MethodCall(Tokens.RxFrame.GetMethod("IncorporateChild"),
+ CpsOp.RxFrame(), strs,
+ CpsOp.BoolLiteral(JScalar.B(z[2])),
+ th.Scan(z[3]));
+ };
handlers["rxbprim"] = delegate(NamProcessor th, object[] z) {
CpsOp[] args = new CpsOp[z.Length - 1];
for(int i = 0; i < z.Length - 2; i++)
View
16 src/niecza
@@ -82,7 +82,6 @@ augment class RxOp::Subrule { #OK exist
my $callf = $!regex ?? $!regex.cgop($body) !!
CgOp.methodcall(CgOp.rxcall("MakeCursorV"),
$!method);
-
my @code;
if $!selfcut {
@@ -91,9 +90,19 @@ augment class RxOp::Subrule { #OK exist
} else {
my $bt = self.label;
- push @code, CgOp.rxcall("InitCursorList", $callf);
+ my $updatef = CgOp.rxincorp($.captures, +?$!passcap, CgOp.letvar("k"));
+ $updatef = CgOp.prog() if $!zerowidth;
+
+ push @code, CgOp.rxcall("SetCursorList", CgOp.vvarlist_new_singleton($callf));
push @code, CgOp.label($bt);
- push @code, CgOp.rxincorpshift($.captures, +?$!passcap, $bt);
+ push @code, CgOp.ncgoto("backtrack", CgOp.iter_hasflat(
+ CgOp.rxcall("GetCursorIter")));
+ push @code, CgOp.letn(
+ "kv", CgOp.vvarlist_shift(CgOp.rxcall("GetCursorIter")),
+ "k", CgOp.fetch(CgOp.letvar("kv")),
+ CgOp.rxpushb("SUBRULE", $bt),
+ $updatef);
+ push @code, CgOp.rxcall("SetCursorList", CgOp.null("var"));
}
@code;
@@ -151,6 +160,7 @@ method methodcall($obj, $name, *@args) {
my ($sig, $aout) = CgOp._process_arglist(@args);
CgOp._cgop('methodcall', $name, $sig, $obj, @$aout);
}
+method rxincorp($caps,$pc,$match) { self._cgop("rxincorp",$caps,$pc,$match) }
method rxincorpcut($caps,$zw,$ng,$pc,$call) { self._cgop("rxincorpcut",$caps,$zw,$ng,$pc,$call) }
method rxincorpshift($caps,$pc,$label) { self._cgop("rxincorpshift",$caps,$pc,$label) }
method boxlist($mo,$obj) { self._cgop("boxlist", $mo, $obj) }
Please sign in to comment.
Something went wrong with that request. Please try again.