Skip to content
Browse files

Add missing ops related to FIRST handling.

  • Loading branch information...
1 parent e0bb438 commit 60d298632dd4a48078dd4b1f1e029d4099bc60e6 @jnthn jnthn committed
Showing with 16 additions and 1 deletion.
  1. +16 −1 src/vm/jvm/runtime/org/perl6/rakudo/Ops.java
View
17 src/vm/jvm/runtime/org/perl6/rakudo/Ops.java
@@ -15,7 +15,7 @@
public static final boolean DEBUG_MODE = false;
public static class ThreadExt {
- // not currently used
+ public SixModelObject firstPhaserCodeBlock;
public ThreadExt(ThreadContext tc) { }
}
@@ -576,4 +576,19 @@ public int compare(SixModelObject a, SixModelObject b) {
public static long p6stateinit(ThreadContext tc) {
return tc.curFrame.stateInit ? 1 : 0;
}
+
+ public static SixModelObject p6setfirstflag(SixModelObject codeObj, ThreadContext tc) {
+ GlobalExt gcx = key.getGC(tc);
+ ThreadExt tcx = key.getTC(tc);
+ tcx.firstPhaserCodeBlock = codeObj.get_attribute_boxed(tc,
+ gcx.Code, "$!do", HINT_CODE_DO);
+ return codeObj;
+ }
+
+ public static long p6takefirstflag(ThreadContext tc) {
+ ThreadExt tcx = key.getTC(tc);
+ boolean matches = tcx.firstPhaserCodeBlock == tc.curFrame.codeRef;
+ tcx.firstPhaserCodeBlock = null;
+ return matches ? 1 : 0;
+ }
}

0 comments on commit 60d2986

Please sign in to comment.
Something went wrong with that request. Please try again.