Mercurial > hg > truffle
comparison src/cpu/x86/vm/templateInterpreter_x86_32.cpp @ 7482:989155e2d07a
Merge with hs25-b15.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Wed, 16 Jan 2013 01:34:24 +0100 |
parents | fd74228fd5ca |
children | db9981fd3124 |
comparison
equal
deleted
inserted
replaced
7381:6761a8f854a4 | 7482:989155e2d07a |
---|---|
422 // rsp - sender_sp | 422 // rsp - sender_sp |
423 | 423 |
424 // C++ interpreter only | 424 // C++ interpreter only |
425 // rsi - previous interpreter state pointer | 425 // rsi - previous interpreter state pointer |
426 | 426 |
427 const Address size_of_parameters(rbx, Method::size_of_parameters_offset()); | |
428 | |
429 // InterpreterRuntime::frequency_counter_overflow takes one argument | 427 // InterpreterRuntime::frequency_counter_overflow takes one argument |
430 // indicating if the counter overflow occurs at a backwards branch (non-NULL bcp). | 428 // indicating if the counter overflow occurs at a backwards branch (non-NULL bcp). |
431 // The call returns the address of the verified entry point for the method or NULL | 429 // The call returns the address of the verified entry point for the method or NULL |
432 // if the compilation did not complete (either went background or bailed out). | 430 // if the compilation did not complete (either went background or bailed out). |
433 __ movptr(rax, (intptr_t)false); | 431 __ movptr(rax, (intptr_t)false); |
866 // rbx,: Method* | 864 // rbx,: Method* |
867 // rsi: sender sp | 865 // rsi: sender sp |
868 // rsi: previous interpreter state (C++ interpreter) must preserve | 866 // rsi: previous interpreter state (C++ interpreter) must preserve |
869 address entry_point = __ pc(); | 867 address entry_point = __ pc(); |
870 | 868 |
871 | 869 const Address constMethod (rbx, Method::const_offset()); |
872 const Address size_of_parameters(rbx, Method::size_of_parameters_offset()); | |
873 const Address invocation_counter(rbx, Method::invocation_counter_offset() + InvocationCounter::counter_offset()); | 870 const Address invocation_counter(rbx, Method::invocation_counter_offset() + InvocationCounter::counter_offset()); |
874 const Address access_flags (rbx, Method::access_flags_offset()); | 871 const Address access_flags (rbx, Method::access_flags_offset()); |
872 const Address size_of_parameters(rcx, ConstMethod::size_of_parameters_offset()); | |
875 | 873 |
876 // get parameter size (always needed) | 874 // get parameter size (always needed) |
875 __ movptr(rcx, constMethod); | |
877 __ load_unsigned_short(rcx, size_of_parameters); | 876 __ load_unsigned_short(rcx, size_of_parameters); |
878 | 877 |
879 // native calls don't need the stack size check since they have no expression stack | 878 // native calls don't need the stack size check since they have no expression stack |
880 // and the arguments are already on the stack and we only add a handful of words | 879 // and the arguments are already on the stack and we only add a handful of words |
881 // to the stack | 880 // to the stack |
986 const Register thread = rdi; | 985 const Register thread = rdi; |
987 const Register t = rcx; | 986 const Register t = rcx; |
988 | 987 |
989 // allocate space for parameters | 988 // allocate space for parameters |
990 __ get_method(method); | 989 __ get_method(method); |
991 __ load_unsigned_short(t, Address(method, Method::size_of_parameters_offset())); | 990 __ movptr(t, Address(method, Method::const_offset())); |
991 __ load_unsigned_short(t, Address(t, ConstMethod::size_of_parameters_offset())); | |
992 | |
992 __ shlptr(t, Interpreter::logStackElementSize); | 993 __ shlptr(t, Interpreter::logStackElementSize); |
993 __ addptr(t, 2*wordSize); // allocate two more slots for JNIEnv and possible mirror | 994 __ addptr(t, 2*wordSize); // allocate two more slots for JNIEnv and possible mirror |
994 __ subptr(rsp, t); | 995 __ subptr(rsp, t); |
995 __ andptr(rsp, -(StackAlignmentInBytes)); // gcc needs 16 byte aligned stacks to do XMM intrinsics | 996 __ andptr(rsp, -(StackAlignmentInBytes)); // gcc needs 16 byte aligned stacks to do XMM intrinsics |
996 | 997 |
1295 | 1296 |
1296 // rbx,: Method* | 1297 // rbx,: Method* |
1297 // rsi: sender sp | 1298 // rsi: sender sp |
1298 address entry_point = __ pc(); | 1299 address entry_point = __ pc(); |
1299 | 1300 |
1300 | 1301 const Address constMethod (rbx, Method::const_offset()); |
1301 const Address size_of_parameters(rbx, Method::size_of_parameters_offset()); | |
1302 const Address size_of_locals (rbx, Method::size_of_locals_offset()); | |
1303 const Address invocation_counter(rbx, Method::invocation_counter_offset() + InvocationCounter::counter_offset()); | 1302 const Address invocation_counter(rbx, Method::invocation_counter_offset() + InvocationCounter::counter_offset()); |
1304 const Address access_flags (rbx, Method::access_flags_offset()); | 1303 const Address access_flags (rbx, Method::access_flags_offset()); |
1304 const Address size_of_parameters(rdx, ConstMethod::size_of_parameters_offset()); | |
1305 const Address size_of_locals (rdx, ConstMethod::size_of_locals_offset()); | |
1305 | 1306 |
1306 // get parameter size (always needed) | 1307 // get parameter size (always needed) |
1308 __ movptr(rdx, constMethod); | |
1307 __ load_unsigned_short(rcx, size_of_parameters); | 1309 __ load_unsigned_short(rcx, size_of_parameters); |
1308 | 1310 |
1309 // rbx,: Method* | 1311 // rbx,: Method* |
1310 // rcx: size of parameters | 1312 // rcx: size of parameters |
1311 | 1313 |
1732 __ testl(rax, rax); | 1734 __ testl(rax, rax); |
1733 __ jcc(Assembler::notZero, caller_not_deoptimized); | 1735 __ jcc(Assembler::notZero, caller_not_deoptimized); |
1734 | 1736 |
1735 // Compute size of arguments for saving when returning to deoptimized caller | 1737 // Compute size of arguments for saving when returning to deoptimized caller |
1736 __ get_method(rax); | 1738 __ get_method(rax); |
1737 __ load_unsigned_short(rax, Address(rax, in_bytes(Method::size_of_parameters_offset()))); | 1739 __ movptr(rax, Address(rax, Method::const_offset())); |
1740 __ load_unsigned_short(rax, Address(rax, ConstMethod::size_of_parameters_offset())); | |
1738 __ shlptr(rax, Interpreter::logStackElementSize); | 1741 __ shlptr(rax, Interpreter::logStackElementSize); |
1739 __ restore_locals(); | 1742 __ restore_locals(); |
1740 __ subptr(rdi, rax); | 1743 __ subptr(rdi, rax); |
1741 __ addptr(rdi, wordSize); | 1744 __ addptr(rdi, wordSize); |
1742 // Save these arguments | 1745 // Save these arguments |