X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fjs%2FByteCodes.java;fp=src%2Forg%2Fibex%2Fjs%2FByteCodes.java;h=84c59268feb654ee890249e882de99de1cac78e0;hp=e8170f18c4c5c6cdad8248d253f6cb05a459e019;hb=2c7492501427a4876792cc12492d2185a605d7c4;hpb=85c640ef9709fd71d0f12d8918ce125dbcc58461 diff --git a/src/org/ibex/js/ByteCodes.java b/src/org/ibex/js/ByteCodes.java index e8170f1..84c5926 100644 --- a/src/org/ibex/js/ByteCodes.java +++ b/src/org/ibex/js/ByteCodes.java @@ -24,10 +24,11 @@ interface ByteCodes { /** if given a non-null argument declare its argument in the current scope and push it to the stack, else, declares the element on the top of the stack and leaves it there */ - public static final byte DECLARE = -6; + //public static final byte DECLARE = -6; /** push a reference to the current scope onto the stack */ - public static final byte TOPSCOPE = -7; + // FIXME: Document this + public static final byte GLOBALSCOPE = -7; /** if given a null literal pop two elements off the stack; push stack[-1].get(stack[top]) else pop one element off the stack, push stack[top].get(literal) */ @@ -85,10 +86,14 @@ interface ByteCodes { /** finish a finally block and carry out whatever instruction initiated the finally block */ public static final byte MAKE_GRAMMAR = -25; + // FIXME: Document these and NEWSCOPE/OLDSCOPE/TOPSCOPE changes + public static final byte SCOPEGET = -26; + public static final byte SCOPEPUT = -27; + public static final String[] bytecodeToString = new String[] { - "", "", "LITERAL", "ARRAY", "OBJECT", "NEWFUNCTION", "DECLARE", "TOPSCOPE", + "", "", "LITERAL", "ARRAY", "OBJECT", "NEWFUNCTION", "DECLARE", "GLOBALSCOPE", "GET", "GET_PRESERVE", "PUT", "JT", "JF", "JMP", "POP", "CALL", "PUSHKEYS", "SWAP", "NEWSCOPE", "OLDSCOPE", "DUP", "LABEL", "LOOP", "CALLMETHOD", - "FINALLY_DONE", "MAKE_GRAMMAR" + "FINALLY_DONE", "MAKE_GRAMMAR", "SCOPEGET", "SCOPEPUT" }; }