comparison src/share/vm/c1/c1_ValueMap.hpp @ 459:3a86a8dcf27c

6756768: C1 generates invalid code Reviewed-by: kvn, jrose
author never
date Tue, 25 Nov 2008 13:14:07 -0800
parents a61af66fc99e
children ad8c8ca4ab0f
comparison
equal deleted inserted replaced
443:b5e603f2e024 459:3a86a8dcf27c
131 virtual void kill_memory() = 0; 131 virtual void kill_memory() = 0;
132 virtual void kill_field(ciField* field) = 0; 132 virtual void kill_field(ciField* field) = 0;
133 virtual void kill_array(ValueType* type) = 0; 133 virtual void kill_array(ValueType* type) = 0;
134 134
135 // visitor functions 135 // visitor functions
136 void do_StoreField (StoreField* x) { kill_field(x->field()); }; 136 void do_StoreField (StoreField* x) {
137 void do_StoreIndexed (StoreIndexed* x) { kill_array(x->type()); }; 137 if (!x->is_initialized()) {
138 void do_MonitorEnter (MonitorEnter* x) { kill_memory(); }; 138 kill_memory();
139 void do_MonitorExit (MonitorExit* x) { kill_memory(); }; 139 } else {
140 void do_Invoke (Invoke* x) { kill_memory(); }; 140 kill_field(x->field());
141 void do_UnsafePutRaw (UnsafePutRaw* x) { kill_memory(); }; 141 }
142 void do_UnsafePutObject(UnsafePutObject* x) { kill_memory(); }; 142 }
143 void do_Intrinsic (Intrinsic* x) { if (!x->preserves_state()) kill_memory(); }; 143 void do_StoreIndexed (StoreIndexed* x) { kill_array(x->type()); }
144 144 void do_MonitorEnter (MonitorEnter* x) { kill_memory(); }
145 void do_Phi (Phi* x) { /* nothing to do */ }; 145 void do_MonitorExit (MonitorExit* x) { kill_memory(); }
146 void do_Local (Local* x) { /* nothing to do */ }; 146 void do_Invoke (Invoke* x) { kill_memory(); }
147 void do_Constant (Constant* x) { /* nothing to do */ }; 147 void do_UnsafePutRaw (UnsafePutRaw* x) { kill_memory(); }
148 void do_LoadField (LoadField* x) { /* nothing to do */ }; 148 void do_UnsafePutObject(UnsafePutObject* x) { kill_memory(); }
149 void do_ArrayLength (ArrayLength* x) { /* nothing to do */ }; 149 void do_Intrinsic (Intrinsic* x) { if (!x->preserves_state()) kill_memory(); }
150 void do_LoadIndexed (LoadIndexed* x) { /* nothing to do */ }; 150
151 void do_NegateOp (NegateOp* x) { /* nothing to do */ }; 151 void do_Phi (Phi* x) { /* nothing to do */ }
152 void do_ArithmeticOp (ArithmeticOp* x) { /* nothing to do */ }; 152 void do_Local (Local* x) { /* nothing to do */ }
153 void do_ShiftOp (ShiftOp* x) { /* nothing to do */ }; 153 void do_Constant (Constant* x) { /* nothing to do */ }
154 void do_LogicOp (LogicOp* x) { /* nothing to do */ }; 154 void do_LoadField (LoadField* x) {
155 void do_CompareOp (CompareOp* x) { /* nothing to do */ }; 155 if (!x->is_initialized()) {
156 void do_IfOp (IfOp* x) { /* nothing to do */ }; 156 kill_memory();
157 void do_Convert (Convert* x) { /* nothing to do */ }; 157 }
158 void do_NullCheck (NullCheck* x) { /* nothing to do */ }; 158 }
159 void do_NewInstance (NewInstance* x) { /* nothing to do */ }; 159 void do_ArrayLength (ArrayLength* x) { /* nothing to do */ }
160 void do_NewTypeArray (NewTypeArray* x) { /* nothing to do */ }; 160 void do_LoadIndexed (LoadIndexed* x) { /* nothing to do */ }
161 void do_NewObjectArray (NewObjectArray* x) { /* nothing to do */ }; 161 void do_NegateOp (NegateOp* x) { /* nothing to do */ }
162 void do_NewMultiArray (NewMultiArray* x) { /* nothing to do */ }; 162 void do_ArithmeticOp (ArithmeticOp* x) { /* nothing to do */ }
163 void do_CheckCast (CheckCast* x) { /* nothing to do */ }; 163 void do_ShiftOp (ShiftOp* x) { /* nothing to do */ }
164 void do_InstanceOf (InstanceOf* x) { /* nothing to do */ }; 164 void do_LogicOp (LogicOp* x) { /* nothing to do */ }
165 void do_BlockBegin (BlockBegin* x) { /* nothing to do */ }; 165 void do_CompareOp (CompareOp* x) { /* nothing to do */ }
166 void do_Goto (Goto* x) { /* nothing to do */ }; 166 void do_IfOp (IfOp* x) { /* nothing to do */ }
167 void do_If (If* x) { /* nothing to do */ }; 167 void do_Convert (Convert* x) { /* nothing to do */ }
168 void do_IfInstanceOf (IfInstanceOf* x) { /* nothing to do */ }; 168 void do_NullCheck (NullCheck* x) { /* nothing to do */ }
169 void do_TableSwitch (TableSwitch* x) { /* nothing to do */ }; 169 void do_NewInstance (NewInstance* x) { /* nothing to do */ }
170 void do_LookupSwitch (LookupSwitch* x) { /* nothing to do */ }; 170 void do_NewTypeArray (NewTypeArray* x) { /* nothing to do */ }
171 void do_Return (Return* x) { /* nothing to do */ }; 171 void do_NewObjectArray (NewObjectArray* x) { /* nothing to do */ }
172 void do_Throw (Throw* x) { /* nothing to do */ }; 172 void do_NewMultiArray (NewMultiArray* x) { /* nothing to do */ }
173 void do_Base (Base* x) { /* nothing to do */ }; 173 void do_CheckCast (CheckCast* x) { /* nothing to do */ }
174 void do_OsrEntry (OsrEntry* x) { /* nothing to do */ }; 174 void do_InstanceOf (InstanceOf* x) { /* nothing to do */ }
175 void do_ExceptionObject(ExceptionObject* x) { /* nothing to do */ }; 175 void do_BlockBegin (BlockBegin* x) { /* nothing to do */ }
176 void do_RoundFP (RoundFP* x) { /* nothing to do */ }; 176 void do_Goto (Goto* x) { /* nothing to do */ }
177 void do_UnsafeGetRaw (UnsafeGetRaw* x) { /* nothing to do */ }; 177 void do_If (If* x) { /* nothing to do */ }
178 void do_UnsafeGetObject(UnsafeGetObject* x) { /* nothing to do */ }; 178 void do_IfInstanceOf (IfInstanceOf* x) { /* nothing to do */ }
179 void do_UnsafePrefetchRead (UnsafePrefetchRead* x) { /* nothing to do */ }; 179 void do_TableSwitch (TableSwitch* x) { /* nothing to do */ }
180 void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) { /* nothing to do */ }; 180 void do_LookupSwitch (LookupSwitch* x) { /* nothing to do */ }
181 void do_ProfileCall (ProfileCall* x) { /* nothing to do */ }; 181 void do_Return (Return* x) { /* nothing to do */ }
182 void do_ProfileCounter (ProfileCounter* x) { /* nothing to do */ }; 182 void do_Throw (Throw* x) { /* nothing to do */ }
183 void do_Base (Base* x) { /* nothing to do */ }
184 void do_OsrEntry (OsrEntry* x) { /* nothing to do */ }
185 void do_ExceptionObject(ExceptionObject* x) { /* nothing to do */ }
186 void do_RoundFP (RoundFP* x) { /* nothing to do */ }
187 void do_UnsafeGetRaw (UnsafeGetRaw* x) { /* nothing to do */ }
188 void do_UnsafeGetObject(UnsafeGetObject* x) { /* nothing to do */ }
189 void do_UnsafePrefetchRead (UnsafePrefetchRead* x) { /* nothing to do */ }
190 void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) { /* nothing to do */ }
191 void do_ProfileCall (ProfileCall* x) { /* nothing to do */ }
192 void do_ProfileCounter (ProfileCounter* x) { /* nothing to do */ }
193 };
194
195
196 class ValueNumberingEffects: public ValueNumberingVisitor {
197 private:
198 ValueMap* _map;
199
200 public:
201 // implementation for abstract methods of ValueNumberingVisitor
202 void kill_memory() { _map->kill_memory(); }
203 void kill_field(ciField* field) { _map->kill_field(field); }
204 void kill_array(ValueType* type) { _map->kill_array(type); }
205
206 ValueNumberingEffects(ValueMap* map): _map(map) {}
183 }; 207 };
184 208
185 209
186 class GlobalValueNumbering: public ValueNumberingVisitor { 210 class GlobalValueNumbering: public ValueNumberingVisitor {
187 private: 211 private: