X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2Fjs%2FByteCodes.java;h=2e39d6f1846a5cfbdf0fee3c4dc0e820e8e74967;hb=0c542e57d5c7dbc07a8970d3bff6a819767db4d8;hp=bac280a7ede1a4ff35fd70d4678c7013094739b0;hpb=1da33fe9e7c5104ec5d0b9b312d1114fdf2931be;p=org.ibex.core.git diff --git a/src/org/xwt/js/ByteCodes.java b/src/org/xwt/js/ByteCodes.java index bac280a..2e39d6f 100644 --- a/src/org/xwt/js/ByteCodes.java +++ b/src/org/xwt/js/ByteCodes.java @@ -21,13 +21,16 @@ interface ByteCodes { /** create a new instance; literal is a reference to the corresponding ForthBlock */ public static final byte NEWFUNCTION = -5; - /** pop a string off the stack and declare it in the current scope */ + /** 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; /** push a reference to the current scope onto the stack */ public static final byte TOPSCOPE = -7; - /** pop two elements off the stack; push stack[-1].get(stack[top]) */ + /** 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) */ public static final byte GET = -8; /** push stack[-1].get(stack[top]) */ @@ -77,10 +80,13 @@ interface ByteCodes { Has a similar effect a a GET followed by a CALL */ public static final byte CALLMETHOD = -23; - + /** finish a finally block and carry out whatever instruction initiated the finally block */ + public static final byte FINALLY_DONE = -24; + public static final String[] bytecodeToString = new String[] { "", "", "LITERAL", "ARRAY", "OBJECT", "NEWFUNCTION", "DECLARE", "TOPSCOPE", "GET", "GET_PRESERVE", "PUT", "JT", "JF", "JMP", "POP", "CALL", "PUSHKEYS", - "SWAP", "NEWSCOPE", "OLDSCOPE", "DUP", "LABEL", "LOOP", "CALLMETHOD" + "SWAP", "NEWSCOPE", "OLDSCOPE", "DUP", "LABEL", "LOOP", "CALLMETHOD", + "FINALLY_DONE" }; }