hotspot/src/share/vm/opto/parse3.cpp
changeset 10511 22b3580bd8bb
parent 10510 ab626d1bdf53
child 13895 f6dfe4123709
--- a/hotspot/src/share/vm/opto/parse3.cpp	Fri Sep 02 00:36:18 2011 -0700
+++ b/hotspot/src/share/vm/opto/parse3.cpp	Fri Sep 02 04:28:59 2011 -0700
@@ -147,19 +147,21 @@
 void Parse::do_get_xxx(Node* obj, ciField* field, bool is_field) {
   // Does this field have a constant value?  If so, just push the value.
   if (field->is_constant()) {
+    // final field
     if (field->is_static()) {
       // final static field
       if (push_constant(field->constant_value()))
         return;
     }
     else {
-      // final non-static field of a trusted class (classes in
-      // java.lang.invoke and sun.invoke packages and subpackages).
+      // final non-static field
+      // Treat final non-static fields of trusted classes (classes in
+      // java.lang.invoke and sun.invoke packages and subpackages) as
+      // compile time constants.
       if (obj->is_Con()) {
         const TypeOopPtr* oop_ptr = obj->bottom_type()->isa_oopptr();
         ciObject* constant_oop = oop_ptr->const_oop();
         ciConstant constant = field->constant_value_of(constant_oop);
-
         if (push_constant(constant, true))
           return;
       }