124 // debugging/printing 125 void print(); 126 127 static void reset_statistics(); 128 static void print_statistics(); 129 #endif 130 }; 131 132 define_array(ValueMapArray, ValueMap*) 133 134 135 class ValueNumberingVisitor: public InstructionVisitor { 136 protected: 137 // called by visitor functions for instructions that kill values 138 virtual void kill_memory() = 0; 139 virtual void kill_field(ciField* field) = 0; 140 virtual void kill_array(ValueType* type) = 0; 141 142 // visitor functions 143 void do_StoreField (StoreField* x) { 144 if (!x->is_initialized()) { 145 kill_memory(); 146 } else { 147 kill_field(x->field()); 148 } 149 } 150 void do_StoreIndexed (StoreIndexed* x) { kill_array(x->type()); } 151 void do_MonitorEnter (MonitorEnter* x) { kill_memory(); } 152 void do_MonitorExit (MonitorExit* x) { kill_memory(); } 153 void do_Invoke (Invoke* x) { kill_memory(); } 154 void do_UnsafePutRaw (UnsafePutRaw* x) { kill_memory(); } 155 void do_UnsafePutObject(UnsafePutObject* x) { kill_memory(); } 156 void do_Intrinsic (Intrinsic* x) { if (!x->preserves_state()) kill_memory(); } 157 158 void do_Phi (Phi* x) { /* nothing to do */ } 159 void do_Local (Local* x) { /* nothing to do */ } 160 void do_Constant (Constant* x) { /* nothing to do */ } 161 void do_LoadField (LoadField* x) { 162 if (!x->is_initialized()) { 163 kill_memory(); 164 } 165 } 166 void do_ArrayLength (ArrayLength* x) { /* nothing to do */ } 167 void do_LoadIndexed (LoadIndexed* x) { /* nothing to do */ } 168 void do_NegateOp (NegateOp* x) { /* nothing to do */ } 169 void do_ArithmeticOp (ArithmeticOp* x) { /* nothing to do */ } 170 void do_ShiftOp (ShiftOp* x) { /* nothing to do */ } 171 void do_LogicOp (LogicOp* x) { /* nothing to do */ } 172 void do_CompareOp (CompareOp* x) { /* nothing to do */ } 173 void do_IfOp (IfOp* x) { /* nothing to do */ } 174 void do_Convert (Convert* x) { /* nothing to do */ } 175 void do_NullCheck (NullCheck* x) { /* nothing to do */ } 176 void do_NewInstance (NewInstance* x) { /* nothing to do */ } 177 void do_NewTypeArray (NewTypeArray* x) { /* nothing to do */ } 178 void do_NewObjectArray (NewObjectArray* x) { /* nothing to do */ } 179 void do_NewMultiArray (NewMultiArray* x) { /* nothing to do */ } 180 void do_CheckCast (CheckCast* x) { /* nothing to do */ } 181 void do_InstanceOf (InstanceOf* x) { /* nothing to do */ } 182 void do_BlockBegin (BlockBegin* x) { /* nothing to do */ } | 124 // debugging/printing 125 void print(); 126 127 static void reset_statistics(); 128 static void print_statistics(); 129 #endif 130 }; 131 132 define_array(ValueMapArray, ValueMap*) 133 134 135 class ValueNumberingVisitor: public InstructionVisitor { 136 protected: 137 // called by visitor functions for instructions that kill values 138 virtual void kill_memory() = 0; 139 virtual void kill_field(ciField* field) = 0; 140 virtual void kill_array(ValueType* type) = 0; 141 142 // visitor functions 143 void do_StoreField (StoreField* x) { 144 if (x->is_init_point()) { 145 // putstatic is an initialization point so treat it as a wide kill 146 kill_memory(); 147 } else { 148 kill_field(x->field()); 149 } 150 } 151 void do_StoreIndexed (StoreIndexed* x) { kill_array(x->type()); } 152 void do_MonitorEnter (MonitorEnter* x) { kill_memory(); } 153 void do_MonitorExit (MonitorExit* x) { kill_memory(); } 154 void do_Invoke (Invoke* x) { kill_memory(); } 155 void do_UnsafePutRaw (UnsafePutRaw* x) { kill_memory(); } 156 void do_UnsafePutObject(UnsafePutObject* x) { kill_memory(); } 157 void do_Intrinsic (Intrinsic* x) { if (!x->preserves_state()) kill_memory(); } 158 159 void do_Phi (Phi* x) { /* nothing to do */ } 160 void do_Local (Local* x) { /* nothing to do */ } 161 void do_Constant (Constant* x) { /* nothing to do */ } 162 void do_LoadField (LoadField* x) { 163 if (x->is_init_point()) { 164 // getstatic is an initialization point so treat it as a wide kill 165 kill_memory(); 166 } 167 } 168 void do_ArrayLength (ArrayLength* x) { /* nothing to do */ } 169 void do_LoadIndexed (LoadIndexed* x) { /* nothing to do */ } 170 void do_NegateOp (NegateOp* x) { /* nothing to do */ } 171 void do_ArithmeticOp (ArithmeticOp* x) { /* nothing to do */ } 172 void do_ShiftOp (ShiftOp* x) { /* nothing to do */ } 173 void do_LogicOp (LogicOp* x) { /* nothing to do */ } 174 void do_CompareOp (CompareOp* x) { /* nothing to do */ } 175 void do_IfOp (IfOp* x) { /* nothing to do */ } 176 void do_Convert (Convert* x) { /* nothing to do */ } 177 void do_NullCheck (NullCheck* x) { /* nothing to do */ } 178 void do_NewInstance (NewInstance* x) { /* nothing to do */ } 179 void do_NewTypeArray (NewTypeArray* x) { /* nothing to do */ } 180 void do_NewObjectArray (NewObjectArray* x) { /* nothing to do */ } 181 void do_NewMultiArray (NewMultiArray* x) { /* nothing to do */ } 182 void do_CheckCast (CheckCast* x) { /* nothing to do */ } 183 void do_InstanceOf (InstanceOf* x) { /* nothing to do */ } 184 void do_BlockBegin (BlockBegin* x) { /* nothing to do */ } |