Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Unified Diff: src/heap/heap.cc

Issue 2358503002: Change the CompilerDispatcherJob to take a SharedFunctionInfo (Closed)
Patch Set: updates Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/heap.h ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)) {
« no previous file with comments | « src/heap/heap.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698