Commit f4f2e9c5 authored by jkummerow's avatar jkummerow Committed by Commit bot

Fix GC-induced DCHECK failure in Runtime_GetWeakMapEntries

R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/1091253002

Cr-Commit-Position: refs/heads/master@{#27921}
parent c6a36305
......@@ -266,6 +266,11 @@ RUNTIME_FUNCTION(Runtime_GetWeakMapEntries) {
}
Handle<FixedArray> entries =
isolate->factory()->NewFixedArray(max_entries * 2);
// Allocation can cause GC can delete weak elements. Reload.
if (max_entries > table->NumberOfElements()) {
max_entries = table->NumberOfElements();
}
{
DisallowHeapAllocation no_gc;
int count = 0;
......
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