Mercurial > hg > graal-compiler
comparison src/cpu/x86/vm/templateInterpreter_x86_64.cpp @ 7482:989155e2d07a
Merge with hs25-b15.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Wed, 16 Jan 2013 01:34:24 +0100 |
parents | 291ffc492eb6 fd74228fd5ca |
children | 5fc51c1ecdeb |
comparison
equal
deleted
inserted
replaced
7381:6761a8f854a4 | 7482:989155e2d07a |
---|---|
398 | 398 |
399 // On return (i.e. jump to entry_point) [ back to invocation of interpreter ] | 399 // On return (i.e. jump to entry_point) [ back to invocation of interpreter ] |
400 // Everything as it was on entry | 400 // Everything as it was on entry |
401 // rdx is not restored. Doesn't appear to really be set. | 401 // rdx is not restored. Doesn't appear to really be set. |
402 | 402 |
403 const Address size_of_parameters(rbx, | |
404 Method::size_of_parameters_offset()); | |
405 | |
406 // InterpreterRuntime::frequency_counter_overflow takes two | 403 // InterpreterRuntime::frequency_counter_overflow takes two |
407 // arguments, the first (thread) is passed by call_VM, the second | 404 // arguments, the first (thread) is passed by call_VM, the second |
408 // indicates if the counter overflow occurs at a backwards branch | 405 // indicates if the counter overflow occurs at a backwards branch |
409 // (NULL bcp). We pass zero for it. The call returns the address | 406 // (NULL bcp). We pass zero for it. The call returns the address |
410 // of the verified entry point for the method or NULL if the | 407 // of the verified entry point for the method or NULL if the |
873 // rbx: Method* | 870 // rbx: Method* |
874 // r13: sender sp | 871 // r13: sender sp |
875 | 872 |
876 address entry_point = __ pc(); | 873 address entry_point = __ pc(); |
877 | 874 |
878 const Address size_of_parameters(rbx, Method:: | 875 const Address constMethod (rbx, Method::const_offset()); |
879 size_of_parameters_offset()); | |
880 const Address invocation_counter(rbx, Method:: | 876 const Address invocation_counter(rbx, Method:: |
881 invocation_counter_offset() + | 877 invocation_counter_offset() + |
882 InvocationCounter::counter_offset()); | 878 InvocationCounter::counter_offset()); |
883 const Address access_flags (rbx, Method::access_flags_offset()); | 879 const Address access_flags (rbx, Method::access_flags_offset()); |
880 const Address size_of_parameters(rcx, ConstMethod:: | |
881 size_of_parameters_offset()); | |
882 | |
884 | 883 |
885 // get parameter size (always needed) | 884 // get parameter size (always needed) |
885 __ movptr(rcx, constMethod); | |
886 __ load_unsigned_short(rcx, size_of_parameters); | 886 __ load_unsigned_short(rcx, size_of_parameters); |
887 | 887 |
888 // native calls don't need the stack size check since they have no | 888 // native calls don't need the stack size check since they have no |
889 // expression stack and the arguments are already on the stack and | 889 // expression stack and the arguments are already on the stack and |
890 // we only add a handful of words to the stack | 890 // we only add a handful of words to the stack |
996 const Register method = rbx; | 996 const Register method = rbx; |
997 const Register t = r11; | 997 const Register t = r11; |
998 | 998 |
999 // allocate space for parameters | 999 // allocate space for parameters |
1000 __ get_method(method); | 1000 __ get_method(method); |
1001 __ load_unsigned_short(t, | 1001 __ movptr(t, Address(method, Method::const_offset())); |
1002 Address(method, | 1002 __ load_unsigned_short(t, Address(t, ConstMethod::size_of_parameters_offset())); |
1003 Method::size_of_parameters_offset())); | |
1004 __ shll(t, Interpreter::logStackElementSize); | 1003 __ shll(t, Interpreter::logStackElementSize); |
1005 | 1004 |
1006 __ subptr(rsp, t); | 1005 __ subptr(rsp, t); |
1007 __ subptr(rsp, frame::arg_reg_save_area_bytes); // windows | 1006 __ subptr(rsp, frame::arg_reg_save_area_bytes); // windows |
1008 __ andptr(rsp, -16); // must be 16 byte boundary (see amd64 ABI) | 1007 __ andptr(rsp, -16); // must be 16 byte boundary (see amd64 ABI) |
1331 | 1330 |
1332 // ebx: Method* | 1331 // ebx: Method* |
1333 // r13: sender sp | 1332 // r13: sender sp |
1334 address entry_point = __ pc(); | 1333 address entry_point = __ pc(); |
1335 | 1334 |
1336 const Address size_of_parameters(rbx, | 1335 const Address constMethod(rbx, Method::const_offset()); |
1337 Method::size_of_parameters_offset()); | |
1338 const Address size_of_locals(rbx, Method::size_of_locals_offset()); | |
1339 const Address invocation_counter(rbx, | 1336 const Address invocation_counter(rbx, |
1340 Method::invocation_counter_offset() + | 1337 Method::invocation_counter_offset() + |
1341 InvocationCounter::counter_offset()); | 1338 InvocationCounter::counter_offset()); |
1342 const Address access_flags(rbx, Method::access_flags_offset()); | 1339 const Address access_flags(rbx, Method::access_flags_offset()); |
1340 const Address size_of_parameters(rdx, | |
1341 ConstMethod::size_of_parameters_offset()); | |
1342 const Address size_of_locals(rdx, ConstMethod::size_of_locals_offset()); | |
1343 | |
1343 | 1344 |
1344 // get parameter size (always needed) | 1345 // get parameter size (always needed) |
1346 __ movptr(rdx, constMethod); | |
1345 __ load_unsigned_short(rcx, size_of_parameters); | 1347 __ load_unsigned_short(rcx, size_of_parameters); |
1346 | 1348 |
1347 // rbx: Method* | 1349 // rbx: Method* |
1348 // rcx: size of parameters | 1350 // rcx: size of parameters |
1349 // r13: sender_sp (could differ from sp+wordSize if we were called via c2i ) | 1351 // r13: sender_sp (could differ from sp+wordSize if we were called via c2i ) |
1781 __ jcc(Assembler::notZero, caller_not_deoptimized); | 1783 __ jcc(Assembler::notZero, caller_not_deoptimized); |
1782 | 1784 |
1783 // Compute size of arguments for saving when returning to | 1785 // Compute size of arguments for saving when returning to |
1784 // deoptimized caller | 1786 // deoptimized caller |
1785 __ get_method(rax); | 1787 __ get_method(rax); |
1786 __ load_unsigned_short(rax, Address(rax, in_bytes(Method:: | 1788 __ movptr(rax, Address(rax, Method::const_offset())); |
1789 __ load_unsigned_short(rax, Address(rax, in_bytes(ConstMethod:: | |
1787 size_of_parameters_offset()))); | 1790 size_of_parameters_offset()))); |
1788 __ shll(rax, Interpreter::logStackElementSize); | 1791 __ shll(rax, Interpreter::logStackElementSize); |
1789 __ restore_locals(); // XXX do we need this? | 1792 __ restore_locals(); // XXX do we need this? |
1790 __ subptr(r14, rax); | 1793 __ subptr(r14, rax); |
1791 __ addptr(r14, wordSize); | 1794 __ addptr(r14, wordSize); |