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

Unified Diff: src/heap/heap.cc

Issue 1079923003: Put newly allocated buffers at the right end of the buffers list (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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/heap/objects-visiting.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 418cad72be73f8598690cc42e56edc7368d405e2..835a820698982d519b2765c704898836da3e1c99 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -156,6 +156,7 @@ Heap::Heap()
memset(roots_, 0, sizeof(roots_[0]) * kRootListLength);
set_native_contexts_list(NULL);
set_array_buffers_list(Smi::FromInt(0));
+ set_last_array_buffer_in_list(Smi::FromInt(0));
set_allocation_sites_list(Smi::FromInt(0));
set_encountered_weak_collections(Smi::FromInt(0));
set_encountered_weak_cells(Smi::FromInt(0));
@@ -1679,8 +1680,8 @@ void Heap::ProcessYoungWeakReferences(WeakObjectRetainer* retainer) {
void Heap::ProcessNativeContexts(WeakObjectRetainer* retainer) {
- Object* head =
- VisitWeakList<Context>(this, native_contexts_list(), retainer, false);
+ Object* head = VisitWeakList<Context>(this, native_contexts_list(), retainer,
+ false, NULL);
// Update the head of the list of contexts.
set_native_contexts_list(head);
}
@@ -1688,9 +1689,12 @@ void Heap::ProcessNativeContexts(WeakObjectRetainer* retainer) {
void Heap::ProcessArrayBuffers(WeakObjectRetainer* retainer,
bool stop_after_young) {
- Object* array_buffer_obj = VisitWeakList<JSArrayBuffer>(
- this, array_buffers_list(), retainer, stop_after_young);
+ Object* last_array_buffer = undefined_value();
+ Object* array_buffer_obj =
+ VisitWeakList<JSArrayBuffer>(this, array_buffers_list(), retainer,
+ stop_after_young, &last_array_buffer);
set_array_buffers_list(array_buffer_obj);
+ set_last_array_buffer_in_list(last_array_buffer);
// Verify invariant that young array buffers come before old array buffers
// in array buffers list if there was no promotion failure.
@@ -1711,7 +1715,7 @@ void Heap::ProcessArrayBuffers(WeakObjectRetainer* retainer,
void Heap::ProcessNewArrayBufferViews(WeakObjectRetainer* retainer) {
// Retain the list of new space views.
Object* typed_array_obj = VisitWeakList<JSArrayBufferView>(
- this, new_array_buffer_views_list_, retainer, false);
+ this, new_array_buffer_views_list_, retainer, false, NULL);
set_new_array_buffer_views_list(typed_array_obj);
// Some objects in the list may be in old space now. Find them
@@ -1735,7 +1739,7 @@ void Heap::TearDownArrayBuffers() {
void Heap::ProcessAllocationSites(WeakObjectRetainer* retainer) {
Object* allocation_site_obj = VisitWeakList<AllocationSite>(
- this, allocation_sites_list(), retainer, false);
+ this, allocation_sites_list(), retainer, false, NULL);
set_allocation_sites_list(allocation_site_obj);
}
@@ -5344,6 +5348,7 @@ bool Heap::CreateHeapObjects() {
set_native_contexts_list(undefined_value());
set_array_buffers_list(undefined_value());
+ set_last_array_buffer_in_list(undefined_value());
set_new_array_buffer_views_list(undefined_value());
set_allocation_sites_list(undefined_value());
return true;
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/objects-visiting.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698