comparison src/share/vm/code/nmethod.hpp @ 1201:24128c2ffa87

6921339: backout 6917766 Reviewed-by: mr
author twisti
date Fri, 29 Jan 2010 08:33:24 -0800
parents ba263cfb7611
children 5f24d0319e54
comparison
equal deleted inserted replaced
1200:ba263cfb7611 1201:24128c2ffa87
1 /* 1 /*
2 * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved. 2 * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
143 143
144 AbstractCompiler* _compiler; // The compiler which compiled this nmethod 144 AbstractCompiler* _compiler; // The compiler which compiled this nmethod
145 145
146 // Offsets for different nmethod parts 146 // Offsets for different nmethod parts
147 int _exception_offset; 147 int _exception_offset;
148 // All deoptee's will resume execution at this location described by 148 // All deoptee's will resume execution at this location described by this offset
149 // this offset.
150 int _deoptimize_offset; 149 int _deoptimize_offset;
151 // All deoptee's at a MethodHandle call site will resume execution
152 // at this location described by this offset.
153 int _deoptimize_mh_offset;
154 #ifdef HAVE_DTRACE_H 150 #ifdef HAVE_DTRACE_H
155 int _trap_offset; 151 int _trap_offset;
156 #endif // def HAVE_DTRACE_H 152 #endif // def HAVE_DTRACE_H
157 int _stub_offset; 153 int _stub_offset;
158 int _consts_offset; 154 int _consts_offset;
331 327
332 bool is_compiled_by_c1() const; 328 bool is_compiled_by_c1() const;
333 bool is_compiled_by_c2() const; 329 bool is_compiled_by_c2() const;
334 330
335 // boundaries for different parts 331 // boundaries for different parts
336 address code_begin () const { return _entry_point; } 332 address code_begin () const { return _entry_point; }
337 address code_end () const { return header_begin() + _stub_offset ; } 333 address code_end () const { return header_begin() + _stub_offset ; }
338 address exception_begin () const { return header_begin() + _exception_offset ; } 334 address exception_begin () const { return header_begin() + _exception_offset ; }
339 address deopt_handler_begin () const { return header_begin() + _deoptimize_offset ; } 335 address deopt_handler_begin() const { return header_begin() + _deoptimize_offset ; }
340 address deopt_mh_handler_begin() const { return header_begin() + _deoptimize_mh_offset ; } 336 address stub_begin () const { return header_begin() + _stub_offset ; }
341 address stub_begin () const { return header_begin() + _stub_offset ; } 337 address stub_end () const { return header_begin() + _consts_offset ; }
342 address stub_end () const { return header_begin() + _consts_offset ; } 338 address consts_begin () const { return header_begin() + _consts_offset ; }
343 address consts_begin () const { return header_begin() + _consts_offset ; } 339 address consts_end () const { return header_begin() + _scopes_data_offset ; }
344 address consts_end () const { return header_begin() + _scopes_data_offset ; } 340 address scopes_data_begin () const { return header_begin() + _scopes_data_offset ; }
345 address scopes_data_begin () const { return header_begin() + _scopes_data_offset ; } 341 address scopes_data_end () const { return header_begin() + _scopes_pcs_offset ; }
346 address scopes_data_end () const { return header_begin() + _scopes_pcs_offset ; } 342 PcDesc* scopes_pcs_begin () const { return (PcDesc*)(header_begin() + _scopes_pcs_offset ); }
347 PcDesc* scopes_pcs_begin () const { return (PcDesc*)(header_begin() + _scopes_pcs_offset ); } 343 PcDesc* scopes_pcs_end () const { return (PcDesc*)(header_begin() + _dependencies_offset); }
348 PcDesc* scopes_pcs_end () const { return (PcDesc*)(header_begin() + _dependencies_offset) ; } 344 address dependencies_begin () const { return header_begin() + _dependencies_offset ; }
349 address dependencies_begin () const { return header_begin() + _dependencies_offset ; } 345 address dependencies_end () const { return header_begin() + _handler_table_offset ; }
350 address dependencies_end () const { return header_begin() + _handler_table_offset ; } 346 address handler_table_begin() const { return header_begin() + _handler_table_offset ; }
351 address handler_table_begin () const { return header_begin() + _handler_table_offset ; } 347 address handler_table_end () const { return header_begin() + _nul_chk_table_offset ; }
352 address handler_table_end () const { return header_begin() + _nul_chk_table_offset ; } 348 address nul_chk_table_begin() const { return header_begin() + _nul_chk_table_offset ; }
353 address nul_chk_table_begin () const { return header_begin() + _nul_chk_table_offset ; } 349 address nul_chk_table_end () const { return header_begin() + _nmethod_end_offset ; }
354 address nul_chk_table_end () const { return header_begin() + _nmethod_end_offset ; }
355 350
356 int code_size () const { return code_end () - code_begin (); } 351 int code_size () const { return code_end () - code_begin (); }
357 int stub_size () const { return stub_end () - stub_begin (); } 352 int stub_size () const { return stub_end () - stub_begin (); }
358 int consts_size () const { return consts_end () - consts_begin (); } 353 int consts_size () const { return consts_end () - consts_begin (); }
359 int scopes_data_size () const { return scopes_data_end () - scopes_data_begin (); } 354 int scopes_data_size () const { return scopes_data_end () - scopes_data_begin (); }
518 ScopeDesc* scope_desc_at(address pc); 513 ScopeDesc* scope_desc_at(address pc);
519 514
520 private: 515 private:
521 ScopeDesc* scope_desc_in(address begin, address end); 516 ScopeDesc* scope_desc_in(address begin, address end);
522 517
523 address* orig_pc_addr(const frame* fr) { return (address*) ((address)fr->unextended_sp() + _orig_pc_offset); } 518 address* orig_pc_addr(const frame* fr ) { return (address*) ((address)fr->unextended_sp() + _orig_pc_offset); }
524 519
525 PcDesc* find_pc_desc_internal(address pc, bool approximate); 520 PcDesc* find_pc_desc_internal(address pc, bool approximate);
526 521
527 PcDesc* find_pc_desc(address pc, bool approximate) { 522 PcDesc* find_pc_desc(address pc, bool approximate) {
528 PcDesc* desc = _pc_desc_cache.last_pc_desc(); 523 PcDesc* desc = _pc_desc_cache.last_pc_desc();
541 public: 536 public:
542 // copying of debugging information 537 // copying of debugging information
543 void copy_scopes_pcs(PcDesc* pcs, int count); 538 void copy_scopes_pcs(PcDesc* pcs, int count);
544 void copy_scopes_data(address buffer, int size); 539 void copy_scopes_data(address buffer, int size);
545 540
546 // Deopt 541 // deopt
547 // Return true is the PC is one would expect if the frame is being deopted. 542 // return true is the pc is one would expect if the frame is being deopted.
548 bool is_deopt_pc (address pc) { return is_deopt_entry(pc) || is_deopt_mh_entry(pc); } 543 bool is_deopt_pc(address pc);
549 bool is_deopt_entry (address pc) { return pc == deopt_handler_begin(); }
550 bool is_deopt_mh_entry(address pc) { return pc == deopt_mh_handler_begin(); }
551 // Accessor/mutator for the original pc of a frame before a frame was deopted. 544 // Accessor/mutator for the original pc of a frame before a frame was deopted.
552 address get_original_pc(const frame* fr) { return *orig_pc_addr(fr); } 545 address get_original_pc(const frame* fr) { return *orig_pc_addr(fr); }
553 void set_original_pc(const frame* fr, address pc) { *orig_pc_addr(fr) = pc; } 546 void set_original_pc(const frame* fr, address pc) { *orig_pc_addr(fr) = pc; }
554
555 static address get_deopt_original_pc(const frame* fr);
556 547
557 // MethodHandle 548 // MethodHandle
558 bool is_method_handle_return(address return_pc); 549 bool is_method_handle_return(address return_pc);
559 550
560 // jvmti support: 551 // jvmti support: