Index: src/heap/heap.cc |
diff --git a/src/heap/heap.cc b/src/heap/heap.cc |
index e2b82df047161b3feb6c86123692f3024fad279b..91b565e43b7a9025bf0c559e74cfaaa64bfac852 100644 |
--- a/src/heap/heap.cc |
+++ b/src/heap/heap.cc |
@@ -2410,6 +2410,12 @@ bool Heap::CreateInitialMaps() { |
} |
{ |
+ AllocationResult allocation = AllocateEmptyScopeInfo(); |
+ if (!allocation.To(&obj)) return false; |
+ } |
+ |
+ set_empty_scope_info(ScopeInfo::cast(obj)); |
+ { |
AllocationResult allocation = Allocate(boolean_map(), OLD_SPACE); |
if (!allocation.To(&obj)) return false; |
} |
@@ -3809,6 +3815,18 @@ AllocationResult Heap::AllocateEmptyFixedArray() { |
return result; |
} |
+AllocationResult Heap::AllocateEmptyScopeInfo() { |
+ int size = FixedArray::SizeFor(0); |
+ HeapObject* result = nullptr; |
+ { |
+ AllocationResult allocation = AllocateRaw(size, OLD_SPACE); |
+ if (!allocation.To(&result)) return allocation; |
+ } |
+ // Initialize the object. |
+ result->set_map_no_write_barrier(scope_info_map()); |
+ FixedArray::cast(result)->set_length(0); |
+ return result; |
+} |
AllocationResult Heap::CopyAndTenureFixedCOWArray(FixedArray* src) { |
if (!InNewSpace(src)) { |