Commit e63ab104 authored by Steve Blackburn's avatar Steve Blackburn Committed by Commit Bot

Add missing TPH guards

These guards are needed since the third part heaps don't use the
deserialization reservation system.

Bug: v8:9533
Change-Id: I0e8bd7928581979bed15abdfaf639c9fdfc8a30f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2030908
Commit-Queue: Steve Blackburn <steveblackburn@google.com>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66108}
parent 02e57873
......@@ -140,6 +140,7 @@ void DeserializerAllocator::DecodeReservation(
}
bool DeserializerAllocator::ReserveSpace() {
DCHECK(!V8_ENABLE_THIRD_PARTY_HEAP_BOOL);
#ifdef DEBUG
for (int i = 0; i < kNumberOfSpaces; ++i) {
DCHECK_GT(reservations_[i].size(), 0);
......
......@@ -33,8 +33,9 @@ ObjectDeserializer::DeserializeSharedFunctionInfo(
MaybeHandle<HeapObject> ObjectDeserializer::Deserialize(Isolate* isolate) {
Initialize(isolate);
#if !V8_ENABLE_THIRD_PARTY_HEAP_BOOL
if (!allocator()->ReserveSpace()) return MaybeHandle<HeapObject>();
#endif
DCHECK(deserializing_user_code());
HandleScope scope(isolate);
......
......@@ -31,9 +31,11 @@ MaybeHandle<Object> PartialDeserializer::Deserialize(
Isolate* isolate, Handle<JSGlobalProxy> global_proxy,
v8::DeserializeEmbedderFieldsCallback embedder_fields_deserializer) {
Initialize(isolate);
#if !V8_ENABLE_THIRD_PARTY_HEAP_BOOL
if (!allocator()->ReserveSpace()) {
V8::FatalProcessOutOfMemory(isolate, "PartialDeserializer");
}
#endif
AddAttachedObject(global_proxy);
......
......@@ -16,9 +16,11 @@ namespace internal {
void StartupDeserializer::DeserializeInto(Isolate* isolate) {
Initialize(isolate);
#if !V8_ENABLE_THIRD_PARTY_HEAP_BOOL
if (!allocator()->ReserveSpace()) {
V8::FatalProcessOutOfMemory(isolate, "StartupDeserializer");
}
#endif
// No active threads.
DCHECK_NULL(isolate->thread_manager()->FirstThreadStateInUse());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment