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

Unified Diff: src/heap/heap.cc

Issue 1500623002: Reland of Introduce instance type for transition arrays. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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/heap/mark-compact.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 5137301ddf46bc324da3c5784959085fefbabab3..2f017c2c0bdc8f004f3372ccde358ad2613fe365 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -180,6 +180,7 @@
set_allocation_sites_list(Smi::FromInt(0));
set_encountered_weak_collections(Smi::FromInt(0));
set_encountered_weak_cells(Smi::FromInt(0));
+ set_encountered_transition_arrays(Smi::FromInt(0));
// Put a dummy entry in the remembered pages so we can find the list the
// minidump even if there are no real unmapped pages.
RememberUnmappedPage(NULL, false);
@@ -2333,6 +2334,7 @@
ALLOCATE_MAP(FILLER_TYPE, kPointerSize, one_pointer_filler)
ALLOCATE_MAP(FILLER_TYPE, 2 * kPointerSize, two_pointer_filler)
+ ALLOCATE_VARSIZE_MAP(TRANSITION_ARRAY_TYPE, transition_array)
for (unsigned i = 0; i < arraysize(struct_table); i++) {
const StructTable& entry = struct_table[i];
@@ -2491,6 +2493,21 @@
WeakCell::cast(result)->initialize(value);
WeakCell::cast(result)->clear_next(this);
return result;
+}
+
+
+AllocationResult Heap::AllocateTransitionArray(int capacity) {
+ DCHECK(capacity > 0);
+ HeapObject* raw_array = nullptr;
+ {
+ AllocationResult allocation = AllocateRawFixedArray(capacity, TENURED);
+ if (!allocation.To(&raw_array)) return allocation;
+ }
+ raw_array->set_map_no_write_barrier(transition_array_map());
+ TransitionArray* array = TransitionArray::cast(raw_array);
+ array->set_length(capacity);
+ MemsetPointer(array->data_start(), undefined_value(), capacity);
+ return array;
}
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/mark-compact.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698