RFR 8223229 [lworld] C1 crashes when calling final virtual methods with value arguments

Tobias Hartmann tobias.hartmann at oracle.com
Fri May 3 10:28:29 UTC 2019


Hi Ioi,

On 02.05.19 18:09, Ioi Lam wrote:
> Will caller->code() may be different than callerFrame.cb() if the caller gets recompiled? 

Right, that could be.

> Anyway, the lookup is not necessary, as callerFrame._cb was already looked up when the frame was
> constructed. How about this:?
> 
>     if (callerFrame.is_compiled_frame() && !callerFrame.is_deoptimized_frame()) {
>       caller_is_c1 = callerFrame.cb()->is_compiled_by_c1();
>     }

Looks good!

> BTW, I copied the original code from here:
> 
> 
> methodHandle SharedRuntime::reresolve_call_site(JavaThread *thread, bool& is_optimized, bool&
> caller_is_c1, TRAPS) {
>   ...
>   if (caller.is_compiled_frame() && !caller.is_deoptimized_frame()) {
> 
>     address pc = caller.pc();
>     // Check for static or virtual call
>     bool is_static_call = false;
>     CompiledMethod* caller_nm = CodeCache::find_compiled(pc);
>     caller_is_c1 = caller_nm->is_compiled_by_c1();
> 
> Do you think this lookup can also be replaced with caller.cb()->as_compiled_method()? If so, I'll
> file an REF and fix in the main repo.

Yes, please do so.

>> I can implement this for C2, just file a bug when you have the C1 part ready.
> OK I will do this for C1 first and get some test cases working with C2 calling C1.

Sounds good.

Thanks,
Tobias


More information about the valhalla-dev mailing list