v8/test/cctest/setup-isolate-for-tests.cc
Olivier Flückiger 8700080c92 [static-roots] Refactor setup_isolate_delegate
Make the setup_isolate_delegate stateless. It does not make sense to
pass a setup delegate to Isolate::Init that would contradict the
configuration of the isolate, hence it does not make sense to let the
delegate decide if heap objects should be created. Instead let the
isolate decide on how to invoke the delegate.

Cleanup in preparation for later changes to mksnapshot.

Bug: v8:13466
Change-Id: I5ca36a1db3e94baf068ba0dc91729a78086a023c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4020172
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Olivier Flückiger <olivf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84550}
2022-11-29 16:23:19 +00:00

27 lines
857 B
C++

// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "test/cctest/setup-isolate-for-tests.h"
// Almost identical to setup-isolate-full.cc. The difference is that while
// testing the embedded snapshot blob can be missing.
namespace v8 {
namespace internal {
bool SetupIsolateDelegateForTests::SetupHeap(Isolate* isolate,
bool create_heap_objects) {
if (!create_heap_objects) return true;
return SetupHeapInternal(isolate);
}
void SetupIsolateDelegateForTests::SetupBuiltins(Isolate* isolate,
bool compile_builtins) {
if (!compile_builtins) return;
SetupBuiltinsInternal(isolate);
}
} // namespace internal
} // namespace v8