001    /*
002     *  This file is part of the Jikes RVM project (http://jikesrvm.org).
003     *
004     *  This file is licensed to You under the Eclipse Public License (EPL);
005     *  You may not use this file except in compliance with the License. You
006     *  may obtain a copy of the License at
007     *
008     *      http://www.opensource.org/licenses/eclipse-1.0.php
009     *
010     *  See the COPYRIGHT.txt file distributed with this work for information
011     *  regarding copyright ownership.
012     */
013    package org.jikesrvm.compilers.opt.ir;
014    
015    /**
016     * Class to store the string representations of different operators.
017     * They are in a separate class for efficiency.
018     *
019     * @see Operator
020     */
021    public abstract class OperatorNames {
022    
023      public static final String[] operatorName = new String[] {
024          "get_caught_exception    ",
025          "set_caught_exception    ",
026          "new                     ",
027          "new_unresolved          ",
028          "newarray                ",
029          "newarray_unresolved     ",
030          "athrow                  ",
031          "checkcast               ",
032          "checkcast_notnull       ",
033          "checkcast_unresolved    ",
034          "must_implement_interface ",
035          "instanceof              ",
036          "instanceof_notnull      ",
037          "instanceof_unresolved   ",
038          "monitorenter            ",
039          "monitorexit             ",
040          "newobjmultiarray        ",
041          "getstatic               ",
042          "putstatic               ",
043          "getfield                ",
044          "putfield                ",
045          "int_zero_check          ",
046          "long_zero_check         ",
047          "bounds_check            ",
048          "objarray_store_check    ",
049          "objarray_store_check_notnull ",
050          "ig_patch_point          ",
051          "ig_class_test           ",
052          "ig_method_test          ",
053          "tableswitch             ",
054          "lookupswitch            ",
055          "int_aload               ",
056          "long_aload              ",
057          "float_aload             ",
058          "double_aload            ",
059          "ref_aload               ",
060          "ubyte_aload             ",
061          "byte_aload              ",
062          "ushort_aload            ",
063          "short_aload             ",
064          "int_astore              ",
065          "long_astore             ",
066          "float_astore            ",
067          "double_astore           ",
068          "ref_astore              ",
069          "byte_astore             ",
070          "short_astore            ",
071          "int_ifcmp               ",
072          "int_ifcmp2              ",
073          "long_ifcmp              ",
074          "float_ifcmp             ",
075          "double_ifcmp            ",
076          "ref_ifcmp               ",
077          "label                   ",
078          "bbend                   ",
079          "unint_begin             ",
080          "unint_end               ",
081          "fence                   ",
082          "read_ceiling            ",
083          "write_floor             ",
084          "phi                     ",
085          "split                   ",
086          "pi                      ",
087          "nop                     ",
088          "int_move                ",
089          "long_move               ",
090          "float_move              ",
091          "double_move             ",
092          "ref_move                ",
093          "guard_move              ",
094          "int_cond_move           ",
095          "long_cond_move          ",
096          "float_cond_move         ",
097          "double_cond_move        ",
098          "ref_cond_move           ",
099          "guard_cond_move         ",
100          "guard_combine           ",
101          "ref_add                 ",
102          "int_add                 ",
103          "long_add                ",
104          "float_add               ",
105          "double_add              ",
106          "ref_sub                 ",
107          "int_sub                 ",
108          "long_sub                ",
109          "float_sub               ",
110          "double_sub              ",
111          "int_mul                 ",
112          "long_mul                ",
113          "float_mul               ",
114          "double_mul              ",
115          "int_div                 ",
116          "long_div                ",
117          "float_div               ",
118          "double_div              ",
119          "int_rem                 ",
120          "long_rem                ",
121          "float_rem               ",
122          "double_rem              ",
123          "ref_neg                 ",
124          "int_neg                 ",
125          "long_neg                ",
126          "float_neg               ",
127          "double_neg              ",
128          "float_sqrt              ",
129          "double_sqrt             ",
130          "ref_shl                 ",
131          "int_shl                 ",
132          "long_shl                ",
133          "ref_shr                 ",
134          "int_shr                 ",
135          "long_shr                ",
136          "ref_ushr                ",
137          "int_ushr                ",
138          "long_ushr               ",
139          "ref_and                 ",
140          "int_and                 ",
141          "long_and                ",
142          "ref_or                  ",
143          "int_or                  ",
144          "long_or                 ",
145          "ref_xor                 ",
146          "int_xor                 ",
147          "ref_not                 ",
148          "int_not                 ",
149          "long_not                ",
150          "long_xor                ",
151          "int_2addrsigext         ",
152          "int_2addrze.ext         ",
153          "long_2addr              ",
154          "addr_2int               ",
155          "addr_2long              ",
156          "int_2long               ",
157          "int_2float              ",
158          "int_2double             ",
159          "long_2int               ",
160          "long_2float             ",
161          "long_2double            ",
162          "float_2int              ",
163          "float_2long             ",
164          "float_2double           ",
165          "double_2int             ",
166          "double_2long            ",
167          "double_2float           ",
168          "int_2byte               ",
169          "int_2ushort             ",
170          "int_2short              ",
171          "long_cmp                ",
172          "float_cmpl              ",
173          "float_cmpg              ",
174          "double_cmpl             ",
175          "double_cmpg             ",
176          "return                  ",
177          "null_check              ",
178          "goto                    ",
179          "boolean_not             ",
180          "boolean_cmp_int         ",
181          "boolean_cmp_addr        ",
182          "boolean_cmp_long        ",
183          "boolean_cmp_float       ",
184          "boolean_cmp_double      ",
185          "byte_load               ",
186          "ubyte_load              ",
187          "short_load              ",
188          "ushort_load             ",
189          "ref_load                ",
190          "ref_store               ",
191          "int_load                ",
192          "long_load               ",
193          "float_load              ",
194          "double_load             ",
195          "byte_store              ",
196          "short_store             ",
197          "int_store               ",
198          "long_store              ",
199          "float_store             ",
200          "double_store            ",
201          "prepare_int             ",
202          "prepare_addr            ",
203          "prepare_long            ",
204          "attempt_int             ",
205          "attempt_addr            ",
206          "attempt_long            ",
207          "call                    ",
208          "syscall                 ",
209          "yieldpoint_prologue     ",
210          "yieldpoint_epilogue     ",
211          "yieldpoint_backedge     ",
212          "yieldpoint_osr          ",
213          "osr_barrier             ",
214          "ir_prologue             ",
215          "resolve                 ",
216          "resolve_member          ",
217          "get_time_base           ",
218          "instrumented_event_counter ",
219          "trap_if                 ",
220          "trap                    ",
221          "float_as_int_bits       ",
222          "int_bits_as_float       ",
223          "double_as_long_bits     ",
224          "long_bits_as_double     ",
225          "arraylength             ",
226          "get_obj_tib             ",
227          "get_class_tib           ",
228          "get_type_from_tib       ",
229          "get_superclass_ids_from_tib ",
230          "get_does_implement_from_tib ",
231          "get_array_element_tib_from_tib ",
232          "lowtableswitch          ",
233      //////////////////////////
234      // END   Architecture Independent opcodes.
235      // BEGIN Architecture Dependent opcodes & MIR.
236      //////////////////////////
237          "address_constant        ",
238          "int_constant            ",
239          "long_constant           ",
240          "register                ",
241          "other_operand           ",
242          "null                    ",
243          "branch_target           ",
244          "materialize_fp_constant ",
245          "get_current_processor   ",
246          "round_to_zero           ",
247          "clear_floating_point_state ",
248          "prefetch                ",
249          "pause                   ",
250          "fp_add                  ",
251          "fp_sub                  ",
252          "fp_mul                  ",
253          "fp_div                  ",
254          "fp_neg                  ",
255          "fp_rem                  ",
256          "int_2fp                 ",
257          "long_2fp                ",
258          "cmp_cmov                ",
259          "fcmp_cmov               ",
260          "lcmp_cmov               ",
261          "cmp_fcmov               ",
262          "fcmp_fcmov              ",
263          "call_save_volatile      ",
264          "mir_start               ",
265          "require_esp             ",
266          "advise_esp              ",
267          "mir_lowtableswitch      ",
268          "ia32_methodstart        ",
269          "ia32_fclear             ",
270          "dummy_def               ",
271          "dummy_use               ",
272          "ia32_fmov_ending_live_range ",
273          "ia32_fmov               ",
274          "ia32_trapif             ",
275          "ia32_offset             ",
276          "ia32_lock_cmpxchg       ",
277          "ia32_lock_cmpxchg8b     ",
278          "ia32_adc                ",
279          "ia32_add                ",
280          "ia32_and                ",
281          "ia32_bswap              ",
282          "ia32_bt                 ",
283          "ia32_btc                ",
284          "ia32_btr                ",
285          "ia32_bts                ",
286          "ia32_syscall            ",
287          "ia32_call               ",
288          "ia32_cdq                ",
289          "ia32_cdo                ",
290          "ia32_cdqe               ",
291          "ia32_cmov               ",
292          "ia32_cmp                ",
293          "ia32_cmpxchg            ",
294          "ia32_cmpxchg8b          ",
295          "ia32_dec                ",
296          "ia32_div                ",
297          "ia32_fadd               ",
298          "ia32_faddp              ",
299          "ia32_fchs               ",
300          "ia32_fcmov              ",
301          "ia32_fcomi              ",
302          "ia32_fcomip             ",
303          "ia32_fdiv               ",
304          "ia32_fdivp              ",
305          "ia32_fdivr              ",
306          "ia32_fdivrp             ",
307          "ia32_fexam              ",
308          "ia32_fxch               ",
309          "ia32_ffree              ",
310          "ia32_fiadd              ",
311          "ia32_fidiv              ",
312          "ia32_fidivr             ",
313          "ia32_fild               ",
314          "ia32_fimul              ",
315          "ia32_finit              ",
316          "ia32_fist               ",
317          "ia32_fistp              ",
318          "ia32_fisub              ",
319          "ia32_fisubr             ",
320          "ia32_fld                ",
321          "ia32_fldcw              ",
322          "ia32_fld1               ",
323          "ia32_fldl2t             ",
324          "ia32_fldl2e             ",
325          "ia32_fldpi              ",
326          "ia32_fldlg2             ",
327          "ia32_fldln2             ",
328          "ia32_fldz               ",
329          "ia32_fmul               ",
330          "ia32_fmulp              ",
331          "ia32_fnstcw             ",
332          "ia32_fninit             ",
333          "ia32_fnsave             ",
334          "ia32_fprem              ",
335          "ia32_frstor             ",
336          "ia32_fst                ",
337          "ia32_fstcw              ",
338          "ia32_fstp               ",
339          "ia32_fsub               ",
340          "ia32_fsubp              ",
341          "ia32_fsubr              ",
342          "ia32_fsubrp             ",
343          "ia32_fucomi             ",
344          "ia32_fucomip            ",
345          "ia32_idiv               ",
346          "ia32_imul1              ",
347          "ia32_imul2              ",
348          "ia32_inc                ",
349          "ia32_int                ",
350          "ia32_jcc                ",
351          "ia32_jcc2               ",
352          "ia32_jmp                ",
353          "ia32_lea                ",
354          "ia32_lock               ",
355          "ia32_mov                ",
356          "ia32_movzx__b           ",
357          "ia32_movsx__b           ",
358          "ia32_movzx__w           ",
359          "ia32_movsx__w           ",
360          "ia32_movzxq__b          ",
361          "ia32_movsxq__b          ",
362          "ia32_movzxq__w          ",
363          "ia32_movsxq__w          ",
364          "ia32_mul                ",
365          "ia32_neg                ",
366          "ia32_not                ",
367          "ia32_or                 ",
368          "ia32_mfence             ",
369          "ia32_pause              ",
370          "ia32_prefetchnta        ",
371          "ia32_pop                ",
372          "ia32_push               ",
373          "ia32_rcl                ",
374          "ia32_rcr                ",
375          "ia32_rol                ",
376          "ia32_ror                ",
377          "ia32_ret                ",
378          "ia32_sal                ",
379          "ia32_sar                ",
380          "ia32_shl                ",
381          "ia32_shr                ",
382          "ia32_sbb                ",
383          "ia32_set__b             ",
384          "ia32_shld               ",
385          "ia32_shrd               ",
386          "ia32_sub                ",
387          "ia32_test               ",
388          "ia32_xor                ",
389          "ia32_rdtsc              ",
390          "ia32_addss              ",
391          "ia32_subss              ",
392          "ia32_mulss              ",
393          "ia32_divss              ",
394          "ia32_addsd              ",
395          "ia32_subsd              ",
396          "ia32_mulsd              ",
397          "ia32_divsd              ",
398          "ia32_andps              ",
399          "ia32_andpd              ",
400          "ia32_andnps             ",
401          "ia32_andnpd             ",
402          "ia32_orps               ",
403          "ia32_orpd               ",
404          "ia32_xorps              ",
405          "ia32_xorpd              ",
406          "ia32_ucomiss            ",
407          "ia32_ucomisd            ",
408          "ia32_cmpeqss            ",
409          "ia32_cmpltss            ",
410          "ia32_cmpless            ",
411          "ia32_cmpunordss         ",
412          "ia32_cmpness            ",
413          "ia32_cmpnltss           ",
414          "ia32_cmpnless           ",
415          "ia32_cmpordss           ",
416          "ia32_cmpeqsd            ",
417          "ia32_cmpltsd            ",
418          "ia32_cmplesd            ",
419          "ia32_cmpunordsd         ",
420          "ia32_cmpnesd            ",
421          "ia32_cmpnltsd           ",
422          "ia32_cmpnlesd           ",
423          "ia32_cmpordsd           ",
424          "ia32_movlpd             ",
425          "ia32_movlps             ",
426          "ia32_movss              ",
427          "ia32_movsd              ",
428          "ia32_movd               ",
429          "ia32_movq               ",
430          "ia32_psllq              ",
431          "ia32_psrlq              ",
432          "ia32_sqrtss             ",
433          "ia32_sqrtsd             ",
434          "ia32_cvtsi2ss           ",
435          "ia32_cvtss2sd           ",
436          "ia32_cvtss2si           ",
437          "ia32_cvttss2si          ",
438          "ia32_cvtsi2sd           ",
439          "ia32_cvtsd2ss           ",
440          "ia32_cvtsd2si           ",
441          "ia32_cvttsd2si          ",
442          "ia32_cvtsi2sdq          ",
443          "ia32_cvtsd2siq          ",
444          "ia32_cvttsd2siq         ",
445          "mir_end                 ",
446          "<UNKNOWN OPERATOR>"
447        };
448    
449      public static String toString(Operator operator) {
450         try {
451           return operatorName[operator.opcode];
452         }
453         catch (ArrayIndexOutOfBoundsException e) {
454           return operatorName[operatorName.length-1];
455         }
456      }
457    
458    }
459    
460