141 int _unwind_handler_offset; |
141 int _unwind_handler_offset; |
142 |
142 |
143 #ifdef HAVE_DTRACE_H |
143 #ifdef HAVE_DTRACE_H |
144 int _trap_offset; |
144 int _trap_offset; |
145 #endif // def HAVE_DTRACE_H |
145 #endif // def HAVE_DTRACE_H |
|
146 int _consts_offset; |
146 int _stub_offset; |
147 int _stub_offset; |
147 int _consts_offset; |
|
148 int _oops_offset; // offset to where embedded oop table begins (inside data) |
148 int _oops_offset; // offset to where embedded oop table begins (inside data) |
149 int _scopes_data_offset; |
149 int _scopes_data_offset; |
150 int _scopes_pcs_offset; |
150 int _scopes_pcs_offset; |
151 int _dependencies_offset; |
151 int _dependencies_offset; |
152 int _handler_table_offset; |
152 int _handler_table_offset; |
334 bool is_compiled_by_c1() const; |
334 bool is_compiled_by_c1() const; |
335 bool is_compiled_by_c2() const; |
335 bool is_compiled_by_c2() const; |
336 bool is_compiled_by_shark() const; |
336 bool is_compiled_by_shark() const; |
337 |
337 |
338 // boundaries for different parts |
338 // boundaries for different parts |
339 address insts_begin () const { return code_begin(); } |
339 address consts_begin () const { return header_begin() + _consts_offset ; } |
|
340 address consts_end () const { return header_begin() + code_offset() ; } |
|
341 address insts_begin () const { return header_begin() + code_offset() ; } |
340 address insts_end () const { return header_begin() + _stub_offset ; } |
342 address insts_end () const { return header_begin() + _stub_offset ; } |
|
343 address stub_begin () const { return header_begin() + _stub_offset ; } |
|
344 address stub_end () const { return header_begin() + _oops_offset ; } |
341 address exception_begin () const { return header_begin() + _exception_offset ; } |
345 address exception_begin () const { return header_begin() + _exception_offset ; } |
342 address deopt_handler_begin () const { return header_begin() + _deoptimize_offset ; } |
346 address deopt_handler_begin () const { return header_begin() + _deoptimize_offset ; } |
343 address deopt_mh_handler_begin() const { return header_begin() + _deoptimize_mh_offset ; } |
347 address deopt_mh_handler_begin() const { return header_begin() + _deoptimize_mh_offset ; } |
344 address unwind_handler_begin () const { return _unwind_handler_offset != -1 ? (header_begin() + _unwind_handler_offset) : NULL; } |
348 address unwind_handler_begin () const { return _unwind_handler_offset != -1 ? (header_begin() + _unwind_handler_offset) : NULL; } |
345 address stub_begin () const { return header_begin() + _stub_offset ; } |
|
346 address stub_end () const { return header_begin() + _consts_offset ; } |
|
347 address consts_begin () const { return header_begin() + _consts_offset ; } |
|
348 address consts_end () const { return header_begin() + _oops_offset ; } |
|
349 oop* oops_begin () const { return (oop*) (header_begin() + _oops_offset) ; } |
349 oop* oops_begin () const { return (oop*) (header_begin() + _oops_offset) ; } |
350 oop* oops_end () const { return (oop*) (header_begin() + _scopes_data_offset) ; } |
350 oop* oops_end () const { return (oop*) (header_begin() + _scopes_data_offset) ; } |
351 |
351 |
352 address scopes_data_begin () const { return header_begin() + _scopes_data_offset ; } |
352 address scopes_data_begin () const { return header_begin() + _scopes_data_offset ; } |
353 address scopes_data_end () const { return header_begin() + _scopes_pcs_offset ; } |
353 address scopes_data_end () const { return header_begin() + _scopes_pcs_offset ; } |
359 address handler_table_end () const { return header_begin() + _nul_chk_table_offset ; } |
359 address handler_table_end () const { return header_begin() + _nul_chk_table_offset ; } |
360 address nul_chk_table_begin () const { return header_begin() + _nul_chk_table_offset ; } |
360 address nul_chk_table_begin () const { return header_begin() + _nul_chk_table_offset ; } |
361 address nul_chk_table_end () const { return header_begin() + _nmethod_end_offset ; } |
361 address nul_chk_table_end () const { return header_begin() + _nmethod_end_offset ; } |
362 |
362 |
363 // Sizes |
363 // Sizes |
|
364 int consts_size () const { return consts_end () - consts_begin (); } |
364 int insts_size () const { return insts_end () - insts_begin (); } |
365 int insts_size () const { return insts_end () - insts_begin (); } |
365 int stub_size () const { return stub_end () - stub_begin (); } |
366 int stub_size () const { return stub_end () - stub_begin (); } |
366 int consts_size () const { return consts_end () - consts_begin (); } |
|
367 int oops_size () const { return (address) oops_end () - (address) oops_begin (); } |
367 int oops_size () const { return (address) oops_end () - (address) oops_begin (); } |
368 int scopes_data_size () const { return scopes_data_end () - scopes_data_begin (); } |
368 int scopes_data_size () const { return scopes_data_end () - scopes_data_begin (); } |
369 int scopes_pcs_size () const { return (intptr_t) scopes_pcs_end () - (intptr_t) scopes_pcs_begin (); } |
369 int scopes_pcs_size () const { return (intptr_t) scopes_pcs_end () - (intptr_t) scopes_pcs_begin (); } |
370 int dependencies_size () const { return dependencies_end () - dependencies_begin (); } |
370 int dependencies_size () const { return dependencies_end () - dependencies_begin (); } |
371 int handler_table_size() const { return handler_table_end() - handler_table_begin(); } |
371 int handler_table_size() const { return handler_table_end() - handler_table_begin(); } |
372 int nul_chk_table_size() const { return nul_chk_table_end() - nul_chk_table_begin(); } |
372 int nul_chk_table_size() const { return nul_chk_table_end() - nul_chk_table_begin(); } |
373 |
373 |
374 int total_size () const; |
374 int total_size () const; |
375 |
375 |
376 // Containment |
376 // Containment |
|
377 bool consts_contains (address addr) const { return consts_begin () <= addr && addr < consts_end (); } |
377 bool insts_contains (address addr) const { return insts_begin () <= addr && addr < insts_end (); } |
378 bool insts_contains (address addr) const { return insts_begin () <= addr && addr < insts_end (); } |
378 bool stub_contains (address addr) const { return stub_begin () <= addr && addr < stub_end (); } |
379 bool stub_contains (address addr) const { return stub_begin () <= addr && addr < stub_end (); } |
379 bool consts_contains (address addr) const { return consts_begin () <= addr && addr < consts_end (); } |
|
380 bool oops_contains (oop* addr) const { return oops_begin () <= addr && addr < oops_end (); } |
380 bool oops_contains (oop* addr) const { return oops_begin () <= addr && addr < oops_end (); } |
381 bool scopes_data_contains (address addr) const { return scopes_data_begin () <= addr && addr < scopes_data_end (); } |
381 bool scopes_data_contains (address addr) const { return scopes_data_begin () <= addr && addr < scopes_data_end (); } |
382 bool scopes_pcs_contains (PcDesc* addr) const { return scopes_pcs_begin () <= addr && addr < scopes_pcs_end (); } |
382 bool scopes_pcs_contains (PcDesc* addr) const { return scopes_pcs_begin () <= addr && addr < scopes_pcs_end (); } |
383 bool handler_table_contains(address addr) const { return handler_table_begin() <= addr && addr < handler_table_end(); } |
383 bool handler_table_contains(address addr) const { return handler_table_begin() <= addr && addr < handler_table_end(); } |
384 bool nul_chk_table_contains(address addr) const { return nul_chk_table_begin() <= addr && addr < nul_chk_table_end(); } |
384 bool nul_chk_table_contains(address addr) const { return nul_chk_table_begin() <= addr && addr < nul_chk_table_end(); } |