Mercurial > hg > truffle
comparison src/cpu/x86/vm/templateInterpreter_x86_64.cpp @ 9046:c6a1ffc707ff
Comments and #ifdef GRAAL for recent changes to C++ code for calling nmethods directly.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Fri, 12 Apr 2013 17:22:54 +0200 |
parents | ff5a32117e02 |
children | 836a62f43af9 |
comparison
equal
deleted
inserted
replaced
9030:9a3e25e270a0 | 9046:c6a1ffc707ff |
---|---|
871 // If G1 is not enabled then attempt to go through the accessor entry point | 871 // If G1 is not enabled then attempt to go through the accessor entry point |
872 // Reference.get is an accessor | 872 // Reference.get is an accessor |
873 return generate_accessor_entry(); | 873 return generate_accessor_entry(); |
874 } | 874 } |
875 | 875 |
876 #ifdef GRAAL | |
877 | |
876 // Interpreter stub for calling a compiled method with 3 object arguments | 878 // Interpreter stub for calling a compiled method with 3 object arguments |
877 address InterpreterGenerator::generate_execute_compiled_method_entry() { | 879 address InterpreterGenerator::generate_execute_compiled_method_entry() { |
878 address entry_point = __ pc(); | 880 address entry_point = __ pc(); |
879 | 881 |
880 // Pick up the return address | 882 // Pick up the return address |
889 | 891 |
890 // push the return address and misalign the stack that youngest frame always sees | 892 // push the return address and misalign the stack that youngest frame always sees |
891 // as far as the placement of the call instruction | 893 // as far as the placement of the call instruction |
892 __ push(rax); | 894 __ push(rax); |
893 | 895 |
896 // Move first object argument from interpreter calling convention to compiled | |
897 // code calling convention. | |
894 __ movq(j_rarg0, Address(r11, Interpreter::stackElementSize*5)); | 898 __ movq(j_rarg0, Address(r11, Interpreter::stackElementSize*5)); |
899 | |
900 // Move second object argument. | |
895 __ movq(j_rarg1, Address(r11, Interpreter::stackElementSize*4)); | 901 __ movq(j_rarg1, Address(r11, Interpreter::stackElementSize*4)); |
902 | |
903 // Move third object argument. | |
896 __ movq(j_rarg2, Address(r11, Interpreter::stackElementSize*3)); | 904 __ movq(j_rarg2, Address(r11, Interpreter::stackElementSize*3)); |
905 | |
906 // Load the raw pointer to the nmethod. | |
897 __ movq(j_rarg3, Address(r11, Interpreter::stackElementSize)); | 907 __ movq(j_rarg3, Address(r11, Interpreter::stackElementSize)); |
908 | |
909 // Perform a tail call to the verified entry point of the nmethod. | |
898 __ jmp(Address(j_rarg3, nmethod::verified_entry_point_offset())); | 910 __ jmp(Address(j_rarg3, nmethod::verified_entry_point_offset())); |
911 | |
899 return entry_point; | 912 return entry_point; |
900 } | 913 } |
914 | |
915 #endif | |
901 | 916 |
902 // Interpreter stub for calling a native method. (asm interpreter) | 917 // Interpreter stub for calling a native method. (asm interpreter) |
903 // This sets up a somewhat different looking stack for calling the | 918 // This sets up a somewhat different looking stack for calling the |
904 // native method than the typical interpreter frame setup. | 919 // native method than the typical interpreter frame setup. |
905 address InterpreterGenerator::generate_native_entry(bool synchronized) { | 920 address InterpreterGenerator::generate_native_entry(bool synchronized) { |
1584 address entry_point = NULL; | 1599 address entry_point = NULL; |
1585 | 1600 |
1586 switch (kind) { | 1601 switch (kind) { |
1587 case Interpreter::zerolocals : break; | 1602 case Interpreter::zerolocals : break; |
1588 case Interpreter::zerolocals_synchronized: synchronized = true; break; | 1603 case Interpreter::zerolocals_synchronized: synchronized = true; break; |
1604 #ifdef GRAAL | |
1589 case Interpreter::execute_compiled_method: entry_point = ((InterpreterGenerator*)this)->generate_execute_compiled_method_entry(); break; | 1605 case Interpreter::execute_compiled_method: entry_point = ((InterpreterGenerator*)this)->generate_execute_compiled_method_entry(); break; |
1606 #endif | |
1590 case Interpreter::native : entry_point = ((InterpreterGenerator*)this)->generate_native_entry(false); break; | 1607 case Interpreter::native : entry_point = ((InterpreterGenerator*)this)->generate_native_entry(false); break; |
1591 case Interpreter::native_synchronized : entry_point = ((InterpreterGenerator*)this)->generate_native_entry(true); break; | 1608 case Interpreter::native_synchronized : entry_point = ((InterpreterGenerator*)this)->generate_native_entry(true); break; |
1592 case Interpreter::empty : entry_point = ((InterpreterGenerator*)this)->generate_empty_entry(); break; | 1609 case Interpreter::empty : entry_point = ((InterpreterGenerator*)this)->generate_empty_entry(); break; |
1593 case Interpreter::accessor : entry_point = ((InterpreterGenerator*)this)->generate_accessor_entry(); break; | 1610 case Interpreter::accessor : entry_point = ((InterpreterGenerator*)this)->generate_accessor_entry(); break; |
1594 case Interpreter::abstract : entry_point = ((InterpreterGenerator*)this)->generate_abstract_entry(); break; | 1611 case Interpreter::abstract : entry_point = ((InterpreterGenerator*)this)->generate_abstract_entry(); break; |