mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 09:34:38 +02:00
6792301: StackAlignmentInBytes not honored for compiled native methods
Fixed the stack misalignment when generate_native_wrapper is called. Reviewed-by: never, kamg, kvn, phh
This commit is contained in:
parent
8187896320
commit
74a472983b
2 changed files with 6 additions and 2 deletions
|
@ -39,6 +39,8 @@ RuntimeStub* SharedRuntime::_resolve_opt_virtual_call_blob;
|
||||||
RuntimeStub* SharedRuntime::_resolve_virtual_call_blob;
|
RuntimeStub* SharedRuntime::_resolve_virtual_call_blob;
|
||||||
RuntimeStub* SharedRuntime::_resolve_static_call_blob;
|
RuntimeStub* SharedRuntime::_resolve_static_call_blob;
|
||||||
|
|
||||||
|
const int StackAlignmentInSlots = StackAlignmentInBytes / VMRegImpl::stack_slot_size;
|
||||||
|
|
||||||
class RegisterSaver {
|
class RegisterSaver {
|
||||||
enum { FPU_regs_live = 8 /*for the FPU stack*/+8/*eight more for XMM registers*/ };
|
enum { FPU_regs_live = 8 /*for the FPU stack*/+8/*eight more for XMM registers*/ };
|
||||||
// Capture info about frame layout
|
// Capture info about frame layout
|
||||||
|
@ -1299,7 +1301,7 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,
|
||||||
|
|
||||||
// Now compute actual number of stack words we need rounding to make
|
// Now compute actual number of stack words we need rounding to make
|
||||||
// stack properly aligned.
|
// stack properly aligned.
|
||||||
stack_slots = round_to(stack_slots, 2 * VMRegImpl::slots_per_word);
|
stack_slots = round_to(stack_slots, StackAlignmentInSlots);
|
||||||
|
|
||||||
int stack_size = stack_slots * VMRegImpl::stack_slot_size;
|
int stack_size = stack_slots * VMRegImpl::stack_slot_size;
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,8 @@ RuntimeStub* SharedRuntime::_resolve_opt_virtual_call_blob;
|
||||||
RuntimeStub* SharedRuntime::_resolve_virtual_call_blob;
|
RuntimeStub* SharedRuntime::_resolve_virtual_call_blob;
|
||||||
RuntimeStub* SharedRuntime::_resolve_static_call_blob;
|
RuntimeStub* SharedRuntime::_resolve_static_call_blob;
|
||||||
|
|
||||||
|
const int StackAlignmentInSlots = StackAlignmentInBytes / VMRegImpl::stack_slot_size;
|
||||||
|
|
||||||
#define __ masm->
|
#define __ masm->
|
||||||
|
|
||||||
class SimpleRuntimeFrame {
|
class SimpleRuntimeFrame {
|
||||||
|
@ -1286,7 +1288,7 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,
|
||||||
|
|
||||||
// Now compute actual number of stack words we need rounding to make
|
// Now compute actual number of stack words we need rounding to make
|
||||||
// stack properly aligned.
|
// stack properly aligned.
|
||||||
stack_slots = round_to(stack_slots, 4 * VMRegImpl::slots_per_word);
|
stack_slots = round_to(stack_slots, StackAlignmentInSlots);
|
||||||
|
|
||||||
int stack_size = stack_slots * VMRegImpl::stack_slot_size;
|
int stack_size = stack_slots * VMRegImpl::stack_slot_size;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue