Request for review (S): 7174928: JSR 292: unresolved invokedynamic call sites deopt and osr infinitely

Roland Westrelin roland.westrelin at oracle.com
Tue Jun 12 13:14:04 PDT 2012


> Good point.  I looked at this again and the only other code using this (and where I got this pattern from in the first place) is NewMultiArray.  And there it's used correctly:
> 
>  CodeEmitInfo* patching_info = NULL;
>  if (!x->klass()->is_loaded() || PatchALot) {
>    patching_info = state_for(x, x->state_before());
> 
>    // cannot re-use same xhandlers for multiple CodeEmitInfos, so
>    // clone all handlers.  This is handled transparently in other
>    // places by the CodeEmitInfo cloning logic but is handled
>    // specially here because a stub isn't being used.
>    x->set_exception_handlers(new XHandlers(x->exception_handlers()));
>  }
>  CodeEmitInfo* info = state_for(x, x->state());

If you look at some of the stubs constructors, you'll find this pattern:

_info = new CodeEmitInfo(info);

and the CodeEmitInfo copy constructor does:
  // deep copy of exception handlers
  if (info->_exception_handlers != NULL) {
    _exception_handlers = new XHandlers(info->_exception_handlers);
  }

which is the same as:
x->set_exception_handlers(new XHandlers(x->exception_handlers()));

So in your case with the DeoptimizeStub you don't need the explicit set_exception_handlers(), right?

Roland.


More information about the hotspot-compiler-dev mailing list