--- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp Mon Jul 14 03:24:35 2014 -0700
+++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp Mon Jul 14 03:25:40 2014 -0700
@@ -1573,6 +1573,7 @@
default:
constant = new Constant(as_ValueType(field_val));
}
+ // Stable static fields are checked for non-default values in ciField::initialize_from().
}
if (constant != NULL) {
push(type, append(constant));
@@ -1614,6 +1615,10 @@
default:
constant = new Constant(as_ValueType(field_val));
}
+ if (FoldStableValues && field->is_stable() && field_val.is_null_or_zero()) {
+ // Stable field with default value can't be constant.
+ constant = NULL;
+ }
} else {
// For CallSite objects treat the target field as a compile time constant.
if (const_oop->is_call_site()) {