[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: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66103}
This commit is contained in:
Victor Gomes 2020-02-04 10:56:07 +01:00 committed by Commit Bot
parent 091e100cb5
commit 4ba141f3f5

View File

@ -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));
}