X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2Fjs%2FByteCodes.java;h=7ba54b4f0297ea6b6eeb9a8b3d8bcc266d36ef24;hb=7e9239a7088d4cd772a31a76e1a53e1c681638bc;hp=908796540d658557a7dcdb5f23d8dab4ee0eedde;hpb=bbfe17b34980e100bcf26ec0c0b1b3fde1992793;p=org.ibex.core.git diff --git a/src/org/xwt/js/ByteCodes.java b/src/org/xwt/js/ByteCodes.java index 9087965..7ba54b4 100644 --- a/src/org/xwt/js/ByteCodes.java +++ b/src/org/xwt/js/ByteCodes.java @@ -1,4 +1,4 @@ -// Copyright 2003 Adam Megacz, see the COPYING file for licensing [GPL] +// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL] package org.xwt.js; /** @@ -51,19 +51,19 @@ interface ByteCodes { /** discard the top stack element */ static public final byte POP = -14; - /** pop two elements; call stack[-n](stack[-n+1], stack[-n+2]...) where n is the number of args to the function */ + /** pop element; call stack[top](stack[-n], stack[-n+1]...) 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 */ + /** pop an element; push a JS.JSArray containing the keys of the popped element */ public static final byte PUSHKEYS = -16; - /** swap the top two elements on the stack */ + /** push the top element down so that (arg) elements are on top of it; all other elements retain ordering */ public static final byte SWAP = -17; - /** execute the ForthBlock pointed to by the literal in a fresh scope with parentScope==THIS */ + /** execute the bytecode block pointed to by the literal in a fresh scope with parentScope==THIS */ public static final byte NEWSCOPE = -18; - /** execute the ForthBlock pointed to by the literal in a fresh scope with parentScope==THIS */ + /** execute the bytecode block pointed to by the literal in a fresh scope with parentScope==THIS */ public static final byte OLDSCOPE = -19; /** push a copy of the top stack element */ @@ -76,20 +76,19 @@ interface ByteCodes { * and FALSE for all subsequent iterations */ public static final byte LOOP = -22; - /** pop three elements off the stack; method arguments, method name, and an object to call the method on, then calls the method - Has a similar effect a a GET followed by a CALL */ + /** 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; - /** same as CALL, except that the function is on top of the arguments instead of beneath them */ - public static final byte CALL_REVERSED = -25; - + /** finish a finally block and carry out whatever instruction initiated the finally block */ + public static final byte MAKE_GRAMMAR = -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", "CALL_REVERSED" + "FINALLY_DONE", "MAKE_GRAMMAR" }; }