changeset 12630:6349a973d248

8158546: C1 compilation fails with "Constant field loads are folded during parsing" Reviewed-by: kvn
author vlivanov
date Mon, 30 Jan 2017 16:03:25 +0300
parents ab3d4589f4d8
children 47dfa7f4098e
files src/share/vm/c1/c1_Canonicalizer.cpp
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/c1/c1_Canonicalizer.cpp	Mon Jan 30 10:30:24 2017 -0800
+++ b/src/share/vm/c1/c1_Canonicalizer.cpp	Mon Jan 30 16:03:25 2017 +0300
@@ -248,7 +248,9 @@
   } else if ((lf = x->array()->as_LoadField()) != NULL) {
     ciField* field = lf->field();
     if (field->is_static_constant()) {
-      assert(PatchALot || ScavengeRootsInCode < 2, "Constant field loads are folded during parsing");
+      // Constant field loads are usually folded during parsing.
+      // But it doesn't happen with PatchALot, ScavengeRootsInCode < 2, or when
+      // holder class is being initialized during parsing (for static fields).
       ciObject* c = field->constant_value().as_object();
       if (!c->is_null_object()) {
         set_constant(c->as_array()->length());