Mercurial > hg > truffle
comparison src/cpu/x86/vm/sharedRuntime_x86_64.cpp @ 8873:e961c11b85fe
8011102: Clear AVX registers after return from JNI call
Summary: Execute vzeroupper instruction after JNI call and on exits in jit compiled code which use 256bit vectors.
Reviewed-by: roland
author | kvn |
---|---|
date | Wed, 03 Apr 2013 11:12:57 -0700 |
parents | cd3d6a6b95d9 |
children | b9a918201d47 e7f5651d459c |
comparison
equal
deleted
inserted
replaced
8872:53028d751155 | 8873:e961c11b85fe |
---|---|
2313 // Now set thread in native | 2313 // Now set thread in native |
2314 __ movl(Address(r15_thread, JavaThread::thread_state_offset()), _thread_in_native); | 2314 __ movl(Address(r15_thread, JavaThread::thread_state_offset()), _thread_in_native); |
2315 | 2315 |
2316 __ call(RuntimeAddress(native_func)); | 2316 __ call(RuntimeAddress(native_func)); |
2317 | 2317 |
2318 // Either restore the MXCSR register after returning from the JNI Call | 2318 // Verify or restore cpu control state after JNI call |
2319 // or verify that it wasn't changed. | 2319 __ restore_cpu_control_state_after_jni(); |
2320 if (RestoreMXCSROnJNICalls) { | |
2321 __ ldmxcsr(ExternalAddress(StubRoutines::x86::mxcsr_std())); | |
2322 | |
2323 } | |
2324 else if (CheckJNICalls ) { | |
2325 __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::x86::verify_mxcsr_entry()))); | |
2326 } | |
2327 | |
2328 | 2320 |
2329 // Unpack native results. | 2321 // Unpack native results. |
2330 switch (ret_type) { | 2322 switch (ret_type) { |
2331 case T_BOOLEAN: __ c2bool(rax); break; | 2323 case T_BOOLEAN: __ c2bool(rax); break; |
2332 case T_CHAR : __ movzwl(rax, rax); break; | 2324 case T_CHAR : __ movzwl(rax, rax); break; |