comparison src/cpu/x86/vm/templateInterpreter_x86_64.cpp @ 14957:4062efea018b

Remove compiled method call intrinsic.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Thu, 03 Apr 2014 17:47:29 +0200
parents 2b43fcc68add
children 52b4284cb496
comparison
equal deleted inserted replaced
14953:5a87cbdd8a09 14957:4062efea018b
43 #include "runtime/synchronizer.hpp" 43 #include "runtime/synchronizer.hpp"
44 #include "runtime/timer.hpp" 44 #include "runtime/timer.hpp"
45 #include "runtime/vframeArray.hpp" 45 #include "runtime/vframeArray.hpp"
46 #include "utilities/debug.hpp" 46 #include "utilities/debug.hpp"
47 #include "utilities/macros.hpp" 47 #include "utilities/macros.hpp"
48 #ifdef GRAAL
49 #include "graal/graalJavaAccess.hpp"
50 #endif
51 48
52 #define __ _masm-> 49 #define __ _masm->
53 50
54 #ifndef CC_INTERP 51 #ifndef CC_INTERP
55 52
850 // If G1 is not enabled then attempt to go through the accessor entry point 847 // If G1 is not enabled then attempt to go through the accessor entry point
851 // Reference.get is an accessor 848 // Reference.get is an accessor
852 return generate_accessor_entry(); 849 return generate_accessor_entry();
853 } 850 }
854 851
855 #ifdef GRAAL
856
857 // Interpreter stub for calling a compiled method with 3 object arguments
858 address InterpreterGenerator::generate_execute_compiled_method_entry() {
859 address entry_point = __ pc();
860
861 // Pick up the return address
862 __ movptr(rax, Address(rsp, 0));
863
864 // Must preserve original SP for loading incoming arguments because
865 // we need to align the outgoing SP for compiled code.
866 __ movptr(r11, rsp);
867
868 // Move first object argument from interpreter calling convention to compiled
869 // code calling convention.
870 __ movq(j_rarg0, Address(r11, Interpreter::stackElementSize*4));
871
872 // Move second object argument.
873 __ movq(j_rarg1, Address(r11, Interpreter::stackElementSize*3));
874
875 // Move third object argument.
876 __ movq(j_rarg2, Address(r11, Interpreter::stackElementSize*2));
877
878 // Load the raw pointer to the HotSpotInstalledCode object.
879 __ movq(j_rarg3, Address(r11, Interpreter::stackElementSize));
880
881 // Load the nmethod pointer from the HotSpotInstalledCode object
882 __ movq(j_rarg3, Address(j_rarg3, sizeof(oopDesc)));
883
884 // Check whether the nmethod was invalidated
885 __ testq(j_rarg3, j_rarg3);
886 Label invalid_nmethod;
887 __ jcc(Assembler::zero, invalid_nmethod);
888
889 // Ensure compiled code always sees stack at proper alignment
890 __ andptr(rsp, -16);
891
892 // push the return address and misalign the stack that youngest frame always sees
893 // as far as the placement of the call instruction
894 __ push(rax);
895
896 // Perform a tail call to the verified entry point of the nmethod.
897 __ jmp(Address(j_rarg3, nmethod::verified_entry_point_offset()));
898
899 __ bind(invalid_nmethod);
900
901 // pop return address, reset last_sp to NULL
902 __ empty_expression_stack();
903 __ restore_bcp(); // rsi must be correct for exception handler (was destroyed)
904 __ restore_locals(); // make sure locals pointer is correct as well (was destroyed)
905 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_InvalidInstalledCodeException));
906 // the call_VM checks for exception, so we should never return here.
907 __ should_not_reach_here();
908
909 return entry_point;
910 }
911
912 #endif
913
914 /** 852 /**
915 * Method entry for static native methods: 853 * Method entry for static native methods:
916 * int java.util.zip.CRC32.update(int crc, int b) 854 * int java.util.zip.CRC32.update(int crc, int b)
917 */ 855 */
918 address InterpreterGenerator::generate_CRC32_update_entry() { 856 address InterpreterGenerator::generate_CRC32_update_entry() {
1700 InterpreterGenerator* ig_this = (InterpreterGenerator*)this; 1638 InterpreterGenerator* ig_this = (InterpreterGenerator*)this;
1701 1639
1702 switch (kind) { 1640 switch (kind) {
1703 case Interpreter::zerolocals : break; 1641 case Interpreter::zerolocals : break;
1704 case Interpreter::zerolocals_synchronized: synchronized = true; break; 1642 case Interpreter::zerolocals_synchronized: synchronized = true; break;
1705 #ifdef GRAAL
1706 case Interpreter::execute_compiled_method: entry_point = ig_this->generate_execute_compiled_method_entry(); break;
1707 #endif
1708 case Interpreter::native : entry_point = ig_this->generate_native_entry(false); break; 1643 case Interpreter::native : entry_point = ig_this->generate_native_entry(false); break;
1709 case Interpreter::native_synchronized : entry_point = ig_this->generate_native_entry(true); break; 1644 case Interpreter::native_synchronized : entry_point = ig_this->generate_native_entry(true); break;
1710 case Interpreter::empty : entry_point = ig_this->generate_empty_entry(); break; 1645 case Interpreter::empty : entry_point = ig_this->generate_empty_entry(); break;
1711 case Interpreter::accessor : entry_point = ig_this->generate_accessor_entry(); break; 1646 case Interpreter::accessor : entry_point = ig_this->generate_accessor_entry(); break;
1712 case Interpreter::abstract : entry_point = ig_this->generate_abstract_entry(); break; 1647 case Interpreter::abstract : entry_point = ig_this->generate_abstract_entry(); break;