v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
setup-isolate.h
Go to the documentation of this file.
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#ifndef V8_INIT_SETUP_ISOLATE_H_
6#define V8_INIT_SETUP_ISOLATE_H_
7
8#include "src/base/macros.h"
9
10namespace v8 {
11namespace internal {
12
13class Builtins;
14enum class Builtin : int32_t;
15template <typename T>
16class Tagged;
17class Code;
18class Heap;
19class Isolate;
20
21// This class is an abstraction layer around initialization of components
22// that are either deserialized from the snapshot or generated from scratch.
23// Currently this includes builtins and interpreter bytecode handlers.
24// There are two implementations to choose from at link time:
25// - setup-isolate-deserialize.cc: always loads things from snapshot.
26// - setup-isolate-full.cc: loads from snapshot or bootstraps from scratch,
27// controlled by the |create_heap_objects| flag.
28// For testing, the implementation in setup-isolate-for-tests.cc can be chosen
29// to force the behavior of setup-isolate-full.cc at runtime.
30//
31// The actual implementations of generation of builtins and handlers is in
32// setup-builtins-internal.cc and setup-interpreter-internal.cc, and is
33// linked in by the latter two Delegate implementations.
35 public:
37 virtual ~SetupIsolateDelegate() = default;
38
39 virtual bool SetupHeap(Isolate* isolate, bool create_heap_objects);
40 virtual void SetupBuiltins(Isolate* isolate, bool compile_builtins);
41
42 protected:
43 static void SetupBuiltinsInternal(Isolate* isolate);
44 static void AddBuiltin(Builtins* builtins, Builtin builtin,
45 Tagged<Code> code);
46 static void PopulateWithPlaceholders(Isolate* isolate);
47 static void ReplacePlaceholders(Isolate* isolate);
48
49 static bool SetupHeapInternal(Isolate* isolate);
50};
51
52} // namespace internal
53} // namespace v8
54
55#endif // V8_INIT_SETUP_ISOLATE_H_
virtual ~SetupIsolateDelegate()=default
int int32_t
Definition unicode.cc:40
Tagged(T object) -> Tagged< T >
#define V8_EXPORT_PRIVATE
Definition macros.h:460