Permalink
Browse files

Fixes for Match.synthetic

  • Loading branch information...
1 parent e80f452 commit 94d8f557cc6af016a306ec8e38ecb0c59d1efcdc @sorear committed May 28, 2011
Showing with 10 additions and 25 deletions.
  1. +1 −1 lib/CLRBackend.cs
  2. +8 −6 lib/CORE.setting
  3. +1 −1 lib/Cursor.cs
  4. +0 −17 perf/perf.TODO
View
2 lib/CLRBackend.cs
@@ -3811,7 +3811,7 @@ class NamProcessor {
thandlers["cursor_item"] = Methody(null, Tokens.Cursor.GetMethod("GetKey"));
thandlers["cursor_unpackcaps"] = Methody(null, Tokens.Cursor.GetMethod("UnpackCaps"));
thandlers["cursor_O"] = Methody(null, Tokens.Cursor.GetMethod("O"));
- thandlers["cursor_synthetic"] = Methody(Tokens.Variable, Tokens.Cursor.GetMethod("Synthetic"));
+ thandlers["cursor_synthetic"] = Methody(Tokens.Void, Tokens.Cursor.GetMethod("Synthetic"));
thandlers["cursor_fresh"] = Methody(null, Tokens.Cursor.GetMethod("FreshClass"));
thandlers["cursor_unmatch"] = Methody(null, Tokens.Cursor.GetMethod("UnMatch"));
thandlers["cursor_reduced"] = Methody(null, Tokens.Cursor.GetMethod("Reduced"));
View
14 lib/CORE.setting
@@ -1154,14 +1154,16 @@ my class Match is Cool {
method cursor() { Q:CgOp { (ns (cursor_unmatch (cast cursor (@ {self})))) } }
method reduced() { Q:CgOp { (box Str (cursor_reduced (cast cursor (@ {self})))) } }
method synthetic(:$cursor!, :$method!, :@captures!, :$from!, :$to!) {
+ my $*match;
Q:CgOp {
- (cursor_synthetic
- (cast cursor (@ {$cursor})) (obj_getstr {$method})
- (cast int (obj_getnum {$from}))
- (cast int (obj_getnum {$to}))
- {@captures})
+ (prog
+ (cursor_synthetic
+ (cast cursor (@ {$cursor})) (obj_getstr {$method})
+ (cast int (obj_getnum {$from}))
+ (cast int (obj_getnum {$to}))
+ {@captures})
+ {$*match})
};
- $/
}
}
View
2 lib/Cursor.cs
@@ -575,7 +575,7 @@ public Cursor(P6any proto, string text, P6any actions)
}
Cursor r = new Cursor(parent.global, parent.save_klass, from, to, ci,
null, method);
- Kernel.SetStatus(th, "$*/", Kernel.NewROScalar(r));
+ th.SetDynamic(th.info.dylex["$*match"], Kernel.NewROScalar(r));
return r.global.CallAction(th, method, r);
}
View
17 perf/perf.TODO
@@ -1,25 +1,8 @@
== For STD/Niecza ==
-Calling action methods hurts
-- Try calling them on the loop
-- Try a .^blacklist_fallback method for avoiding <.ws> actions, etc
-
Experiment with techniques to avoid Variable[] allocation on all calls
- like a preallocated "outgoing arguments area"
Experiment with "if non-overriden, then replace method" hooks
Experiment with making P6any: Variable
-
-Any.exists-key is missing!
-
-Builtins.start_iteration to avoid creating an extra VarDeque in for @x {}
-
-Avoid PushD if empty(?). (And avoid CopyAsArray in both)
-
-Avoid slurpies with CgOp. Try using, I dunno, parcels instead, with
-custom code.
-
-Avoid the full lazy-iterator in JSON if possible.
-
-Avoid RxFrame.End in <ws>.

0 comments on commit 94d8f55

Please sign in to comment.