001: /***** BEGIN LICENSE BLOCK *****
002: * Version: CPL 1.0/GPL 2.0/LGPL 2.1
003: *
004: * The contents of this file are subject to the Common Public
005: * License Version 1.0 (the "License"); you may not use this file
006: * except in compliance with the License. You may obtain a copy of
007: * the License at http://www.eclipse.org/legal/cpl-v10.html
008: *
009: * Software distributed under the License is distributed on an "AS
010: * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
011: * implied. See the License for the specific language governing
012: * rights and limitations under the License.
013: *
014: * Copyright (C) 2006 Charles O Nutter <headius@headius.com>
015: * Copyright (C) 2007 Ola Bini <ola@ologix.com>
016: *
017: * Alternatively, the contents of this file may be used under the terms of
018: * either of the GNU General Public License Version 2 or later (the "GPL"),
019: * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
020: * in which case the provisions of the GPL or the LGPL are applicable instead
021: * of those above. If you wish to allow use of your version of this file only
022: * under the terms of either the GPL or the LGPL, and not to allow others to
023: * use your version of this file under the terms of the CPL, indicate your
024: * decision by deleting the provisions above and replace them with the notice
025: * and other provisions required by the GPL or the LGPL. If you do not delete
026: * the provisions above, a recipient may use your version of this file under
027: * the terms of any one of the CPL, the GPL or the LGPL.
028: ***** END LICENSE BLOCK *****/package org.jruby.ast.executable;
029:
030: import java.util.Map;
031: import java.util.HashMap;
032:
033: /**
034: * AUTOGENERATED. Change template, not generated file.
035: */
036: public abstract class YARVInstructions {
037: public static final int NOP = 0;
038: public static final int GETLOCAL = 1;
039: public static final int SETLOCAL = 2;
040: public static final int GETSPECIAL = 3;
041: public static final int SETSPECIAL = 4;
042: public static final int GETDYNAMIC = 5;
043: public static final int SETDYNAMIC = 6;
044: public static final int GETINSTANCEVARIABLE = 7;
045: public static final int SETINSTANCEVARIABLE = 8;
046: public static final int GETCLASSVARIABLE = 9;
047: public static final int SETCLASSVARIABLE = 10;
048: public static final int GETCONSTANT = 11;
049: public static final int SETCONSTANT = 12;
050: public static final int GETGLOBAL = 13;
051: public static final int SETGLOBAL = 14;
052: public static final int PUTNIL = 15;
053: public static final int PUTSELF = 16;
054: public static final int PUTUNDEF = 17;
055: public static final int PUTOBJECT = 18;
056: public static final int PUTSTRING = 19;
057: public static final int CONCATSTRINGS = 20;
058: public static final int TOSTRING = 21;
059: public static final int TOREGEXP = 22;
060: public static final int NEWARRAY = 23;
061: public static final int DUPARRAY = 24;
062: public static final int EXPANDARRAY = 25;
063: public static final int CONCATARRAY = 26;
064: public static final int SPLATARRAY = 27;
065: public static final int CHECKINCLUDEARRAY = 28;
066: public static final int NEWHASH = 29;
067: public static final int NEWRANGE = 30;
068: public static final int PUTNOT = 31;
069: public static final int POP = 32;
070: public static final int DUP = 33;
071: public static final int DUPN = 34;
072: public static final int SWAP = 35;
073: public static final int REPUT = 36;
074: public static final int TOPN = 37;
075: public static final int SETN = 38;
076: public static final int EMPTSTACK = 39;
077: public static final int DEFINEMETHOD = 40;
078: public static final int ALIAS = 41;
079: public static final int UNDEF = 42;
080: public static final int DEFINED = 43;
081: public static final int POSTEXE = 44;
082: public static final int TRACE = 45;
083: public static final int DEFINECLASS = 46;
084: public static final int SEND = 47;
085: public static final int INVOKESUPER = 48;
086: public static final int INVOKEBLOCK = 49;
087: public static final int LEAVE = 50;
088: public static final int FINISH = 51;
089: public static final int THROW = 52;
090: public static final int JUMP = 53;
091: public static final int BRANCHIF = 54;
092: public static final int BRANCHUNLESS = 55;
093: public static final int GETINLINECACHE = 56;
094: public static final int ONCEINLINECACHE = 57;
095: public static final int SETINLINECACHE = 58;
096: public static final int OPT_CASE_DISPATCH = 59;
097: public static final int OPT_CHECKENV = 60;
098: public static final int OPT_PLUS = 61;
099: public static final int OPT_MINUS = 62;
100: public static final int OPT_MULT = 63;
101: public static final int OPT_DIV = 64;
102: public static final int OPT_MOD = 65;
103: public static final int OPT_EQ = 66;
104: public static final int OPT_LT = 67;
105: public static final int OPT_LE = 68;
106: public static final int OPT_LTLT = 69;
107: public static final int OPT_AREF = 70;
108: public static final int OPT_ASET = 71;
109: public static final int OPT_LENGTH = 72;
110: public static final int OPT_SUCC = 73;
111: public static final int OPT_REGEXPMATCH1 = 74;
112: public static final int OPT_REGEXPMATCH2 = 75;
113: public static final int OPT_CALL_NATIVE_COMPILED = 76;
114: public static final int BITBLT = 77;
115: public static final int ANSWER = 78;
116: public static final int GETLOCAL_OP_2 = 79;
117: public static final int GETLOCAL_OP_3 = 80;
118: public static final int GETLOCAL_OP_4 = 81;
119: public static final int SETLOCAL_OP_2 = 82;
120: public static final int SETLOCAL_OP_3 = 83;
121: public static final int SETLOCAL_OP_4 = 84;
122: public static final int GETDYNAMIC_OP__WC__0 = 85;
123: public static final int GETDYNAMIC_OP_1_0 = 86;
124: public static final int GETDYNAMIC_OP_2_0 = 87;
125: public static final int GETDYNAMIC_OP_3_0 = 88;
126: public static final int GETDYNAMIC_OP_4_0 = 89;
127: public static final int SETDYNAMIC_OP__WC__0 = 90;
128: public static final int SETDYNAMIC_OP_1_0 = 91;
129: public static final int SETDYNAMIC_OP_2_0 = 92;
130: public static final int SETDYNAMIC_OP_3_0 = 93;
131: public static final int SETDYNAMIC_OP_4_0 = 94;
132: public static final int PUTOBJECT_OP_INT2FIX_0_0_C_ = 95;
133: public static final int PUTOBJECT_OP_INT2FIX_0_1_C_ = 96;
134: public static final int PUTOBJECT_OP_QTRUE = 97;
135: public static final int PUTOBJECT_OP_QFALSE = 98;
136: public static final int SEND_OP__WC___WC__QFALSE_0__WC_ = 99;
137: public static final int SEND_OP__WC__0_QFALSE_0__WC_ = 100;
138: public static final int SEND_OP__WC__1_QFALSE_0__WC_ = 101;
139: public static final int SEND_OP__WC__2_QFALSE_0__WC_ = 102;
140: public static final int SEND_OP__WC__3_QFALSE_0__WC_ = 103;
141: public static final int SEND_OP__WC___WC__QFALSE_0X04__WC_ = 104;
142: public static final int SEND_OP__WC__0_QFALSE_0X04__WC_ = 105;
143: public static final int SEND_OP__WC__1_QFALSE_0X04__WC_ = 106;
144: public static final int SEND_OP__WC__2_QFALSE_0X04__WC_ = 107;
145: public static final int SEND_OP__WC__3_QFALSE_0X04__WC_ = 108;
146: public static final int SEND_OP__WC__0_QFALSE_0X0C__WC_ = 109;
147: public static final int UNIFIED_PUTOBJECT_PUTOBJECT = 110;
148: public static final int UNIFIED_PUTOBJECT_PUTSTRING = 111;
149: public static final int UNIFIED_PUTOBJECT_SETLOCAL = 112;
150: public static final int UNIFIED_PUTOBJECT_SETDYNAMIC = 113;
151: public static final int UNIFIED_PUTSTRING_PUTSTRING = 114;
152: public static final int UNIFIED_PUTSTRING_PUTOBJECT = 115;
153: public static final int UNIFIED_PUTSTRING_SETLOCAL = 116;
154: public static final int UNIFIED_PUTSTRING_SETDYNAMIC = 117;
155: public static final int UNIFIED_DUP_SETLOCAL = 118;
156: public static final int UNIFIED_GETLOCAL_GETLOCAL = 119;
157: public static final int UNIFIED_GETLOCAL_PUTOBJECT = 120;
158:
159: public static final Map INSTS_TO_INDEX = new HashMap();
160: static {
161: INSTS_TO_INDEX.put("nop", new Integer(0));
162: INSTS_TO_INDEX.put("getlocal", new Integer(1));
163: INSTS_TO_INDEX.put("setlocal", new Integer(2));
164: INSTS_TO_INDEX.put("getspecial", new Integer(3));
165: INSTS_TO_INDEX.put("setspecial", new Integer(4));
166: INSTS_TO_INDEX.put("getdynamic", new Integer(5));
167: INSTS_TO_INDEX.put("setdynamic", new Integer(6));
168: INSTS_TO_INDEX.put("getinstancevariable", new Integer(7));
169: INSTS_TO_INDEX.put("setinstancevariable", new Integer(8));
170: INSTS_TO_INDEX.put("getclassvariable", new Integer(9));
171: INSTS_TO_INDEX.put("setclassvariable", new Integer(10));
172: INSTS_TO_INDEX.put("getconstant", new Integer(11));
173: INSTS_TO_INDEX.put("setconstant", new Integer(12));
174: INSTS_TO_INDEX.put("getglobal", new Integer(13));
175: INSTS_TO_INDEX.put("setglobal", new Integer(14));
176: INSTS_TO_INDEX.put("putnil", new Integer(15));
177: INSTS_TO_INDEX.put("putself", new Integer(16));
178: INSTS_TO_INDEX.put("putundef", new Integer(17));
179: INSTS_TO_INDEX.put("putobject", new Integer(18));
180: INSTS_TO_INDEX.put("putstring", new Integer(19));
181: INSTS_TO_INDEX.put("concatstrings", new Integer(20));
182: INSTS_TO_INDEX.put("tostring", new Integer(21));
183: INSTS_TO_INDEX.put("toregexp", new Integer(22));
184: INSTS_TO_INDEX.put("newarray", new Integer(23));
185: INSTS_TO_INDEX.put("duparray", new Integer(24));
186: INSTS_TO_INDEX.put("expandarray", new Integer(25));
187: INSTS_TO_INDEX.put("concatarray", new Integer(26));
188: INSTS_TO_INDEX.put("splatarray", new Integer(27));
189: INSTS_TO_INDEX.put("checkincludearray", new Integer(28));
190: INSTS_TO_INDEX.put("newhash", new Integer(29));
191: INSTS_TO_INDEX.put("newrange", new Integer(30));
192: INSTS_TO_INDEX.put("putnot", new Integer(31));
193: INSTS_TO_INDEX.put("pop", new Integer(32));
194: INSTS_TO_INDEX.put("dup", new Integer(33));
195: INSTS_TO_INDEX.put("dupn", new Integer(34));
196: INSTS_TO_INDEX.put("swap", new Integer(35));
197: INSTS_TO_INDEX.put("reput", new Integer(36));
198: INSTS_TO_INDEX.put("topn", new Integer(37));
199: INSTS_TO_INDEX.put("setn", new Integer(38));
200: INSTS_TO_INDEX.put("emptstack", new Integer(39));
201: INSTS_TO_INDEX.put("definemethod", new Integer(40));
202: INSTS_TO_INDEX.put("alias", new Integer(41));
203: INSTS_TO_INDEX.put("undef", new Integer(42));
204: INSTS_TO_INDEX.put("defined", new Integer(43));
205: INSTS_TO_INDEX.put("postexe", new Integer(44));
206: INSTS_TO_INDEX.put("trace", new Integer(45));
207: INSTS_TO_INDEX.put("defineclass", new Integer(46));
208: INSTS_TO_INDEX.put("send", new Integer(47));
209: INSTS_TO_INDEX.put("invokesuper", new Integer(48));
210: INSTS_TO_INDEX.put("invokeblock", new Integer(49));
211: INSTS_TO_INDEX.put("leave", new Integer(50));
212: INSTS_TO_INDEX.put("finish", new Integer(51));
213: INSTS_TO_INDEX.put("throw", new Integer(52));
214: INSTS_TO_INDEX.put("jump", new Integer(53));
215: INSTS_TO_INDEX.put("branchif", new Integer(54));
216: INSTS_TO_INDEX.put("branchunless", new Integer(55));
217: INSTS_TO_INDEX.put("getinlinecache", new Integer(56));
218: INSTS_TO_INDEX.put("onceinlinecache", new Integer(57));
219: INSTS_TO_INDEX.put("setinlinecache", new Integer(58));
220: INSTS_TO_INDEX.put("opt_case_dispatch", new Integer(59));
221: INSTS_TO_INDEX.put("opt_checkenv", new Integer(60));
222: INSTS_TO_INDEX.put("opt_plus", new Integer(61));
223: INSTS_TO_INDEX.put("opt_minus", new Integer(62));
224: INSTS_TO_INDEX.put("opt_mult", new Integer(63));
225: INSTS_TO_INDEX.put("opt_div", new Integer(64));
226: INSTS_TO_INDEX.put("opt_mod", new Integer(65));
227: INSTS_TO_INDEX.put("opt_eq", new Integer(66));
228: INSTS_TO_INDEX.put("opt_lt", new Integer(67));
229: INSTS_TO_INDEX.put("opt_le", new Integer(68));
230: INSTS_TO_INDEX.put("opt_ltlt", new Integer(69));
231: INSTS_TO_INDEX.put("opt_aref", new Integer(70));
232: INSTS_TO_INDEX.put("opt_aset", new Integer(71));
233: INSTS_TO_INDEX.put("opt_length", new Integer(72));
234: INSTS_TO_INDEX.put("opt_succ", new Integer(73));
235: INSTS_TO_INDEX.put("opt_regexpmatch1", new Integer(74));
236: INSTS_TO_INDEX.put("opt_regexpmatch2", new Integer(75));
237: INSTS_TO_INDEX.put("opt_call_native_compiled", new Integer(76));
238: INSTS_TO_INDEX.put("bitblt", new Integer(77));
239: INSTS_TO_INDEX.put("answer", new Integer(78));
240: INSTS_TO_INDEX.put("getlocal_op_2", new Integer(79));
241: INSTS_TO_INDEX.put("getlocal_op_3", new Integer(80));
242: INSTS_TO_INDEX.put("getlocal_op_4", new Integer(81));
243: INSTS_TO_INDEX.put("setlocal_op_2", new Integer(82));
244: INSTS_TO_INDEX.put("setlocal_op_3", new Integer(83));
245: INSTS_TO_INDEX.put("setlocal_op_4", new Integer(84));
246: INSTS_TO_INDEX.put("getdynamic_op__wc__0", new Integer(85));
247: INSTS_TO_INDEX.put("getdynamic_op_1_0", new Integer(86));
248: INSTS_TO_INDEX.put("getdynamic_op_2_0", new Integer(87));
249: INSTS_TO_INDEX.put("getdynamic_op_3_0", new Integer(88));
250: INSTS_TO_INDEX.put("getdynamic_op_4_0", new Integer(89));
251: INSTS_TO_INDEX.put("setdynamic_op__wc__0", new Integer(90));
252: INSTS_TO_INDEX.put("setdynamic_op_1_0", new Integer(91));
253: INSTS_TO_INDEX.put("setdynamic_op_2_0", new Integer(92));
254: INSTS_TO_INDEX.put("setdynamic_op_3_0", new Integer(93));
255: INSTS_TO_INDEX.put("setdynamic_op_4_0", new Integer(94));
256: INSTS_TO_INDEX.put("putobject_op_int2fix_0_0_c_", new Integer(
257: 95));
258: INSTS_TO_INDEX.put("putobject_op_int2fix_0_1_c_", new Integer(
259: 96));
260: INSTS_TO_INDEX.put("putobject_op_qtrue", new Integer(97));
261: INSTS_TO_INDEX.put("putobject_op_qfalse", new Integer(98));
262: INSTS_TO_INDEX.put("send_op__wc___wc__qfalse_0__wc_",
263: new Integer(99));
264: INSTS_TO_INDEX.put("send_op__wc__0_qfalse_0__wc_", new Integer(
265: 100));
266: INSTS_TO_INDEX.put("send_op__wc__1_qfalse_0__wc_", new Integer(
267: 101));
268: INSTS_TO_INDEX.put("send_op__wc__2_qfalse_0__wc_", new Integer(
269: 102));
270: INSTS_TO_INDEX.put("send_op__wc__3_qfalse_0__wc_", new Integer(
271: 103));
272: INSTS_TO_INDEX.put("send_op__wc___wc__qfalse_0x04__wc_",
273: new Integer(104));
274: INSTS_TO_INDEX.put("send_op__wc__0_qfalse_0x04__wc_",
275: new Integer(105));
276: INSTS_TO_INDEX.put("send_op__wc__1_qfalse_0x04__wc_",
277: new Integer(106));
278: INSTS_TO_INDEX.put("send_op__wc__2_qfalse_0x04__wc_",
279: new Integer(107));
280: INSTS_TO_INDEX.put("send_op__wc__3_qfalse_0x04__wc_",
281: new Integer(108));
282: INSTS_TO_INDEX.put("send_op__wc__0_qfalse_0x0c__wc_",
283: new Integer(109));
284: INSTS_TO_INDEX.put("unified_putobject_putobject", new Integer(
285: 110));
286: INSTS_TO_INDEX.put("unified_putobject_putstring", new Integer(
287: 111));
288: INSTS_TO_INDEX.put("unified_putobject_setlocal", new Integer(
289: 112));
290: INSTS_TO_INDEX.put("unified_putobject_setdynamic", new Integer(
291: 113));
292: INSTS_TO_INDEX.put("unified_putstring_putstring", new Integer(
293: 114));
294: INSTS_TO_INDEX.put("unified_putstring_putobject", new Integer(
295: 115));
296: INSTS_TO_INDEX.put("unified_putstring_setlocal", new Integer(
297: 116));
298: INSTS_TO_INDEX.put("unified_putstring_setdynamic", new Integer(
299: 117));
300: INSTS_TO_INDEX.put("unified_dup_setlocal", new Integer(118));
301: INSTS_TO_INDEX.put("unified_getlocal_getlocal",
302: new Integer(119));
303: INSTS_TO_INDEX.put("unified_getlocal_putobject", new Integer(
304: 120));
305: }
306:
307: public static int instruction(String name) {
308: return ((Integer) INSTS_TO_INDEX.get(name)).intValue();
309: }
310:
311: public static final String[] INDEX_TO_NAME = new String[] { "nop",
312: "getlocal", "setlocal", "getspecial", "setspecial",
313: "getdynamic", "setdynamic", "getinstancevariable",
314: "setinstancevariable", "getclassvariable",
315: "setclassvariable", "getconstant", "setconstant",
316: "getglobal", "setglobal", "putnil", "putself", "putundef",
317: "putobject", "putstring", "concatstrings", "tostring",
318: "toregexp", "newarray", "duparray", "expandarray",
319: "concatarray", "splatarray", "checkincludearray",
320: "newhash", "newrange", "putnot", "pop", "dup", "dupn",
321: "swap", "reput", "topn", "setn", "emptstack",
322: "definemethod", "alias", "undef", "defined", "postexe",
323: "trace", "defineclass", "send", "invokesuper",
324: "invokeblock", "leave", "finish", "throw", "jump",
325: "branchif", "branchunless", "getinlinecache",
326: "onceinlinecache", "setinlinecache", "opt_case_dispatch",
327: "opt_checkenv", "opt_plus", "opt_minus", "opt_mult",
328: "opt_div", "opt_mod", "opt_eq", "opt_lt", "opt_le",
329: "opt_ltlt", "opt_aref", "opt_aset", "opt_length",
330: "opt_succ", "opt_regexpmatch1", "opt_regexpmatch2",
331: "opt_call_native_compiled", "bitblt", "answer",
332: "getlocal_op_2", "getlocal_op_3", "getlocal_op_4",
333: "setlocal_op_2", "setlocal_op_3", "setlocal_op_4",
334: "getdynamic_op__wc__0", "getdynamic_op_1_0",
335: "getdynamic_op_2_0", "getdynamic_op_3_0",
336: "getdynamic_op_4_0", "setdynamic_op__wc__0",
337: "setdynamic_op_1_0", "setdynamic_op_2_0",
338: "setdynamic_op_3_0", "setdynamic_op_4_0",
339: "putobject_op_int2fix_0_0_c_",
340: "putobject_op_int2fix_0_1_c_", "putobject_op_qtrue",
341: "putobject_op_qfalse", "send_op__wc___wc__qfalse_0__wc_",
342: "send_op__wc__0_qfalse_0__wc_",
343: "send_op__wc__1_qfalse_0__wc_",
344: "send_op__wc__2_qfalse_0__wc_",
345: "send_op__wc__3_qfalse_0__wc_",
346: "send_op__wc___wc__qfalse_0x04__wc_",
347: "send_op__wc__0_qfalse_0x04__wc_",
348: "send_op__wc__1_qfalse_0x04__wc_",
349: "send_op__wc__2_qfalse_0x04__wc_",
350: "send_op__wc__3_qfalse_0x04__wc_",
351: "send_op__wc__0_qfalse_0x0c__wc_",
352: "unified_putobject_putobject",
353: "unified_putobject_putstring",
354: "unified_putobject_setlocal",
355: "unified_putobject_setdynamic",
356: "unified_putstring_putstring",
357: "unified_putstring_putobject",
358: "unified_putstring_setlocal",
359: "unified_putstring_setdynamic", "unified_dup_setlocal",
360: "unified_getlocal_getlocal", "unified_getlocal_putobject" };
361:
362: public static String name(int index) {
363: return INDEX_TO_NAME[index];
364: }
365:
366: public static final int ARGS_SPLAT_FLAG = 2;
367: public static final int ARGS_BLOCKARG_FLAG = 4;
368: public static final int FCALL_FLAG = 8;
369: public static final int VCALL_FLAG = 16;
370: public static final int TAILCALL_FLAG = 32;
371: public static final int TAILRECURSION_FLAG = 64;
372: public static final int SUPER = 128;
373: }
|