提交 dadc8613 编写于 作者: T twisti

6934966: JSR 292 add C1 logic for saved SP over MethodHandle calls

Summary: 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
上级 d9516d32
/* /*
* 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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -143,3 +143,6 @@ ...@@ -143,3 +143,6 @@
static bool is_caller_save_register (LIR_Opr reg); static bool is_caller_save_register (LIR_Opr reg);
static bool is_caller_save_register (Register r); 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) { ...@@ -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(); Unimplemented();
} }
void LIR_Assembler::restore_SP() { void LIR_Assembler::restore_SP(LIR_OpJavaCall* op) {
Unimplemented(); Unimplemented();
} }
......
/* /*
* 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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -126,3 +126,6 @@ ...@@ -126,3 +126,6 @@
assert(i >= 0 && i < nof_caller_save_xmm_regs, "out of bounds"); assert(i >= 0 && i < nof_caller_save_xmm_regs, "out of bounds");
return _caller_save_xmm_regs[i]; 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) { ...@@ -2762,13 +2762,13 @@ void LIR_Assembler::vtable_call(LIR_OpJavaCall* op) {
} }
void LIR_Assembler::preserve_SP() { void LIR_Assembler::preserve_SP(LIR_OpJavaCall* op) {
__ movptr(rbp, rsp); __ movptr(FrameMap::method_handle_invoke_SP_save_opr()->as_register(), rsp);
} }
void LIR_Assembler::restore_SP() { void LIR_Assembler::restore_SP(LIR_OpJavaCall* op) {
__ movptr(rsp, rbp); __ movptr(rsp, FrameMap::method_handle_invoke_SP_save_opr()->as_register());
} }
......
...@@ -705,6 +705,7 @@ void LIR_OpVisitState::visit(LIR_Op* op) { ...@@ -705,6 +705,7 @@ void LIR_OpVisitState::visit(LIR_Op* op) {
} }
if (opJavaCall->_info) do_info(opJavaCall->_info); if (opJavaCall->_info) do_info(opJavaCall->_info);
if (opJavaCall->is_method_handle_invoke()) do_temp(FrameMap::method_handle_invoke_SP_save_opr());
do_call(); do_call();
if (opJavaCall->_result->is_valid()) do_output(opJavaCall->_result); if (opJavaCall->_result->is_valid()) do_output(opJavaCall->_result);
......
...@@ -416,7 +416,7 @@ void LIR_Assembler::emit_call(LIR_OpJavaCall* op) { ...@@ -416,7 +416,7 @@ void LIR_Assembler::emit_call(LIR_OpJavaCall* op) {
// JSR 292 // JSR 292
// Preserve the SP over MethodHandle call sites. // Preserve the SP over MethodHandle call sites.
if (op->is_method_handle_invoke()) { if (op->is_method_handle_invoke()) {
preserve_SP(); preserve_SP(op);
} }
if (os::is_MP()) { if (os::is_MP()) {
...@@ -445,7 +445,7 @@ void LIR_Assembler::emit_call(LIR_OpJavaCall* op) { ...@@ -445,7 +445,7 @@ void LIR_Assembler::emit_call(LIR_OpJavaCall* op) {
} }
if (op->is_method_handle_invoke()) { if (op->is_method_handle_invoke()) {
restore_SP(); restore_SP(op);
} }
#if defined(X86) && defined(TIERED) #if defined(X86) && defined(TIERED)
......
...@@ -209,8 +209,9 @@ class LIR_Assembler: public CompilationResourceObj { ...@@ -209,8 +209,9 @@ class LIR_Assembler: public CompilationResourceObj {
void ic_call( LIR_OpJavaCall* op); void ic_call( LIR_OpJavaCall* op);
void vtable_call( LIR_OpJavaCall* op); void vtable_call( LIR_OpJavaCall* op);
void preserve_SP(); // JSR 292
void restore_SP(); void preserve_SP(LIR_OpJavaCall* op);
void restore_SP( LIR_OpJavaCall* op);
void osr_entry(); void osr_entry();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册