comparison src/share/vm/c1/c1_Instruction.hpp @ 1791:3a294e483abc

6919069: client compiler needs to capture more profile information for tiered work Summary: Added profiling of instanceof and aastore. Reviewed-by: kvn, jrose, never
author iveresov
date Mon, 13 Sep 2010 12:10:49 -0700
parents d5d065957597
children f02a8bbe6ed4
comparison
equal deleted inserted replaced
1790:7f9553bedfd5 1791:3a294e483abc
904 904
905 LEAF(StoreIndexed, AccessIndexed) 905 LEAF(StoreIndexed, AccessIndexed)
906 private: 906 private:
907 Value _value; 907 Value _value;
908 908
909 ciMethod* _profiled_method;
910 int _profiled_bci;
909 public: 911 public:
910 // creation 912 // creation
911 StoreIndexed(Value array, Value index, Value length, BasicType elt_type, Value value, ValueStack* lock_stack) 913 StoreIndexed(Value array, Value index, Value length, BasicType elt_type, Value value, ValueStack* lock_stack)
912 : AccessIndexed(array, index, length, elt_type, lock_stack) 914 : AccessIndexed(array, index, length, elt_type, lock_stack)
913 , _value(value) 915 , _value(value), _profiled_method(NULL), _profiled_bci(0)
914 { 916 {
915 set_flag(NeedsWriteBarrierFlag, (as_ValueType(elt_type)->is_object())); 917 set_flag(NeedsWriteBarrierFlag, (as_ValueType(elt_type)->is_object()));
916 set_flag(NeedsStoreCheckFlag, (as_ValueType(elt_type)->is_object())); 918 set_flag(NeedsStoreCheckFlag, (as_ValueType(elt_type)->is_object()));
917 ASSERT_VALUES 919 ASSERT_VALUES
918 pin(); 920 pin();
921 // accessors 923 // accessors
922 Value value() const { return _value; } 924 Value value() const { return _value; }
923 IRScope* scope() const; // the state's scope 925 IRScope* scope() const; // the state's scope
924 bool needs_write_barrier() const { return check_flag(NeedsWriteBarrierFlag); } 926 bool needs_write_barrier() const { return check_flag(NeedsWriteBarrierFlag); }
925 bool needs_store_check() const { return check_flag(NeedsStoreCheckFlag); } 927 bool needs_store_check() const { return check_flag(NeedsStoreCheckFlag); }
926 928 // Helpers for methodDataOop profiling
929 void set_should_profile(bool value) { set_flag(ProfileMDOFlag, value); }
930 void set_profiled_method(ciMethod* method) { _profiled_method = method; }
931 void set_profiled_bci(int bci) { _profiled_bci = bci; }
932 bool should_profile() const { return check_flag(ProfileMDOFlag); }
933 ciMethod* profiled_method() const { return _profiled_method; }
934 int profiled_bci() const { return _profiled_bci; }
927 // generic 935 // generic
928 virtual void input_values_do(ValueVisitor* f) { AccessIndexed::input_values_do(f); f->visit(&_value); } 936 virtual void input_values_do(ValueVisitor* f) { AccessIndexed::input_values_do(f); f->visit(&_value); }
929 }; 937 };
930 938
931 939
1295 private: 1303 private:
1296 ciKlass* _klass; 1304 ciKlass* _klass;
1297 Value _obj; 1305 Value _obj;
1298 ValueStack* _state_before; 1306 ValueStack* _state_before;
1299 1307
1300 public: 1308 ciMethod* _profiled_method;
1301 // creation 1309 int _profiled_bci;
1302 TypeCheck(ciKlass* klass, Value obj, ValueType* type, ValueStack* state_before) : StateSplit(type), _klass(klass), _obj(obj), _state_before(state_before) { 1310
1311 public:
1312 // creation
1313 TypeCheck(ciKlass* klass, Value obj, ValueType* type, ValueStack* state_before)
1314 : StateSplit(type), _klass(klass), _obj(obj), _state_before(state_before),
1315 _profiled_method(NULL), _profiled_bci(0) {
1303 ASSERT_VALUES 1316 ASSERT_VALUES
1304 set_direct_compare(false); 1317 set_direct_compare(false);
1305 } 1318 }
1306 1319
1307 // accessors 1320 // accessors
1316 1329
1317 // generic 1330 // generic
1318 virtual bool can_trap() const { return true; } 1331 virtual bool can_trap() const { return true; }
1319 virtual void input_values_do(ValueVisitor* f) { StateSplit::input_values_do(f); f->visit(&_obj); } 1332 virtual void input_values_do(ValueVisitor* f) { StateSplit::input_values_do(f); f->visit(&_obj); }
1320 virtual void other_values_do(ValueVisitor* f); 1333 virtual void other_values_do(ValueVisitor* f);
1321 };
1322
1323
1324 LEAF(CheckCast, TypeCheck)
1325 private:
1326 ciMethod* _profiled_method;
1327 int _profiled_bci;
1328
1329 public:
1330 // creation
1331 CheckCast(ciKlass* klass, Value obj, ValueStack* state_before)
1332 : TypeCheck(klass, obj, objectType, state_before)
1333 , _profiled_method(NULL)
1334 , _profiled_bci(0) {}
1335
1336 void set_incompatible_class_change_check() {
1337 set_flag(ThrowIncompatibleClassChangeErrorFlag, true);
1338 }
1339 bool is_incompatible_class_change_check() const {
1340 return check_flag(ThrowIncompatibleClassChangeErrorFlag);
1341 }
1342 1334
1343 // Helpers for methodDataOop profiling 1335 // Helpers for methodDataOop profiling
1344 void set_should_profile(bool value) { set_flag(ProfileMDOFlag, value); } 1336 void set_should_profile(bool value) { set_flag(ProfileMDOFlag, value); }
1345 void set_profiled_method(ciMethod* method) { _profiled_method = method; } 1337 void set_profiled_method(ciMethod* method) { _profiled_method = method; }
1346 void set_profiled_bci(int bci) { _profiled_bci = bci; } 1338 void set_profiled_bci(int bci) { _profiled_bci = bci; }
1347 bool should_profile() const { return check_flag(ProfileMDOFlag); } 1339 bool should_profile() const { return check_flag(ProfileMDOFlag); }
1348 ciMethod* profiled_method() const { return _profiled_method; } 1340 ciMethod* profiled_method() const { return _profiled_method; }
1349 int profiled_bci() const { return _profiled_bci; } 1341 int profiled_bci() const { return _profiled_bci; }
1342 };
1343
1344
1345 LEAF(CheckCast, TypeCheck)
1346 public:
1347 // creation
1348 CheckCast(ciKlass* klass, Value obj, ValueStack* state_before)
1349 : TypeCheck(klass, obj, objectType, state_before) {}
1350
1351 void set_incompatible_class_change_check() {
1352 set_flag(ThrowIncompatibleClassChangeErrorFlag, true);
1353 }
1354 bool is_incompatible_class_change_check() const {
1355 return check_flag(ThrowIncompatibleClassChangeErrorFlag);
1356 }
1350 1357
1351 ciType* declared_type() const; 1358 ciType* declared_type() const;
1352 ciType* exact_type() const; 1359 ciType* exact_type() const;
1353
1354 }; 1360 };
1355 1361
1356 1362
1357 LEAF(InstanceOf, TypeCheck) 1363 LEAF(InstanceOf, TypeCheck)
1358 public: 1364 public: