(space = "all")
| 609 | } |
| 610 | |
| 611 | function print_memory(space = "all") { |
| 612 | if (isolate_address == 0) { |
| 613 | print("Please call !set_iso(isolate_address) first."); |
| 614 | return; |
| 615 | } |
| 616 | |
| 617 | let iso = cast(isolate_address, "v8::internal::Isolate"); |
| 618 | let h = iso.heap_; |
| 619 | print(`Heap at ${h.targetLocation}`); |
| 620 | |
| 621 | let st = space.toLowerCase().split(" "); |
| 622 | |
| 623 | print("Im address:\t object area start - end (size)"); |
| 624 | if (st.includes("all") || st.includes("old")) { |
| 625 | print_memory_chunk_list("OldSpace", |
| 626 | h.old_space_.memory_chunk_list_.front_, |
| 627 | h.old_space_.allocation_info_.top_); |
| 628 | } |
| 629 | if (st.includes("all") || st.includes("new")) { |
| 630 | // new space doesn't use the chunk list from its base class but from |
| 631 | // the to/from semi-spaces it points to |
| 632 | print_memory_chunk_list("NewSpace_To", |
| 633 | h.new_space_.to_space_.memory_chunk_list_.front_, |
| 634 | h.new_space_.allocation_info_.top_, |
| 635 | h.new_space_.to_space_.age_mark_); |
| 636 | print_memory_chunk_list("NewSpace_From", |
| 637 | h.new_space_.from_space_.memory_chunk_list_.front_); |
| 638 | } |
| 639 | if (st.includes("all") || st.includes("map")) { |
| 640 | print_memory_chunk_list("MapSpace", |
| 641 | h.map_space_.memory_chunk_list_.front_, |
| 642 | h.map_space_.allocation_info_.top_); |
| 643 | } |
| 644 | if (st.includes("all") || st.includes("code")) { |
| 645 | print_memory_chunk_list("CodeSpace", |
| 646 | h.code_space_.memory_chunk_list_.front_, |
| 647 | h.code_space_.allocation_info_.top_); |
| 648 | } |
| 649 | if (st.includes("all") || st.includes("large") || st.includes("lo")) { |
| 650 | print_memory_chunk_list("OldLargeObjectSpace", |
| 651 | h.lo_space_.memory_chunk_list_.front_); |
| 652 | } |
| 653 | if (st.includes("all") || st.includes("newlarge") || st.includes("nlo")) { |
| 654 | print_memory_chunk_list("NewLargeObjectSpace", |
| 655 | h.new_lo_space_.memory_chunk_list_.front_); |
| 656 | } |
| 657 | if (st.includes("all") || st.includes("readonly") || st.includes("ro")) { |
| 658 | print_memory_chunk_list("ReadOnlySpace", |
| 659 | h.read_only_space_.memory_chunk_list_.front_); |
| 660 | } |
| 661 | } |
| 662 | |
| 663 | function print_owning_space(address) { |
| 664 | if (isolate_address == 0) { |
nothing calls this directly
no test coverage detected