comparison src/cpu/x86/vm/templateInterpreter_x86_64.cpp @ 10475:3489047ffea2

Restructure the handling of HotSpotInstalledCode and their link to nmethods.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Fri, 21 Jun 2013 18:26:52 +0200
parents 836a62f43af9
children 40b8c383bc31
comparison
equal deleted inserted replaced
10474:55827d611da7 10475:3489047ffea2
44 #include "runtime/synchronizer.hpp" 44 #include "runtime/synchronizer.hpp"
45 #include "runtime/timer.hpp" 45 #include "runtime/timer.hpp"
46 #include "runtime/vframeArray.hpp" 46 #include "runtime/vframeArray.hpp"
47 #include "utilities/debug.hpp" 47 #include "utilities/debug.hpp"
48 #include "utilities/macros.hpp" 48 #include "utilities/macros.hpp"
49 #ifdef GRAAL
50 #include "graal/graalJavaAccess.hpp"
51 #endif
49 52
50 #define __ _masm-> 53 #define __ _masm->
51 54
52 #ifndef CC_INTERP 55 #ifndef CC_INTERP
53 56
906 // as far as the placement of the call instruction 909 // as far as the placement of the call instruction
907 __ push(rax); 910 __ push(rax);
908 911
909 // Move first object argument from interpreter calling convention to compiled 912 // Move first object argument from interpreter calling convention to compiled
910 // code calling convention. 913 // code calling convention.
911 __ movq(j_rarg0, Address(r11, Interpreter::stackElementSize*5)); 914 __ movq(j_rarg0, Address(r11, Interpreter::stackElementSize*4));
912 915
913 // Move second object argument. 916 // Move second object argument.
914 __ movq(j_rarg1, Address(r11, Interpreter::stackElementSize*4)); 917 __ movq(j_rarg1, Address(r11, Interpreter::stackElementSize*3));
915 918
916 // Move third object argument. 919 // Move third object argument.
917 __ movq(j_rarg2, Address(r11, Interpreter::stackElementSize*3)); 920 __ movq(j_rarg2, Address(r11, Interpreter::stackElementSize*2));
918 921
919 // Load the raw pointer to the nmethod. 922 // Load the raw pointer to the HotSpotInstalledCode object.
920 __ movq(j_rarg3, Address(r11, Interpreter::stackElementSize)); 923 __ movq(j_rarg3, Address(r11, Interpreter::stackElementSize));
924
925 // Load the nmethod pointer from the HotSpotInstalledCode object
926 __ movq(j_rarg3, Address(j_rarg3, sizeof(oopDesc)));
927
928 // Check whether the nmethod was invalidated
929 __ testq(j_rarg3, j_rarg3);
930 Label invalid_nmethod;
931 __ jcc(Assembler::zero, invalid_nmethod);
921 932
922 // Perform a tail call to the verified entry point of the nmethod. 933 // Perform a tail call to the verified entry point of the nmethod.
923 __ jmp(Address(j_rarg3, nmethod::verified_entry_point_offset())); 934 __ jmp(Address(j_rarg3, nmethod::verified_entry_point_offset()));
935
936 __ bind(invalid_nmethod);
937 __ xorq(rax, rax);
938 __ ret(0);
924 939
925 return entry_point; 940 return entry_point;
926 } 941 }
927 942
928 #endif 943 #endif