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}
This commit is contained in:
jkummerow 2015-04-17 07:21:32 -07:00 committed by Commit bot
parent c6a36305c7
commit f4f2e9c558

View File

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