1.1 --- a/src/share/vm/c1/c1_GraphBuilder.cpp Wed Jul 02 22:54:18 2014 +0200 1.2 +++ b/src/share/vm/c1/c1_GraphBuilder.cpp Thu Jul 10 12:04:43 2014 -0700 1.3 @@ -1569,6 +1569,7 @@ 1.4 default: 1.5 constant = new Constant(as_ValueType(field_val)); 1.6 } 1.7 + // Stable static fields are checked for non-default values in ciField::initialize_from(). 1.8 } 1.9 if (constant != NULL) { 1.10 push(type, append(constant)); 1.11 @@ -1610,6 +1611,10 @@ 1.12 default: 1.13 constant = new Constant(as_ValueType(field_val)); 1.14 } 1.15 + if (FoldStableValues && field->is_stable() && field_val.is_null_or_zero()) { 1.16 + // Stable field with default value can't be constant. 1.17 + constant = NULL; 1.18 + } 1.19 } else { 1.20 // For CallSite objects treat the target field as a compile time constant. 1.21 if (const_oop->is_call_site()) {