mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 10:04:42 +02:00
6934966: JSR 292 add C1 logic for saved SP over MethodHandle calls
The logic for x86 C1 to save the SP over MH calls is pretty straight forward but SPARC handles that differently. Reviewed-by: never, jrose
This commit is contained in:
parent
e8191b6730
commit
ebc298d208
7 changed files with 20 additions and 12 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 1999-2006 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* Copyright 1999-2010 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -143,3 +143,6 @@
|
|||
|
||||
static bool is_caller_save_register (LIR_Opr reg);
|
||||
static bool is_caller_save_register (Register r);
|
||||
|
||||
// JSR 292
|
||||
static LIR_Opr& method_handle_invoke_SP_save_opr() { return L7_opr; }
|
||||
|
|
|
@ -712,12 +712,12 @@ void LIR_Assembler::vtable_call(LIR_OpJavaCall* op) {
|
|||
}
|
||||
|
||||
|
||||
void LIR_Assembler::preserve_SP() {
|
||||
void LIR_Assembler::preserve_SP(LIR_OpJavaCall* op) {
|
||||
Unimplemented();
|
||||
}
|
||||
|
||||
|
||||
void LIR_Assembler::restore_SP() {
|
||||
void LIR_Assembler::restore_SP(LIR_OpJavaCall* op) {
|
||||
Unimplemented();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* Copyright 1999-2010 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -126,3 +126,6 @@
|
|||
assert(i >= 0 && i < nof_caller_save_xmm_regs, "out of bounds");
|
||||
return _caller_save_xmm_regs[i];
|
||||
}
|
||||
|
||||
// JSR 292
|
||||
static LIR_Opr& method_handle_invoke_SP_save_opr() { return rbp_opr; }
|
||||
|
|
|
@ -2762,13 +2762,13 @@ void LIR_Assembler::vtable_call(LIR_OpJavaCall* op) {
|
|||
}
|
||||
|
||||
|
||||
void LIR_Assembler::preserve_SP() {
|
||||
__ movptr(rbp, rsp);
|
||||
void LIR_Assembler::preserve_SP(LIR_OpJavaCall* op) {
|
||||
__ movptr(FrameMap::method_handle_invoke_SP_save_opr()->as_register(), rsp);
|
||||
}
|
||||
|
||||
|
||||
void LIR_Assembler::restore_SP() {
|
||||
__ movptr(rsp, rbp);
|
||||
void LIR_Assembler::restore_SP(LIR_OpJavaCall* op) {
|
||||
__ movptr(rsp, FrameMap::method_handle_invoke_SP_save_opr()->as_register());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -705,6 +705,7 @@ void LIR_OpVisitState::visit(LIR_Op* op) {
|
|||
}
|
||||
|
||||
if (opJavaCall->_info) do_info(opJavaCall->_info);
|
||||
if (opJavaCall->is_method_handle_invoke()) do_temp(FrameMap::method_handle_invoke_SP_save_opr());
|
||||
do_call();
|
||||
if (opJavaCall->_result->is_valid()) do_output(opJavaCall->_result);
|
||||
|
||||
|
|
|
@ -416,7 +416,7 @@ void LIR_Assembler::emit_call(LIR_OpJavaCall* op) {
|
|||
// JSR 292
|
||||
// Preserve the SP over MethodHandle call sites.
|
||||
if (op->is_method_handle_invoke()) {
|
||||
preserve_SP();
|
||||
preserve_SP(op);
|
||||
}
|
||||
|
||||
if (os::is_MP()) {
|
||||
|
@ -445,7 +445,7 @@ void LIR_Assembler::emit_call(LIR_OpJavaCall* op) {
|
|||
}
|
||||
|
||||
if (op->is_method_handle_invoke()) {
|
||||
restore_SP();
|
||||
restore_SP(op);
|
||||
}
|
||||
|
||||
#if defined(X86) && defined(TIERED)
|
||||
|
|
|
@ -209,8 +209,9 @@ class LIR_Assembler: public CompilationResourceObj {
|
|||
void ic_call( LIR_OpJavaCall* op);
|
||||
void vtable_call( LIR_OpJavaCall* op);
|
||||
|
||||
void preserve_SP();
|
||||
void restore_SP();
|
||||
// JSR 292
|
||||
void preserve_SP(LIR_OpJavaCall* op);
|
||||
void restore_SP( LIR_OpJavaCall* op);
|
||||
|
||||
void osr_entry();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue