src/share/vm/c1/c1_Instruction.hpp

changeset 2728
13bc79b5c9c8
parent 2634
425688247f3d
child 3100
a32de5085326
     1.1 --- a/src/share/vm/c1/c1_Instruction.hpp	Sat Apr 02 10:54:15 2011 -0700
     1.2 +++ b/src/share/vm/c1/c1_Instruction.hpp	Sun Apr 03 12:00:54 2011 +0200
     1.3 @@ -621,16 +621,21 @@
     1.4  LEAF(Local, Instruction)
     1.5   private:
     1.6    int      _java_index;                          // the local index within the method to which the local belongs
     1.7 +  ciType*  _declared_type;
     1.8   public:
     1.9    // creation
    1.10 -  Local(ValueType* type, int index)
    1.11 +  Local(ciType* declared, ValueType* type, int index)
    1.12      : Instruction(type)
    1.13      , _java_index(index)
    1.14 +    , _declared_type(declared)
    1.15    {}
    1.16  
    1.17    // accessors
    1.18    int java_index() const                         { return _java_index; }
    1.19  
    1.20 +  ciType* declared_type() const                  { return _declared_type; }
    1.21 +  ciType* exact_type() const;
    1.22 +
    1.23    // generic
    1.24    virtual void input_values_do(ValueVisitor* f)   { /* no values */ }
    1.25  };
    1.26 @@ -1146,6 +1151,8 @@
    1.27    BasicTypeList* signature() const               { return _signature; }
    1.28    ciMethod* target() const                       { return _target; }
    1.29  
    1.30 +  ciType* declared_type() const;
    1.31 +
    1.32    // Returns false if target is not loaded
    1.33    bool target_is_final() const                   { return check_flag(TargetIsFinalFlag); }
    1.34    bool target_is_loaded() const                  { return check_flag(TargetIsLoadedFlag); }
    1.35 @@ -1187,6 +1194,7 @@
    1.36    // generic
    1.37    virtual bool can_trap() const                  { return true; }
    1.38    ciType* exact_type() const;
    1.39 +  ciType* declared_type() const;
    1.40  };
    1.41  
    1.42  
    1.43 @@ -1208,6 +1216,8 @@
    1.44  
    1.45    virtual bool needs_exception_state() const     { return false; }
    1.46  
    1.47 +  ciType* declared_type() const;
    1.48 +
    1.49    // generic
    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(&_length); }
    1.52 @@ -1397,6 +1407,7 @@
    1.53    vmIntrinsics::ID _id;
    1.54    Values*          _args;
    1.55    Value            _recv;
    1.56 +  int              _nonnull_state; // mask identifying which args are nonnull
    1.57  
    1.58   public:
    1.59    // preserves_state can be set to true for Intrinsics
    1.60 @@ -1417,6 +1428,7 @@
    1.61    , _id(id)
    1.62    , _args(args)
    1.63    , _recv(NULL)
    1.64 +  , _nonnull_state(AllBits)
    1.65    {
    1.66      assert(args != NULL, "args must exist");
    1.67      ASSERT_VALUES
    1.68 @@ -1442,6 +1454,23 @@
    1.69    Value receiver() const                         { assert(has_receiver(), "must have receiver"); return _recv; }
    1.70    bool preserves_state() const                   { return check_flag(PreservesStateFlag); }
    1.71  
    1.72 +  bool arg_needs_null_check(int i) {
    1.73 +    if (i >= 0 && i < (int)sizeof(_nonnull_state) * BitsPerByte) {
    1.74 +      return is_set_nth_bit(_nonnull_state, i);
    1.75 +    }
    1.76 +    return true;
    1.77 +  }
    1.78 +
    1.79 +  void set_arg_needs_null_check(int i, bool check) {
    1.80 +    if (i >= 0 && i < (int)sizeof(_nonnull_state) * BitsPerByte) {
    1.81 +      if (check) {
    1.82 +        _nonnull_state |= nth_bit(i);
    1.83 +      } else {
    1.84 +        _nonnull_state &= ~(nth_bit(i));
    1.85 +      }
    1.86 +    }
    1.87 +  }
    1.88 +
    1.89    // generic
    1.90    virtual bool can_trap() const                  { return check_flag(CanTrapFlag); }
    1.91    virtual void input_values_do(ValueVisitor* f) {

mercurial