Mercurial > hg > graal-jvmci-8
comparison src/cpu/x86/vm/sharedRuntime_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 | 36bcc10e01c0 |
children | 40b8c383bc31 |
comparison
equal
deleted
inserted
replaced
10474:55827d611da7 | 10475:3489047ffea2 |
---|---|
37 #ifdef COMPILER1 | 37 #ifdef COMPILER1 |
38 #include "c1/c1_Runtime1.hpp" | 38 #include "c1/c1_Runtime1.hpp" |
39 #endif | 39 #endif |
40 #ifdef COMPILER2 | 40 #ifdef COMPILER2 |
41 #include "opto/runtime.hpp" | 41 #include "opto/runtime.hpp" |
42 #endif | |
43 #ifdef GRAAL | |
44 #include "graal/graalJavaAccess.hpp" | |
42 #endif | 45 #endif |
43 | 46 |
44 #define __ masm-> | 47 #define __ masm-> |
45 | 48 |
46 const int StackAlignmentInSlots = StackAlignmentInBytes / VMRegImpl::stack_slot_size; | 49 const int StackAlignmentInSlots = StackAlignmentInBytes / VMRegImpl::stack_slot_size; |
1672 | 1675 |
1673 #ifdef GRAAL | 1676 #ifdef GRAAL |
1674 if (iid == vmIntrinsics::_CompilerToVMImpl_executeCompiledMethod) { | 1677 if (iid == vmIntrinsics::_CompilerToVMImpl_executeCompiledMethod) { |
1675 // We are called from compiled code here. The three object arguments | 1678 // We are called from compiled code here. The three object arguments |
1676 // are already in the correct registers (j_rarg0, jrarg1, jrarg2). The | 1679 // are already in the correct registers (j_rarg0, jrarg1, jrarg2). The |
1677 // fourth argument (j_rarg3) is a raw pointer to the nmethod. Make a tail | 1680 // fourth argument (j_rarg3) is a pointer to the HotSpotInstalledCode object. |
1678 // call to its verified entry point. | 1681 |
1682 // Load the nmethod pointer from the HotSpotInstalledCode object | |
1683 __ movq(j_rarg3, Address(j_rarg3, sizeof(oopDesc))); | |
1684 | |
1685 // Check whether the nmethod was invalidated | |
1686 __ testq(j_rarg3, j_rarg3); | |
1687 Label invalid_nmethod; | |
1688 __ jcc(Assembler::zero, invalid_nmethod); | |
1689 | |
1690 // Perform a tail call to the verified entry point of the nmethod. | |
1679 __ jmp(Address(j_rarg3, nmethod::verified_entry_point_offset())); | 1691 __ jmp(Address(j_rarg3, nmethod::verified_entry_point_offset())); |
1692 | |
1693 __ bind(invalid_nmethod); | |
1694 __ xorq(rax, rax); | |
1695 __ ret(0); | |
1680 return; | 1696 return; |
1681 } | 1697 } |
1682 #endif | 1698 #endif |
1683 | 1699 |
1684 // Now write the args into the outgoing interpreter space | 1700 // Now write the args into the outgoing interpreter space |