8234403: C2: Enable CallSite.target updates in constructors
authorvlivanov
Tue, 26 Nov 2019 16:09:21 +0300
changeset 59276 94a84abb873b
parent 59275 a6e25566cb56
child 59277 31272cef28e2
8234403: C2: Enable CallSite.target updates in constructors Reviewed-by: psandoz, kvn
src/hotspot/share/opto/parse3.cpp
--- a/src/hotspot/share/opto/parse3.cpp	Tue Nov 26 16:09:17 2019 +0300
+++ b/src/hotspot/share/opto/parse3.cpp	Tue Nov 26 16:09:21 2019 +0300
@@ -55,8 +55,9 @@
     return;
   }
 
-  // Deoptimize on putfield writes to call site target field.
-  if (!is_get && field->is_call_site_target()) {
+  // Deoptimize on putfield writes to call site target field outside of CallSite ctor.
+  if (!is_get && field->is_call_site_target() &&
+      !(method()->holder() == field_holder && method()->is_object_initializer())) {
     uncommon_trap(Deoptimization::Reason_unhandled,
                   Deoptimization::Action_reinterpret,
                   NULL, "put to call site target field");