annotate src/share/vm/c1/c1_InstructionPrinter.hpp @ 1552:c18cbe5936b8

6941466: Oracle rebranding changes for Hotspot repositories Summary: Change all the Sun copyrights to Oracle copyright Reviewed-by: ohair
author trims
date Thu, 27 May 2010 19:08:38 -0700
parents a61af66fc99e
children d5d065957597
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
2 * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
a61af66fc99e Initial load
duke
parents:
diff changeset
25 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
26 class InstructionPrinter: public InstructionVisitor {
a61af66fc99e Initial load
duke
parents:
diff changeset
27 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
28 outputStream* _output;
a61af66fc99e Initial load
duke
parents:
diff changeset
29 bool _print_phis;
a61af66fc99e Initial load
duke
parents:
diff changeset
30
a61af66fc99e Initial load
duke
parents:
diff changeset
31 enum LayoutConstants {
a61af66fc99e Initial load
duke
parents:
diff changeset
32 bci_pos = 2,
a61af66fc99e Initial load
duke
parents:
diff changeset
33 use_pos = 7,
a61af66fc99e Initial load
duke
parents:
diff changeset
34 temp_pos = 12,
a61af66fc99e Initial load
duke
parents:
diff changeset
35 instr_pos = 19,
a61af66fc99e Initial load
duke
parents:
diff changeset
36 end_pos = 60
a61af66fc99e Initial load
duke
parents:
diff changeset
37 };
a61af66fc99e Initial load
duke
parents:
diff changeset
38
a61af66fc99e Initial load
duke
parents:
diff changeset
39 bool is_illegal_phi(Value v);
a61af66fc99e Initial load
duke
parents:
diff changeset
40
a61af66fc99e Initial load
duke
parents:
diff changeset
41 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
42 InstructionPrinter(bool print_phis = true, outputStream* output = tty)
a61af66fc99e Initial load
duke
parents:
diff changeset
43 : _print_phis(print_phis)
a61af66fc99e Initial load
duke
parents:
diff changeset
44 , _output(output)
a61af66fc99e Initial load
duke
parents:
diff changeset
45 {}
a61af66fc99e Initial load
duke
parents:
diff changeset
46
a61af66fc99e Initial load
duke
parents:
diff changeset
47 outputStream* output() { return _output; }
a61af66fc99e Initial load
duke
parents:
diff changeset
48
a61af66fc99e Initial load
duke
parents:
diff changeset
49 // helpers
a61af66fc99e Initial load
duke
parents:
diff changeset
50 static const char* basic_type_name(BasicType type);
a61af66fc99e Initial load
duke
parents:
diff changeset
51 static const char* cond_name(If::Condition cond);
a61af66fc99e Initial load
duke
parents:
diff changeset
52 static const char* op_name(Bytecodes::Code op);
a61af66fc99e Initial load
duke
parents:
diff changeset
53 bool is_phi_of_block(Value v, BlockBegin* b);
a61af66fc99e Initial load
duke
parents:
diff changeset
54
a61af66fc99e Initial load
duke
parents:
diff changeset
55 // type-specific print functions
a61af66fc99e Initial load
duke
parents:
diff changeset
56 void print_klass(ciKlass* klass);
a61af66fc99e Initial load
duke
parents:
diff changeset
57 void print_object(Value obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
58
a61af66fc99e Initial load
duke
parents:
diff changeset
59 // generic print functions
a61af66fc99e Initial load
duke
parents:
diff changeset
60 void print_temp(Value value);
a61af66fc99e Initial load
duke
parents:
diff changeset
61 void print_field(AccessField* field);
a61af66fc99e Initial load
duke
parents:
diff changeset
62 void print_indexed(AccessIndexed* indexed);
a61af66fc99e Initial load
duke
parents:
diff changeset
63 void print_monitor(AccessMonitor* monitor);
a61af66fc99e Initial load
duke
parents:
diff changeset
64 void print_op2(Op2* instr);
a61af66fc99e Initial load
duke
parents:
diff changeset
65 void print_value(Value value);
a61af66fc99e Initial load
duke
parents:
diff changeset
66 void print_instr(Instruction* instr);
a61af66fc99e Initial load
duke
parents:
diff changeset
67 void print_stack(ValueStack* stack);
a61af66fc99e Initial load
duke
parents:
diff changeset
68 void print_inline_level(BlockBegin* block);
a61af66fc99e Initial load
duke
parents:
diff changeset
69 void print_unsafe_op(UnsafeOp* op, const char* name);
a61af66fc99e Initial load
duke
parents:
diff changeset
70 void print_unsafe_raw_op(UnsafeRawOp* op, const char* name);
a61af66fc99e Initial load
duke
parents:
diff changeset
71 void print_unsafe_object_op(UnsafeObjectOp* op, const char* name);
a61af66fc99e Initial load
duke
parents:
diff changeset
72 void print_phi(int i, Value v, BlockBegin* b);
a61af66fc99e Initial load
duke
parents:
diff changeset
73 void print_alias(Value v);
a61af66fc99e Initial load
duke
parents:
diff changeset
74
a61af66fc99e Initial load
duke
parents:
diff changeset
75 // line printing of instructions
a61af66fc99e Initial load
duke
parents:
diff changeset
76 void fill_to(int pos, char filler = ' ');
a61af66fc99e Initial load
duke
parents:
diff changeset
77 void print_head();
a61af66fc99e Initial load
duke
parents:
diff changeset
78 void print_line(Instruction* instr);
a61af66fc99e Initial load
duke
parents:
diff changeset
79
a61af66fc99e Initial load
duke
parents:
diff changeset
80 // visitor functionality
a61af66fc99e Initial load
duke
parents:
diff changeset
81 virtual void do_Phi (Phi* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
82 virtual void do_Local (Local* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
83 virtual void do_Constant (Constant* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
84 virtual void do_LoadField (LoadField* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
85 virtual void do_StoreField (StoreField* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
86 virtual void do_ArrayLength (ArrayLength* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
87 virtual void do_LoadIndexed (LoadIndexed* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
88 virtual void do_StoreIndexed (StoreIndexed* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
89 virtual void do_NegateOp (NegateOp* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
90 virtual void do_ArithmeticOp (ArithmeticOp* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
91 virtual void do_ShiftOp (ShiftOp* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
92 virtual void do_LogicOp (LogicOp* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
93 virtual void do_CompareOp (CompareOp* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
94 virtual void do_IfOp (IfOp* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
95 virtual void do_Convert (Convert* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
96 virtual void do_NullCheck (NullCheck* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
97 virtual void do_Invoke (Invoke* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
98 virtual void do_NewInstance (NewInstance* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
99 virtual void do_NewTypeArray (NewTypeArray* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
100 virtual void do_NewObjectArray (NewObjectArray* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
101 virtual void do_NewMultiArray (NewMultiArray* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
102 virtual void do_CheckCast (CheckCast* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
103 virtual void do_InstanceOf (InstanceOf* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
104 virtual void do_MonitorEnter (MonitorEnter* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
105 virtual void do_MonitorExit (MonitorExit* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
106 virtual void do_Intrinsic (Intrinsic* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
107 virtual void do_BlockBegin (BlockBegin* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
108 virtual void do_Goto (Goto* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
109 virtual void do_If (If* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
110 virtual void do_IfInstanceOf (IfInstanceOf* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
111 virtual void do_TableSwitch (TableSwitch* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
112 virtual void do_LookupSwitch (LookupSwitch* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
113 virtual void do_Return (Return* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
114 virtual void do_Throw (Throw* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
115 virtual void do_Base (Base* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
116 virtual void do_OsrEntry (OsrEntry* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
117 virtual void do_ExceptionObject(ExceptionObject* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
118 virtual void do_RoundFP (RoundFP* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
119 virtual void do_UnsafeGetRaw (UnsafeGetRaw* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
120 virtual void do_UnsafePutRaw (UnsafePutRaw* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
121 virtual void do_UnsafeGetObject(UnsafeGetObject* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
122 virtual void do_UnsafePutObject(UnsafePutObject* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
123 virtual void do_UnsafePrefetchRead (UnsafePrefetchRead* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
124 virtual void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
125 virtual void do_ProfileCall (ProfileCall* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
126 virtual void do_ProfileCounter (ProfileCounter* x);
a61af66fc99e Initial load
duke
parents:
diff changeset
127 };
a61af66fc99e Initial load
duke
parents:
diff changeset
128 #endif // PRODUCT