8234403: C2: Enable CallSite.target updates in constructors
Reviewed-by: psandoz, kvn
--- 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");