Mercurial > hg > graal-jvmci-8
comparison src/cpu/x86/vm/templateTable_x86_64.cpp @ 1976:0fc262af204f
6780143: hs203t003 hits SIGSEGV/EXCEPTION_ACCESS_VIOLATION with -XX:+UseCompressedOops
Summary: Using r12 as temporary register around call_VM trashes heapbase becausecall_VM doesn't always return immediately to following code (eg forward_exception, popframe and early return support).
Reviewed-by: never, kvn
author | coleenp |
---|---|
date | Mon, 29 Nov 2010 15:43:36 -0500 |
parents | f95d63e2154a |
children | b1a2afa37ec4 dd031b2226de |
comparison
equal
deleted
inserted
replaced
1972:f95d63e2154a | 1976:0fc262af204f |
---|---|
2760 __ testl(rcx, rcx); | 2760 __ testl(rcx, rcx); |
2761 __ jcc(Assembler::zero, L1); | 2761 __ jcc(Assembler::zero, L1); |
2762 // access constant pool cache entry | 2762 // access constant pool cache entry |
2763 __ get_cache_entry_pointer_at_bcp(c_rarg2, rcx, 1); | 2763 __ get_cache_entry_pointer_at_bcp(c_rarg2, rcx, 1); |
2764 __ verify_oop(rax); | 2764 __ verify_oop(rax); |
2765 __ mov(r12, rax); // save object pointer before call_VM() clobbers it | 2765 __ push_ptr(rax); // save object pointer before call_VM() clobbers it |
2766 __ mov(c_rarg1, rax); | 2766 __ mov(c_rarg1, rax); |
2767 // c_rarg1: object pointer copied above | 2767 // c_rarg1: object pointer copied above |
2768 // c_rarg2: cache entry pointer | 2768 // c_rarg2: cache entry pointer |
2769 __ call_VM(noreg, | 2769 __ call_VM(noreg, |
2770 CAST_FROM_FN_PTR(address, | 2770 CAST_FROM_FN_PTR(address, |
2771 InterpreterRuntime::post_field_access), | 2771 InterpreterRuntime::post_field_access), |
2772 c_rarg1, c_rarg2); | 2772 c_rarg1, c_rarg2); |
2773 __ mov(rax, r12); // restore object pointer | 2773 __ pop_ptr(rax); // restore object pointer |
2774 __ reinit_heapbase(); | |
2775 __ bind(L1); | 2774 __ bind(L1); |
2776 } | 2775 } |
2777 | 2776 |
2778 // access constant pool cache | 2777 // access constant pool cache |
2779 __ get_cache_and_index_at_bcp(rcx, rbx, 1); | 2778 __ get_cache_and_index_at_bcp(rcx, rbx, 1); |
3363 Address::times_1, | 3362 Address::times_1, |
3364 typeArrayOopDesc::header_size(T_BYTE) * wordSize), | 3363 typeArrayOopDesc::header_size(T_BYTE) * wordSize), |
3365 JVM_CONSTANT_Class); | 3364 JVM_CONSTANT_Class); |
3366 __ jcc(Assembler::equal, quicked); | 3365 __ jcc(Assembler::equal, quicked); |
3367 __ push(atos); // save receiver for result, and for GC | 3366 __ push(atos); // save receiver for result, and for GC |
3368 __ mov(r12, rcx); // save rcx XXX | |
3369 call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc)); | 3367 call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc)); |
3370 __ movq(rcx, r12); // restore rcx XXX | |
3371 __ reinit_heapbase(); | |
3372 __ pop_ptr(rdx); // restore receiver | 3368 __ pop_ptr(rdx); // restore receiver |
3373 __ jmpb(resolved); | 3369 __ jmpb(resolved); |
3374 | 3370 |
3375 // Get superklass in rax and subklass in rbx | 3371 // Get superklass in rax and subklass in rbx |
3376 __ bind(quicked); | 3372 __ bind(quicked); |
3420 typeArrayOopDesc::header_size(T_BYTE) * wordSize), | 3416 typeArrayOopDesc::header_size(T_BYTE) * wordSize), |
3421 JVM_CONSTANT_Class); | 3417 JVM_CONSTANT_Class); |
3422 __ jcc(Assembler::equal, quicked); | 3418 __ jcc(Assembler::equal, quicked); |
3423 | 3419 |
3424 __ push(atos); // save receiver for result, and for GC | 3420 __ push(atos); // save receiver for result, and for GC |
3425 __ mov(r12, rcx); // save rcx | |
3426 call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc)); | 3421 call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::quicken_io_cc)); |
3427 __ movq(rcx, r12); // restore rcx | |
3428 __ reinit_heapbase(); | |
3429 __ pop_ptr(rdx); // restore receiver | 3422 __ pop_ptr(rdx); // restore receiver |
3423 __ verify_oop(rdx); | |
3430 __ load_klass(rdx, rdx); | 3424 __ load_klass(rdx, rdx); |
3431 __ jmpb(resolved); | 3425 __ jmpb(resolved); |
3432 | 3426 |
3433 // Get superklass in rax and subklass in rdx | 3427 // Get superklass in rax and subklass in rdx |
3434 __ bind(quicked); | 3428 __ bind(quicked); |