Commit 47304413 authored by Igor Sheludko's avatar Igor Sheludko Committed by Commit Bot

[disassembler] Better support for roots

In particular, output root name instead of root value when detecting accesses
to roots table. For example:

  REX.W cmpq [r13+0x80] (root (0x391473a00569 <Map[16]>)),rbx
  REX.W movq rdi,[r13+0x18] (root (0x391473a007b9 <Map>))
  REX.W movq rdi,[r13-0x20] (root (0x391473a005b9 <the_hole>))

turns into

  REX.W cmpq [r13+0x80] (root (heap_number_map)),rbx
  REX.W movq rdi,[r13+0x18] (root (fixed_array_map))
  REX.W movq rdi,[r13-0x20] (root (the_hole_value))

Bug: v8:8238
Change-Id: I0f7bdcb7774a2fe450f930c1bc2f3ccd03064201
Reviewed-on: https://chromium-review.googlesource.com/c/1317823Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57262}
parent 0483e9a9
......@@ -132,12 +132,7 @@ const char* V8NameConverter::RootRelativeName(int offset) const {
RootIndex root_index =
static_cast<RootIndex>(offset_in_roots_table / kPointerSize);
HeapStringAllocator allocator;
StringStream accumulator(&allocator);
isolate_->root(root_index)->ShortPrint(&accumulator);
std::unique_ptr<char[]> obj_name = accumulator.ToCString();
SNPrintF(v8_buffer_, "root (%s)", obj_name.get());
SNPrintF(v8_buffer_, "root (%s)", RootsTable::name(root_index));
return v8_buffer_.start();
} else if (static_cast<unsigned>(offset - kExtRefsTableStart) <
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment