Commit 4ba141f3 authored by Victor Gomes's avatar Victor Gomes Committed by Commit Bot

[heap-snapshot] Fix context header size

Different contexts have different header sizes now.

The function ScopeInfo::ContextHeaderLength should be used instead of
Context::MIN_CONTEXT_SLOTS.

Bug: chromium:1021884
Change-Id: Ia9ea321cfb19d2a2ae0bc12c7db621f7d35b3b51
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2036074
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: 's avatarVictor Gomes <victorgomes@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66103}
parent 091e100c
......@@ -978,7 +978,7 @@ void V8HeapExplorer::ExtractContextReferences(HeapEntry* entry,
int context_locals = scope_info.ContextLocalCount();
for (int i = 0; i < context_locals; ++i) {
String local_name = scope_info.ContextLocalName(i);
int idx = Context::MIN_CONTEXT_SLOTS + i;
int idx = scope_info.ContextHeaderLength() + i;
SetContextReference(entry, local_name, context.get(idx),
Context::OffsetOfElementAt(idx));
}
......
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