mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 11:34:38 +02:00
6917766: JSR 292 needs its own deopt handler
We need to introduce a new MH deopt handler so we can easily determine if the deopt happened at a MH call site or not. Reviewed-by: never, jrose
This commit is contained in:
parent
07c442542c
commit
fbc43afae6
15 changed files with 255 additions and 134 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* Copyright 2000-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
|
||||
|
@ -357,7 +357,7 @@ void LIR_Assembler::monitorexit(LIR_Opr obj_opr, LIR_Opr lock_opr, Register hdr,
|
|||
}
|
||||
|
||||
|
||||
void LIR_Assembler::emit_exception_handler() {
|
||||
int LIR_Assembler::emit_exception_handler() {
|
||||
// if the last instruction is a call (typically to do a throw which
|
||||
// is coming at the end after block reordering) the return address
|
||||
// must still point into the code area in order to avoid assertion
|
||||
|
@ -373,13 +373,10 @@ void LIR_Assembler::emit_exception_handler() {
|
|||
if (handler_base == NULL) {
|
||||
// not enough space left for the handler
|
||||
bailout("exception handler overflow");
|
||||
return;
|
||||
return -1;
|
||||
}
|
||||
#ifdef ASSERT
|
||||
int offset = code_offset();
|
||||
#endif // ASSERT
|
||||
compilation()->offsets()->set_value(CodeOffsets::Exceptions, code_offset());
|
||||
|
||||
int offset = code_offset();
|
||||
|
||||
if (compilation()->has_exception_handlers() || compilation()->env()->jvmti_can_post_exceptions()) {
|
||||
__ call(Runtime1::entry_for(Runtime1::handle_exception_id), relocInfo::runtime_call_type);
|
||||
|
@ -390,11 +387,13 @@ void LIR_Assembler::emit_exception_handler() {
|
|||
__ delayed()->nop();
|
||||
debug_only(__ stop("should have gone to the caller");)
|
||||
assert(code_offset() - offset <= exception_handler_size, "overflow");
|
||||
|
||||
__ end_a_stub();
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
void LIR_Assembler::emit_deopt_handler() {
|
||||
|
||||
int LIR_Assembler::emit_deopt_handler() {
|
||||
// if the last instruction is a call (typically to do a throw which
|
||||
// is coming at the end after block reordering) the return address
|
||||
// must still point into the code area in order to avoid assertion
|
||||
|
@ -408,23 +407,18 @@ void LIR_Assembler::emit_deopt_handler() {
|
|||
if (handler_base == NULL) {
|
||||
// not enough space left for the handler
|
||||
bailout("deopt handler overflow");
|
||||
return;
|
||||
return -1;
|
||||
}
|
||||
#ifdef ASSERT
|
||||
|
||||
int offset = code_offset();
|
||||
#endif // ASSERT
|
||||
compilation()->offsets()->set_value(CodeOffsets::Deopt, code_offset());
|
||||
|
||||
AddressLiteral deopt_blob(SharedRuntime::deopt_blob()->unpack());
|
||||
|
||||
__ JUMP(deopt_blob, G3_scratch, 0); // sethi;jmp
|
||||
__ delayed()->nop();
|
||||
|
||||
assert(code_offset() - offset <= deopt_handler_size, "overflow");
|
||||
|
||||
debug_only(__ stop("should have gone to the caller");)
|
||||
|
||||
__ end_a_stub();
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue