390 int scopes_pcs_size () const { return (intptr_t) scopes_pcs_end () - (intptr_t) scopes_pcs_begin (); } |
390 int scopes_pcs_size () const { return (intptr_t) scopes_pcs_end () - (intptr_t) scopes_pcs_begin (); } |
391 int dependencies_size () const { return dependencies_end () - dependencies_begin (); } |
391 int dependencies_size () const { return dependencies_end () - dependencies_begin (); } |
392 int handler_table_size() const { return handler_table_end() - handler_table_begin(); } |
392 int handler_table_size() const { return handler_table_end() - handler_table_begin(); } |
393 int nul_chk_table_size() const { return nul_chk_table_end() - nul_chk_table_begin(); } |
393 int nul_chk_table_size() const { return nul_chk_table_end() - nul_chk_table_begin(); } |
394 |
394 |
|
395 int oops_count() const { assert(oops_size() % oopSize == 0, ""); return (oops_size() / oopSize) + 1; } |
|
396 int metadata_count() const { assert(metadata_size() % wordSize == 0, ""); return (metadata_size() / wordSize) + 1; } |
|
397 |
395 int total_size () const; |
398 int total_size () const; |
396 |
399 |
397 void dec_hotness_counter() { _hotness_counter--; } |
400 void dec_hotness_counter() { _hotness_counter--; } |
398 void set_hotness_counter(int val) { _hotness_counter = val; } |
401 void set_hotness_counter(int val) { _hotness_counter = val; } |
399 int hotness_counter() const { return _hotness_counter; } |
402 int hotness_counter() const { return _hotness_counter; } |
489 // Support for oops in scopes and relocs: |
492 // Support for oops in scopes and relocs: |
490 // Note: index 0 is reserved for null. |
493 // Note: index 0 is reserved for null. |
491 oop oop_at(int index) const { return index == 0 ? (oop) NULL: *oop_addr_at(index); } |
494 oop oop_at(int index) const { return index == 0 ? (oop) NULL: *oop_addr_at(index); } |
492 oop* oop_addr_at(int index) const { // for GC |
495 oop* oop_addr_at(int index) const { // for GC |
493 // relocation indexes are biased by 1 (because 0 is reserved) |
496 // relocation indexes are biased by 1 (because 0 is reserved) |
494 assert(index > 0 && index <= oops_size(), "must be a valid non-zero index"); |
497 assert(index > 0 && index <= oops_count(), "must be a valid non-zero index"); |
495 assert(!_oops_are_stale, "oops are stale"); |
498 assert(!_oops_are_stale, "oops are stale"); |
496 return &oops_begin()[index - 1]; |
499 return &oops_begin()[index - 1]; |
497 } |
500 } |
498 |
501 |
499 // Support for meta data in scopes and relocs: |
502 // Support for meta data in scopes and relocs: |
500 // Note: index 0 is reserved for null. |
503 // Note: index 0 is reserved for null. |
501 Metadata* metadata_at(int index) const { return index == 0 ? NULL: *metadata_addr_at(index); } |
504 Metadata* metadata_at(int index) const { return index == 0 ? NULL: *metadata_addr_at(index); } |
502 Metadata** metadata_addr_at(int index) const { // for GC |
505 Metadata** metadata_addr_at(int index) const { // for GC |
503 // relocation indexes are biased by 1 (because 0 is reserved) |
506 // relocation indexes are biased by 1 (because 0 is reserved) |
504 assert(index > 0 && index <= metadata_size(), "must be a valid non-zero index"); |
507 assert(index > 0 && index <= metadata_count(), "must be a valid non-zero index"); |
505 return &metadata_begin()[index - 1]; |
508 return &metadata_begin()[index - 1]; |
506 } |
509 } |
507 |
510 |
508 void copy_values(GrowableArray<jobject>* oops); |
511 void copy_values(GrowableArray<jobject>* oops); |
509 void copy_values(GrowableArray<Metadata*>* metadata); |
512 void copy_values(GrowableArray<Metadata*>* metadata); |
|
513 |
|
514 Method* attached_method(address call_pc); |
510 |
515 |
511 // Relocation support |
516 // Relocation support |
512 private: |
517 private: |
513 void fix_oop_relocations(address begin, address end, bool initialize_immediates); |
518 void fix_oop_relocations(address begin, address end, bool initialize_immediates); |
514 inline void initialize_immediate_oop(oop* dest, jobject handle); |
519 inline void initialize_immediate_oop(oop* dest, jobject handle); |
694 void print_dependencies() PRODUCT_RETURN; |
699 void print_dependencies() PRODUCT_RETURN; |
695 void print_value_on(outputStream* st) const PRODUCT_RETURN; |
700 void print_value_on(outputStream* st) const PRODUCT_RETURN; |
696 void print_calls(outputStream* st) PRODUCT_RETURN; |
701 void print_calls(outputStream* st) PRODUCT_RETURN; |
697 void print_handler_table() PRODUCT_RETURN; |
702 void print_handler_table() PRODUCT_RETURN; |
698 void print_nul_chk_table() PRODUCT_RETURN; |
703 void print_nul_chk_table() PRODUCT_RETURN; |
|
704 void print_recorded_oops() PRODUCT_RETURN; |
|
705 void print_recorded_metadata() PRODUCT_RETURN; |
699 void print_nmethod(bool print_code); |
706 void print_nmethod(bool print_code); |
700 |
707 |
701 // need to re-define this from CodeBlob else the overload hides it |
708 // need to re-define this from CodeBlob else the overload hides it |
702 virtual void print_on(outputStream* st) const { CodeBlob::print_on(st); } |
709 virtual void print_on(outputStream* st) const { CodeBlob::print_on(st); } |
703 void print_on(outputStream* st, const char* msg) const; |
710 void print_on(outputStream* st, const char* msg) const; |