diff --git a/src/heap/setup-heap-internal.cc b/src/heap/setup-heap-internal.cc index 60ef0cc4b0..44d9e14585 100644 --- a/src/heap/setup-heap-internal.cc +++ b/src/heap/setup-heap-internal.cc @@ -732,20 +732,20 @@ void Heap::CreateInitialReadOnlyObjects() { // For static roots we need the r/o space to have identical layout on all // compile targets. Varying objects are padded to their biggest size. auto StaticRootsEnsureAllocatedSize = [&](HeapObject obj, int required) { -#ifdef V8_STATIC_ROOTS_BOOL - if (required == obj.Size()) return; - CHECK_LT(obj.Size(), required); - int filler_size = required - obj.Size(); + if (V8_STATIC_ROOTS_BOOL || v8_flags.static_roots_src) { + if (required == obj.Size()) return; + CHECK_LT(obj.Size(), required); + int filler_size = required - obj.Size(); - HeapObject filler = - allocator()->AllocateRawWith( - filler_size, AllocationType::kReadOnly, AllocationOrigin::kRuntime, - AllocationAlignment::kTaggedAligned); - CreateFillerObjectAt(filler.address(), filler_size, - ClearFreedMemoryMode::kClearFreedMemory); + HeapObject filler = + allocator()->AllocateRawWith( + filler_size, AllocationType::kReadOnly, + AllocationOrigin::kRuntime, AllocationAlignment::kTaggedAligned); + CreateFillerObjectAt(filler.address(), filler_size, + ClearFreedMemoryMode::kClearFreedMemory); - CHECK_EQ(filler.address() + filler.Size(), obj.address() + required); -#endif + CHECK_EQ(filler.address() + filler.Size(), obj.address() + required); + } }; // The -0 value must be set before NewNumber works. diff --git a/src/snapshot/static-roots-gen.cc b/src/snapshot/static-roots-gen.cc index e5c6aedbfb..5241c3982b 100644 --- a/src/snapshot/static-roots-gen.cc +++ b/src/snapshot/static-roots-gen.cc @@ -59,11 +59,11 @@ void StaticRootsTableGen::write(Isolate* isolate, const char* file) { const auto size = static_cast(RootIndex::kReadOnlyRootsCount); { std::map> sorted_roots; -#define ADD_ROOT(_, value, CamelName) \ - { \ - Tagged_t ptr = \ - V8HeapCompressionScheme::CompressTagged(ro_roots.value().ptr()); \ - sorted_roots[ptr].push_back(#CamelName); \ +#define ADD_ROOT(_, value, CamelName) \ + { \ + Tagged_t ptr = V8HeapCompressionScheme::CompressTagged( \ + ro_roots.unchecked_##value().ptr()); \ + sorted_roots[ptr].push_back(#CamelName); \ } READ_ONLY_ROOT_LIST(ADD_ROOT) #undef ADD_ROOT