X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2Fjs%2FByteCodes.java;fp=src%2Forg%2Fxwt%2Fjs%2FByteCodes.java;h=908796540d658557a7dcdb5f23d8dab4ee0eedde;hb=bbfe17b34980e100bcf26ec0c0b1b3fde1992793;hp=2e39d6f1846a5cfbdf0fee3c4dc0e820e8e74967;hpb=99ca130d23feab443f062b8389c2c12426ef7575;p=org.ibex.core.git diff --git a/src/org/xwt/js/ByteCodes.java b/src/org/xwt/js/ByteCodes.java index 2e39d6f..9087965 100644 --- a/src/org/xwt/js/ByteCodes.java +++ b/src/org/xwt/js/ByteCodes.java @@ -51,7 +51,7 @@ interface ByteCodes { /** discard the top stack element */ static public final byte POP = -14; - /** pop two elements; call stack[-1](stack[top]) where stacktop is a JS.JS.Array */ + /** pop two elements; call stack[-n](stack[-n+1], stack[-n+2]...) where n is the number of args to the function */ public static final byte CALL = -15; /** pop an element; push a JS.JS.Array containing the keys of the popped element */ @@ -83,10 +83,13 @@ interface ByteCodes { /** finish a finally block and carry out whatever instruction initiated the finally block */ public static final byte FINALLY_DONE = -24; + /** same as CALL, except that the function is on top of the arguments instead of beneath them */ + public static final byte CALL_REVERSED = -25; + 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", - "FINALLY_DONE" + "FINALLY_DONE", "CALL_REVERSED" }; }