Mercurial > hg > graal-compiler
diff src/share/vm/code/nmethod.hpp @ 1204:18a389214829
6921352: JSR 292 needs its own deopt handler
Summary: 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
author | twisti |
---|---|
date | Mon, 01 Feb 2010 19:29:46 +0100 |
parents | 5f24d0319e54 |
children | 9f5b60a14736 |
line wrap: on
line diff
--- a/src/share/vm/code/nmethod.hpp Fri Jan 29 22:51:41 2010 -0800 +++ b/src/share/vm/code/nmethod.hpp Mon Feb 01 19:29:46 2010 +0100 @@ -1,5 +1,5 @@ /* - * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-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 @@ -148,8 +148,12 @@ // Offsets for different nmethod parts int _exception_offset; - // All deoptee's will resume execution at this location described by this offset + // All deoptee's will resume execution at this location described by + // this offset. int _deoptimize_offset; + // All deoptee's at a MethodHandle call site will resume execution + // at this location described by this offset. + int _deoptimize_mh_offset; #ifdef HAVE_DTRACE_H int _trap_offset; #endif // def HAVE_DTRACE_H @@ -332,24 +336,25 @@ bool is_compiled_by_c2() const; // boundaries for different parts - address code_begin () const { return _entry_point; } - address code_end () const { return header_begin() + _stub_offset ; } - address exception_begin () const { return header_begin() + _exception_offset ; } - address deopt_handler_begin() const { return header_begin() + _deoptimize_offset ; } - address stub_begin () const { return header_begin() + _stub_offset ; } - address stub_end () const { return header_begin() + _consts_offset ; } - address consts_begin () const { return header_begin() + _consts_offset ; } - address consts_end () const { return header_begin() + _scopes_data_offset ; } - address scopes_data_begin () const { return header_begin() + _scopes_data_offset ; } - address scopes_data_end () const { return header_begin() + _scopes_pcs_offset ; } - PcDesc* scopes_pcs_begin () const { return (PcDesc*)(header_begin() + _scopes_pcs_offset ); } - PcDesc* scopes_pcs_end () const { return (PcDesc*)(header_begin() + _dependencies_offset); } - address dependencies_begin () const { return header_begin() + _dependencies_offset ; } - address dependencies_end () const { return header_begin() + _handler_table_offset ; } - address handler_table_begin() const { return header_begin() + _handler_table_offset ; } - address handler_table_end () const { return header_begin() + _nul_chk_table_offset ; } - address nul_chk_table_begin() const { return header_begin() + _nul_chk_table_offset ; } - address nul_chk_table_end () const { return header_begin() + _nmethod_end_offset ; } + address code_begin () const { return _entry_point; } + address code_end () const { return header_begin() + _stub_offset ; } + address exception_begin () const { return header_begin() + _exception_offset ; } + address deopt_handler_begin () const { return header_begin() + _deoptimize_offset ; } + address deopt_mh_handler_begin() const { return header_begin() + _deoptimize_mh_offset ; } + address stub_begin () const { return header_begin() + _stub_offset ; } + address stub_end () const { return header_begin() + _consts_offset ; } + address consts_begin () const { return header_begin() + _consts_offset ; } + address consts_end () const { return header_begin() + _scopes_data_offset ; } + address scopes_data_begin () const { return header_begin() + _scopes_data_offset ; } + address scopes_data_end () const { return header_begin() + _scopes_pcs_offset ; } + PcDesc* scopes_pcs_begin () const { return (PcDesc*)(header_begin() + _scopes_pcs_offset ); } + PcDesc* scopes_pcs_end () const { return (PcDesc*)(header_begin() + _dependencies_offset) ; } + address dependencies_begin () const { return header_begin() + _dependencies_offset ; } + address dependencies_end () const { return header_begin() + _handler_table_offset ; } + address handler_table_begin () const { return header_begin() + _handler_table_offset ; } + address handler_table_end () const { return header_begin() + _nul_chk_table_offset ; } + address nul_chk_table_begin () const { return header_begin() + _nul_chk_table_offset ; } + address nul_chk_table_end () const { return header_begin() + _nmethod_end_offset ; } int code_size () const { return code_end () - code_begin (); } int stub_size () const { return stub_end () - stub_begin (); } @@ -524,7 +529,7 @@ private: ScopeDesc* scope_desc_in(address begin, address end); - address* orig_pc_addr(const frame* fr ) { return (address*) ((address)fr->unextended_sp() + _orig_pc_offset); } + address* orig_pc_addr(const frame* fr) { return (address*) ((address)fr->unextended_sp() + _orig_pc_offset); } PcDesc* find_pc_desc_internal(address pc, bool approximate); @@ -547,13 +552,17 @@ void copy_scopes_pcs(PcDesc* pcs, int count); void copy_scopes_data(address buffer, int size); - // deopt - // return true is the pc is one would expect if the frame is being deopted. - bool is_deopt_pc(address pc); + // Deopt + // Return true is the PC is one would expect if the frame is being deopted. + bool is_deopt_pc (address pc) { return is_deopt_entry(pc) || is_deopt_mh_entry(pc); } + bool is_deopt_entry (address pc) { return pc == deopt_handler_begin(); } + bool is_deopt_mh_entry(address pc) { return pc == deopt_mh_handler_begin(); } // Accessor/mutator for the original pc of a frame before a frame was deopted. address get_original_pc(const frame* fr) { return *orig_pc_addr(fr); } void set_original_pc(const frame* fr, address pc) { *orig_pc_addr(fr) = pc; } + static address get_deopt_original_pc(const frame* fr); + // MethodHandle bool is_method_handle_return(address return_pc);