comparison src/cpu/x86/vm/templateInterpreter_x86_64.cpp @ 10534:ce09ad599709

Fix bug in executeCompiledMethod interpreter stub.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Tue, 25 Jun 2013 14:56:56 +0200
parents 7344fa3e8833
children 88672775a26c
comparison
equal deleted inserted replaced
10527:2b95d5b1958b 10534:ce09ad599709
902 902
903 // Must preserve original SP for loading incoming arguments because 903 // Must preserve original SP for loading incoming arguments because
904 // we need to align the outgoing SP for compiled code. 904 // we need to align the outgoing SP for compiled code.
905 __ movptr(r11, rsp); 905 __ movptr(r11, rsp);
906 906
907 // Ensure compiled code always sees stack at proper alignment
908 __ andptr(rsp, -16);
909
910 // push the return address and misalign the stack that youngest frame always sees
911 // as far as the placement of the call instruction
912 __ push(rax);
913
914 // Move first object argument from interpreter calling convention to compiled 907 // Move first object argument from interpreter calling convention to compiled
915 // code calling convention. 908 // code calling convention.
916 __ movq(j_rarg0, Address(r11, Interpreter::stackElementSize*4)); 909 __ movq(j_rarg0, Address(r11, Interpreter::stackElementSize*4));
917 910
918 // Move second object argument. 911 // Move second object argument.
930 // Check whether the nmethod was invalidated 923 // Check whether the nmethod was invalidated
931 __ testq(j_rarg3, j_rarg3); 924 __ testq(j_rarg3, j_rarg3);
932 Label invalid_nmethod; 925 Label invalid_nmethod;
933 __ jcc(Assembler::zero, invalid_nmethod); 926 __ jcc(Assembler::zero, invalid_nmethod);
934 927
928 // Ensure compiled code always sees stack at proper alignment
929 __ andptr(rsp, -16);
930
931 // push the return address and misalign the stack that youngest frame always sees
932 // as far as the placement of the call instruction
933 __ push(rax);
934
935 // Perform a tail call to the verified entry point of the nmethod. 935 // Perform a tail call to the verified entry point of the nmethod.
936 __ jmp(Address(j_rarg3, nmethod::verified_entry_point_offset())); 936 __ jmp(Address(j_rarg3, nmethod::verified_entry_point_offset()));
937 937
938 __ bind(invalid_nmethod); 938 __ bind(invalid_nmethod);
939 939
940 // pop return address, reset last_sp to NULL
941 __ empty_expression_stack();
942 __ restore_bcp(); // rsi must be correct for exception handler (was destroyed)
943 __ restore_locals(); // make sure locals pointer is correct as well (was destroyed)
940 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_InvalidInstalledCodeException)); 944 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_InvalidInstalledCodeException));
941 // the call_VM checks for exception, so we should never return here. 945 // the call_VM checks for exception, so we should never return here.
942 __ should_not_reach_here(); 946 __ should_not_reach_here();
943 947
944 return entry_point; 948 return entry_point;