Deoptimize on putfield

Krystal Mok rednaxelafx at
Wed Dec 10 23:59:35 UTC 2014

Hi everyone,

I'd like to ask a question on the handling of setting in
compiled code.
Specifically, is the following piece of code in C2's
Parse::do_field_access() [1] necessary?

  // Deoptimize on putfield writes to call site target field.
  if (!is_get && field->is_call_site_target()) {
                  NULL, "put to call site target field");

If it is necessary, then why isn't it mirrored in C1's
GraphBuilder::access_field() [2] ?

My take is that the C2 deoptimization is unnecessary here, since a
dependency is added when the compilers speculatively take a
as constant.

There's no internal Java code that would do a putfield on a
anyway, and all external requests to change the target would have gone
through CallSite.setTarget(), which is appropriately routed to the runtime

I'm okay with the "it won't hurt to leave the code there" idea. Just want
to make sure I understood things correctly.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the hotspot-compiler-dev mailing list