Print this page
rev 1026 : imported patch indy.compiler.inline.patch

Split Close
Expand all
Collapse all
          --- old/src/share/vm/ci/ciField.hpp
          +++ new/src/share/vm/ci/ciField.hpp
↓ open down ↓ 130 lines elided ↑ open up ↑
 131  131    //      in question is allocated in perm space.
 132  132    //   4. The field is not one of the special static/final
 133  133    //      non-constant fields.  These are java.lang.System.in
 134  134    //      and java.lang.System.out.  Abomination.
 135  135    //
 136  136    // Note: the check for case 4 is not yet implemented.
 137  137    bool is_constant() { return _is_constant; }
 138  138  
 139  139    // Get the constant value of this field.
 140  140    ciConstant constant_value() {
 141      -    assert(is_constant(), "illegal call to constant_value()");
      141 +    assert(is_static() && is_constant(), "illegal call to constant_value()");
 142  142      return _constant_value;
 143  143    }
 144  144  
      145 +  // Get the constant value of non-static final field in the given
      146 +  // object.
      147 +  ciConstant constant_value_of(ciObject* object) {
      148 +    assert(!is_static() && is_constant(), "only if field is non-static constant");
      149 +    assert(object->is_instance(), "must be instance");
      150 +    return object->as_instance()->field_value(this);
      151 +  }
      152 +
 145  153    // Check for link time errors.  Accessing a field from a
 146  154    // certain class via a certain bytecode may or may not be legal.
 147  155    // This call checks to see if an exception may be raised by
 148  156    // an access of this field.
 149  157    //
 150  158    // Usage note: if the same field is accessed multiple times
 151  159    // in the same compilation, will_link will need to be checked
 152  160    // at each point of access.
 153  161    bool will_link(ciInstanceKlass* accessing_klass,
 154  162                   Bytecodes::Code bc);
↓ open down ↓ 14 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX