Line data Source code
1 : // Copyright 2017 the V8 project authors. All rights reserved.
2 : // Use of this source code is governed by a BSD-style license that can be
3 : // found in the LICENSE file.
4 :
5 : #include "src/setup-isolate.h"
6 :
7 : #include "src/base/logging.h"
8 : #include "src/heap/heap-inl.h"
9 : #include "src/interpreter/interpreter.h"
10 : #include "src/interpreter/setup-interpreter.h"
11 : #include "src/isolate.h"
12 :
13 : namespace v8 {
14 : namespace internal {
15 :
16 1 : void SetupIsolateDelegate::SetupBuiltins(Isolate* isolate) {
17 1 : if (create_heap_objects_) {
18 1 : SetupBuiltinsInternal(isolate);
19 : } else {
20 : DCHECK(isolate->snapshot_available());
21 : }
22 1 : }
23 :
24 1 : void SetupIsolateDelegate::SetupInterpreter(
25 : interpreter::Interpreter* interpreter) {
26 1 : if (create_heap_objects_) {
27 1 : interpreter::SetupInterpreter::InstallBytecodeHandlers(interpreter);
28 : } else {
29 : DCHECK(interpreter->IsDispatchTableInitialized());
30 : }
31 1 : }
32 :
33 1 : bool SetupIsolateDelegate::SetupHeap(Heap* heap) {
34 1 : if (create_heap_objects_) {
35 1 : return SetupHeapInternal(heap);
36 : } else {
37 : DCHECK(heap->isolate()->snapshot_available());
38 : return true;
39 : }
40 : }
41 :
42 : } // namespace internal
43 : } // namespace v8
|