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 : namespace v8 {
6 : namespace internal {
7 :
8 : class Builtins;
9 : class Code;
10 : class Isolate;
11 :
12 : namespace interpreter {
13 : class Interpreter;
14 : } // namespace interpreter
15 :
16 : // This class is an abstraction layer around initialization of components
17 : // that are either deserialized from the snapshot or generated from scratch.
18 : // Currently this includes builtins and interpreter bytecode handlers.
19 : // There are two implementations to choose from at link time:
20 : // - setup-isolate-deserialize.cc: always loads things from snapshot.
21 : // - setup-isolate-full.cc: loads from snapshot or bootstraps from scratch,
22 : // controlled by the |create_heap_objects| flag.
23 : // For testing, the implementation in setup-isolate-for-tests.cc can be chosen
24 : // to force the behavior of setup-isolate-full.cc at runtime.
25 : //
26 : // The actual implementations of generation of builtins and handlers is in
27 : // setup-builtins-internal.cc and setup-interpreter-internal.cc, and is
28 : // linked in by the latter two Delegate implementations.
29 : class SetupIsolateDelegate {
30 : public:
31 60620 : SetupIsolateDelegate() {}
32 60620 : virtual ~SetupIsolateDelegate() {}
33 :
34 : virtual void SetupBuiltins(Isolate* isolate, bool create_heap_objects);
35 :
36 : virtual void SetupInterpreter(interpreter::Interpreter* interpreter,
37 : bool create_heap_objects);
38 :
39 : protected:
40 : static void SetupBuiltinsInternal(Isolate* isolate);
41 : static void AddBuiltin(Builtins* builtins, int index, Code* code);
42 : };
43 :
44 : } // namespace internal
45 : } // namespace v8
|