src/share/vm/ci/ciField.hpp

changeset 1573
dd57230ba8fe
parent 631
d1605aabd0a1
child 1907
c18cbe5936b8
     1.1 --- a/src/share/vm/ci/ciField.hpp	Tue Jan 05 13:05:58 2010 +0100
     1.2 +++ b/src/share/vm/ci/ciField.hpp	Tue Jan 05 15:21:25 2010 +0100
     1.3 @@ -138,10 +138,18 @@
     1.4  
     1.5    // Get the constant value of this field.
     1.6    ciConstant constant_value() {
     1.7 -    assert(is_constant(), "illegal call to constant_value()");
     1.8 +    assert(is_static() && is_constant(), "illegal call to constant_value()");
     1.9      return _constant_value;
    1.10    }
    1.11  
    1.12 +  // Get the constant value of non-static final field in the given
    1.13 +  // object.
    1.14 +  ciConstant constant_value_of(ciObject* object) {
    1.15 +    assert(!is_static() && is_constant(), "only if field is non-static constant");
    1.16 +    assert(object->is_instance(), "must be instance");
    1.17 +    return object->as_instance()->field_value(this);
    1.18 +  }
    1.19 +
    1.20    // Check for link time errors.  Accessing a field from a
    1.21    // certain class via a certain bytecode may or may not be legal.
    1.22    // This call checks to see if an exception may be raised by

mercurial