RFR (XS): 8003268: SharedRuntime::generate_native_wrapper doesn't save all registers across runtime tracing calls for JNI critical native methods

Christian Thalinger christian.thalinger at oracle.com
Mon Jun 10 18:12:42 PDT 2013


On Jun 10, 2013, at 5:38 PM, Vladimir Kozlov <vladimir.kozlov at oracle.com> wrote:

> Looks good. I thought sparc is also affected but we save full frame there.

Right.  The other platforms look good (although I'm not 100% sure about PPC).  I have to ask someone to look into this.

-- Chris

> 
> Vladimir
> 
> On 6/10/13 4:28 PM, Christian Thalinger wrote:
>> http://cr.openjdk.java.net/~twisti/8003268
>> 
>> 8003268: SharedRuntime::generate_native_wrapper doesn't save all registers across runtime tracing calls for JNI critical native methods
>> Reviewed-by:
>> 
>> SharedRuntime::generate_native_wrapper calculates c_arg as:
>> 
>>   int c_arg = total_c_args - total_in_args;
>> 
>> which is then used for save_args/restore_args to save all already loaded arguments when calling out to the runtime. For JNI critical methods we add one additional argument to total_c_args for each array passed which means that c_arg is not zero and we skip the first argument(s) when saving them across runtime calls.
>> 
>> There are two runtime calls in a native wrapper: SharedRuntime::dtrace_method_entry and SharedRuntime::rc_trace_method_entry
>> 
>> The former is guarded by a SkipIfEqual and normally not executed. The latter is guarded by TraceRedefineClasses which is the reason why we crash. Using dtrace should also crash but I never tried.
>> 
>> src/cpu/x86/vm/sharedRuntime_x86_64.cpp
>> 



More information about the hotspot-compiler-dev mailing list