diff src/share/vm/opto/library_call.cpp @ 12190:edb5ab0f3fe5

8001107: @Stable annotation for constant folding of lazily evaluated variables Reviewed-by: rbackman, twisti, kvn Contributed-by: john.r.rose@oracle.com, vladimir.x.ivanov@oracle.com
author vlivanov
date Tue, 10 Sep 2013 14:51:48 -0700
parents 29aa8936f03c
children 884ed7a10f09 b2e698d2276c
line wrap: on
line diff
--- a/src/share/vm/opto/library_call.cpp	Mon Sep 09 19:53:28 2013 +0200
+++ b/src/share/vm/opto/library_call.cpp	Tue Sep 10 14:51:48 2013 -0700
@@ -1280,6 +1280,11 @@
   const TypeAry* target_array_type = TypeAry::make(TypeInt::CHAR, TypeInt::make(0, target_length, Type::WidenMin));
   const TypeAryPtr* target_type = TypeAryPtr::make(TypePtr::BotPTR, target_array_type, target_array->klass(), true, Type::OffsetBot);
 
+  // String.value field is known to be @Stable.
+  if (UseImplicitStableValues) {
+    target = cast_array_to_stable(target, target_type);
+  }
+
   IdealKit kit(this, false, true);
 #define __ kit.
   Node* zero             = __ ConI(0);