src/share/vm/c1/c1_Instruction.hpp

changeset 2146
3a294e483abc
parent 2138
d5d065957597
child 2174
f02a8bbe6ed4
     1.1 --- a/src/share/vm/c1/c1_Instruction.hpp	Sat Sep 11 15:21:37 2010 -0700
     1.2 +++ b/src/share/vm/c1/c1_Instruction.hpp	Mon Sep 13 12:10:49 2010 -0700
     1.3 @@ -906,11 +906,13 @@
     1.4   private:
     1.5    Value       _value;
     1.6  
     1.7 +  ciMethod* _profiled_method;
     1.8 +  int       _profiled_bci;
     1.9   public:
    1.10    // creation
    1.11    StoreIndexed(Value array, Value index, Value length, BasicType elt_type, Value value, ValueStack* lock_stack)
    1.12    : AccessIndexed(array, index, length, elt_type, lock_stack)
    1.13 -  , _value(value)
    1.14 +  , _value(value), _profiled_method(NULL), _profiled_bci(0)
    1.15    {
    1.16      set_flag(NeedsWriteBarrierFlag, (as_ValueType(elt_type)->is_object()));
    1.17      set_flag(NeedsStoreCheckFlag, (as_ValueType(elt_type)->is_object()));
    1.18 @@ -923,7 +925,13 @@
    1.19    IRScope* scope() const;                        // the state's scope
    1.20    bool needs_write_barrier() const               { return check_flag(NeedsWriteBarrierFlag); }
    1.21    bool needs_store_check() const                 { return check_flag(NeedsStoreCheckFlag); }
    1.22 -
    1.23 +  // Helpers for methodDataOop profiling
    1.24 +  void set_should_profile(bool value)                { set_flag(ProfileMDOFlag, value); }
    1.25 +  void set_profiled_method(ciMethod* method)         { _profiled_method = method;   }
    1.26 +  void set_profiled_bci(int bci)                     { _profiled_bci = bci;         }
    1.27 +  bool      should_profile() const                   { return check_flag(ProfileMDOFlag); }
    1.28 +  ciMethod* profiled_method() const                  { return _profiled_method;     }
    1.29 +  int       profiled_bci() const                     { return _profiled_bci;        }
    1.30    // generic
    1.31    virtual void input_values_do(ValueVisitor* f)   { AccessIndexed::input_values_do(f); f->visit(&_value); }
    1.32  };
    1.33 @@ -1297,9 +1305,14 @@
    1.34    Value       _obj;
    1.35    ValueStack* _state_before;
    1.36  
    1.37 +  ciMethod* _profiled_method;
    1.38 +  int       _profiled_bci;
    1.39 +
    1.40   public:
    1.41    // creation
    1.42 -  TypeCheck(ciKlass* klass, Value obj, ValueType* type, ValueStack* state_before) : StateSplit(type), _klass(klass), _obj(obj), _state_before(state_before) {
    1.43 +  TypeCheck(ciKlass* klass, Value obj, ValueType* type, ValueStack* state_before)
    1.44 +  : StateSplit(type), _klass(klass), _obj(obj), _state_before(state_before),
    1.45 +    _profiled_method(NULL), _profiled_bci(0) {
    1.46      ASSERT_VALUES
    1.47      set_direct_compare(false);
    1.48    }
    1.49 @@ -1318,20 +1331,22 @@
    1.50    virtual bool can_trap() const                  { return true; }
    1.51    virtual void input_values_do(ValueVisitor* f)   { StateSplit::input_values_do(f); f->visit(&_obj); }
    1.52    virtual void other_values_do(ValueVisitor* f);
    1.53 +
    1.54 +  // Helpers for methodDataOop profiling
    1.55 +  void set_should_profile(bool value)                { set_flag(ProfileMDOFlag, value); }
    1.56 +  void set_profiled_method(ciMethod* method)         { _profiled_method = method;   }
    1.57 +  void set_profiled_bci(int bci)                     { _profiled_bci = bci;         }
    1.58 +  bool      should_profile() const                   { return check_flag(ProfileMDOFlag); }
    1.59 +  ciMethod* profiled_method() const                  { return _profiled_method;     }
    1.60 +  int       profiled_bci() const                     { return _profiled_bci;        }
    1.61  };
    1.62  
    1.63  
    1.64  LEAF(CheckCast, TypeCheck)
    1.65 - private:
    1.66 -  ciMethod* _profiled_method;
    1.67 -  int       _profiled_bci;
    1.68 -
    1.69   public:
    1.70    // creation
    1.71    CheckCast(ciKlass* klass, Value obj, ValueStack* state_before)
    1.72 -  : TypeCheck(klass, obj, objectType, state_before)
    1.73 -  , _profiled_method(NULL)
    1.74 -  , _profiled_bci(0) {}
    1.75 +  : TypeCheck(klass, obj, objectType, state_before) {}
    1.76  
    1.77    void set_incompatible_class_change_check() {
    1.78      set_flag(ThrowIncompatibleClassChangeErrorFlag, true);
    1.79 @@ -1340,17 +1355,8 @@
    1.80      return check_flag(ThrowIncompatibleClassChangeErrorFlag);
    1.81    }
    1.82  
    1.83 -  // Helpers for methodDataOop profiling
    1.84 -  void set_should_profile(bool value)                { set_flag(ProfileMDOFlag, value); }
    1.85 -  void set_profiled_method(ciMethod* method)         { _profiled_method = method;   }
    1.86 -  void set_profiled_bci(int bci)                     { _profiled_bci = bci;         }
    1.87 -  bool      should_profile() const                   { return check_flag(ProfileMDOFlag); }
    1.88 -  ciMethod* profiled_method() const                  { return _profiled_method;     }
    1.89 -  int       profiled_bci() const                     { return _profiled_bci;        }
    1.90 -
    1.91    ciType* declared_type() const;
    1.92    ciType* exact_type() const;
    1.93 -
    1.94  };
    1.95  
    1.96  

mercurial