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 SetupBuiltins(Isolate * isolate)16void SetupIsolateDelegate::SetupBuiltins(Isolate* isolate) { 17 if (create_heap_objects_) { 18 SetupBuiltinsInternal(isolate); 19 } else { 20 CHECK(isolate->snapshot_available()); 21 } 22 } 23 SetupInterpreter(interpreter::Interpreter * interpreter)24void SetupIsolateDelegate::SetupInterpreter( 25 interpreter::Interpreter* interpreter) { 26 if (create_heap_objects_) { 27 interpreter::SetupInterpreter::InstallBytecodeHandlers(interpreter); 28 } else { 29 CHECK(interpreter->IsDispatchTableInitialized()); 30 } 31 } 32 SetupHeap(Heap * heap)33bool SetupIsolateDelegate::SetupHeap(Heap* heap) { 34 if (create_heap_objects_) { 35 return SetupHeapInternal(heap); 36 } else { 37 CHECK(heap->isolate()->snapshot_available()); 38 return true; 39 } 40 } 41 42 } // namespace internal 43 } // namespace v8 44