licensing update to APSL 2.0
[org.ibex.js.git] / src / org / ibex / js / ByteCodes.java
index e8170f1..4449d49 100644 (file)
@@ -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"
     };
 }