Mercurial > hg > graal-jvmci-8
comparison src/cpu/x86/vm/templateInterpreter_x86_32.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 | 0094485b46c7 |
children | aeaca88565e6 |
comparison
equal
deleted
inserted
replaced
8872:53028d751155 | 8873:e961c11b85fe |
---|---|
1078 __ movl(Address(thread, JavaThread::thread_state_offset()), _thread_in_native); | 1078 __ movl(Address(thread, JavaThread::thread_state_offset()), _thread_in_native); |
1079 __ call(rax); | 1079 __ call(rax); |
1080 | 1080 |
1081 // result potentially in rdx:rax or ST0 | 1081 // result potentially in rdx:rax or ST0 |
1082 | 1082 |
1083 // Either restore the MXCSR register after returning from the JNI Call | 1083 // Verify or restore cpu control state after JNI call |
1084 // or verify that it wasn't changed. | 1084 __ restore_cpu_control_state_after_jni(); |
1085 if (VM_Version::supports_sse()) { | |
1086 if (RestoreMXCSROnJNICalls) { | |
1087 __ ldmxcsr(ExternalAddress(StubRoutines::addr_mxcsr_std())); | |
1088 } | |
1089 else if (CheckJNICalls ) { | |
1090 __ call(RuntimeAddress(StubRoutines::x86::verify_mxcsr_entry())); | |
1091 } | |
1092 } | |
1093 | |
1094 // Either restore the x87 floating pointer control word after returning | |
1095 // from the JNI call or verify that it wasn't changed. | |
1096 if (CheckJNICalls) { | |
1097 __ call(RuntimeAddress(StubRoutines::x86::verify_fpu_cntrl_wrd_entry())); | |
1098 } | |
1099 | 1085 |
1100 // save potential result in ST(0) & rdx:rax | 1086 // save potential result in ST(0) & rdx:rax |
1101 // (if result handler is the T_FLOAT or T_DOUBLE handler, result must be in ST0 - | 1087 // (if result handler is the T_FLOAT or T_DOUBLE handler, result must be in ST0 - |
1102 // the check is necessary to avoid potential Intel FPU overflow problems by saving/restoring 'empty' FPU registers) | 1088 // the check is necessary to avoid potential Intel FPU overflow problems by saving/restoring 'empty' FPU registers) |
1103 // It is safe to do this push because state is _thread_in_native and return address will be found | 1089 // It is safe to do this push because state is _thread_in_native and return address will be found |