< prev index next >

src/share/vm/c1/c1_GraphBuilder.cpp

Print this page

        

@@ -1576,10 +1576,14 @@
           constant = new Constant(as_ValueType(field_val));
         }
         // Stable static fields are checked for non-default values in ciField::initialize_from().
       }
       if (constant != NULL) {
+        // Don't bother with static fields yet.
+//        if (!field->is_stable()) {
+//          dependency_recorder()->assert_constant_field_value_klass(field, field->holder());
+//        }
         push(type, append(constant));
       } else {
         if (state_before == NULL) {
           state_before = copy_state_for_exception();
         }

@@ -1619,10 +1623,13 @@
             }
             if (FoldStableValues && field->is_stable() && field_val.is_null_or_zero()) {
               // Stable field with default value can't be constant.
               constant = NULL;
             }
+            if (TrustFinalNonStaticFields && !field->is_stable()) {
+              dependency_recorder()->assert_constant_field_value_instance(field, const_oop);
+            }
           } else {
             // For CallSite objects treat the target field as a compile time constant.
             if (const_oop->is_call_site()) {
               ciCallSite* call_site = const_oop->as_call_site();
               if (field->is_call_site_target()) {
< prev index next >