diff src/share/vm/ci/ciField.hpp @ 1339:09ac706c2623

Merge
author asaha
date Wed, 24 Mar 2010 17:16:33 -0700
parents dd57230ba8fe
children a8f9f091c219 c18cbe5936b8
line wrap: on
line diff
--- a/src/share/vm/ci/ciField.hpp	Mon Mar 15 15:51:36 2010 -0400
+++ b/src/share/vm/ci/ciField.hpp	Wed Mar 24 17:16:33 2010 -0700
@@ -138,10 +138,18 @@
 
   // Get the constant value of this field.
   ciConstant constant_value() {
-    assert(is_constant(), "illegal call to constant_value()");
+    assert(is_static() && is_constant(), "illegal call to constant_value()");
     return _constant_value;
   }
 
+  // Get the constant value of non-static final field in the given
+  // object.
+  ciConstant constant_value_of(ciObject* object) {
+    assert(!is_static() && is_constant(), "only if field is non-static constant");
+    assert(object->is_instance(), "must be instance");
+    return object->as_instance()->field_value(this);
+  }
+
   // Check for link time errors.  Accessing a field from a
   // certain class via a certain bytecode may or may not be legal.
   // This call checks to see if an exception may be raised by