X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2Fjs%2FByteCodes.java;h=4449d49290aca14eac3b7a34ab920d3b69cfeb8c;hb=73131826a18c93af4fb04672bc3ec820e1197ad1;hp=e8170f18c4c5c6cdad8248d253f6cb05a459e019;hpb=b1fa73c17b31f268fca5695d0876d7314fbacce3;p=org.ibex.js.git diff --git a/src/org/ibex/js/ByteCodes.java b/src/org/ibex/js/ByteCodes.java index e8170f1..4449d49 100644 --- a/src/org/ibex/js/ByteCodes.java +++ b/src/org/ibex/js/ByteCodes.java @@ -1,4 +1,7 @@ -// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL] +// Copyright 2000-2005 the Contributors, as shown in the revision logs. +// Licensed under the Apache Public Source License 2.0 ("the License"). +// You may not use this file except in compliance with the License. + package org.ibex.js; /** @@ -24,10 +27,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 +89,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" }; }