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

Side by Side Diff: src/heap/heap.cc

Issue 2160613002: [heap] Remove black pages and use black areas instead. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: disable black allocation Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/heap/heap-inl.h » ('j') | src/heap/incremental-marking.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/heap/heap.h" 5 #include "src/heap/heap.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/ast/scopeinfo.h" 9 #include "src/ast/scopeinfo.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 4161 matching lines...) Expand 10 before | Expand all | Expand 10 after
4172 4172
4173 void Heap::RegisterReservationsForBlackAllocation(Reservation* reservations) { 4173 void Heap::RegisterReservationsForBlackAllocation(Reservation* reservations) {
4174 // TODO(hpayer): We do not have to iterate reservations on black objects 4174 // TODO(hpayer): We do not have to iterate reservations on black objects
4175 // for marking. We just have to execute the special visiting side effect 4175 // for marking. We just have to execute the special visiting side effect
4176 // code that adds objects to global data structures, e.g. for array buffers. 4176 // code that adds objects to global data structures, e.g. for array buffers.
4177 4177
4178 // Code space, map space, and large object space do not use black pages. 4178 // Code space, map space, and large object space do not use black pages.
4179 // Hence we have to color all objects of the reservation first black to avoid 4179 // Hence we have to color all objects of the reservation first black to avoid
4180 // unnecessary marking deque load. 4180 // unnecessary marking deque load.
4181 if (incremental_marking()->black_allocation()) { 4181 if (incremental_marking()->black_allocation()) {
4182 for (int i = CODE_SPACE; i < Serializer::kNumberOfSpaces; i++) { 4182 for (int i = OLD_SPACE; i < Serializer::kNumberOfSpaces; i++) {
4183 const Heap::Reservation& res = reservations[i]; 4183 const Heap::Reservation& res = reservations[i];
4184 for (auto& chunk : res) { 4184 for (auto& chunk : res) {
4185 Address addr = chunk.start; 4185 Address addr = chunk.start;
4186 while (addr < chunk.end) { 4186 while (addr < chunk.end) {
4187 HeapObject* obj = HeapObject::FromAddress(addr); 4187 HeapObject* obj = HeapObject::FromAddress(addr);
4188 Marking::MarkBlack(ObjectMarking::MarkBitFrom(obj)); 4188 Marking::MarkBlack(ObjectMarking::MarkBitFrom(obj));
4189 MemoryChunk::IncrementLiveBytesFromGC(obj, obj->Size());
4190 addr += obj->Size(); 4189 addr += obj->Size();
4191 } 4190 }
4192 } 4191 }
4193 } 4192 }
4194 for (int i = OLD_SPACE; i < Serializer::kNumberOfSpaces; i++) { 4193 for (int i = OLD_SPACE; i < Serializer::kNumberOfSpaces; i++) {
4195 const Heap::Reservation& res = reservations[i]; 4194 const Heap::Reservation& res = reservations[i];
4196 for (auto& chunk : res) { 4195 for (auto& chunk : res) {
4197 Address addr = chunk.start; 4196 Address addr = chunk.start;
4198 while (addr < chunk.end) { 4197 while (addr < chunk.end) {
4199 HeapObject* obj = HeapObject::FromAddress(addr); 4198 HeapObject* obj = HeapObject::FromAddress(addr);
(...skipping 2240 matching lines...) Expand 10 before | Expand all | Expand 10 after
6440 } 6439 }
6441 6440
6442 6441
6443 // static 6442 // static
6444 int Heap::GetStaticVisitorIdForMap(Map* map) { 6443 int Heap::GetStaticVisitorIdForMap(Map* map) {
6445 return StaticVisitorBase::GetVisitorId(map); 6444 return StaticVisitorBase::GetVisitorId(map);
6446 } 6445 }
6447 6446
6448 } // namespace internal 6447 } // namespace internal
6449 } // namespace v8 6448 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/heap/heap-inl.h » ('j') | src/heap/incremental-marking.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698