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

Unified Diff: src/heap/heap.cc

Issue 1305163007: [heap] Remove raw unchecked root set accessors. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix no-snap builds. Created 5 years, 4 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/spaces.cc » ('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 31a9681ef663ac2d2ee69af1e55328dabaf8fd04..4e115f515e16ea900ceb5276ebac7db355b35bf6 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -2576,7 +2576,8 @@ AllocationResult Heap::AllocatePartialMap(InstanceType instance_type,
if (!allocation.To(&result)) return allocation;
// Map::cast cannot be used due to uninitialized map field.
- reinterpret_cast<Map*>(result)->set_map(raw_unchecked_meta_map());
+ reinterpret_cast<Map*>(result)->set_map(
+ reinterpret_cast<Map*>(root(kMetaMapRootIndex)));
reinterpret_cast<Map*>(result)->set_instance_type(instance_type);
reinterpret_cast<Map*>(result)->set_instance_size(instance_size);
// Initialize to only containing tagged fields.
@@ -3561,11 +3562,14 @@ void Heap::CreateFillerObjectAt(Address addr, int size) {
if (size == 0) return;
HeapObject* filler = HeapObject::FromAddress(addr);
if (size == kPointerSize) {
- filler->set_map_no_write_barrier(raw_unchecked_one_pointer_filler_map());
+ filler->set_map_no_write_barrier(
+ reinterpret_cast<Map*>(root(kOnePointerFillerMapRootIndex)));
} else if (size == 2 * kPointerSize) {
- filler->set_map_no_write_barrier(raw_unchecked_two_pointer_filler_map());
+ filler->set_map_no_write_barrier(
+ reinterpret_cast<Map*>(root(kTwoPointerFillerMapRootIndex)));
} else {
- filler->set_map_no_write_barrier(raw_unchecked_free_space_map());
+ filler->set_map_no_write_barrier(
+ reinterpret_cast<Map*>(root(kFreeSpaceMapRootIndex)));
FreeSpace::cast(filler)->nobarrier_set_size(size);
}
// At this point, we may be deserializing the heap from a snapshot, and
@@ -6266,7 +6270,7 @@ void PathTracer::TracePathFrom(Object** root) {
static bool SafeIsNativeContext(HeapObject* obj) {
- return obj->map() == obj->GetHeap()->raw_unchecked_native_context_map();
+ return obj->map() == obj->GetHeap()->root(Heap::kNativeContextMapRootIndex);
}
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698