Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(153)

Unified Diff: src/setup-isolate.h

Issue 2760233005: [snapshot] Move builtins generation into mksnapshot (Closed)
Patch Set: fix GYP builds Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/isolate.cc ('k') | src/setup-isolate-deserialize.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/setup-isolate.h
diff --git a/src/setup-isolate.h b/src/setup-isolate.h
new file mode 100644
index 0000000000000000000000000000000000000000..2e56eaec64a2e374a1f6b2c91bf7d07103f07624
--- /dev/null
+++ b/src/setup-isolate.h
@@ -0,0 +1,44 @@
+// 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.
+
+namespace v8 {
+namespace internal {
+
+class Builtins;
+class Code;
+class Isolate;
+
+namespace interpreter {
+class Interpreter;
+} // namespace interpreter
+
+// This class is an abstraction layer around initialization of components
+// that are either deserialized from the snapshot or generated from scratch.
+// Currently this includes builtins and interpreter bytecode handlers.
+// There are three implementations to choose from (at link time):
+// - setup-isolate-deserialize.cc: always loads things from snapshot.
+// - setup-isolate-full.cc: always generates things.
+// - setup-isolate-for-tests.cc: does the one or the other, controlled by
+// the |create_heap_objects| flag.
+//
+// The actual implementations of generation of builtins and handlers is in
+// setup-builtins-internal.cc and setup-interpreter-internal.cc, and is
+// linked in by the latter two Delegate implementations.
+class SetupIsolateDelegate {
+ public:
+ SetupIsolateDelegate() {}
+ virtual ~SetupIsolateDelegate() {}
+
+ virtual void SetupBuiltins(Isolate* isolate, bool create_heap_objects);
+
+ virtual void SetupInterpreter(interpreter::Interpreter* interpreter,
+ bool create_heap_objects);
+
+ protected:
+ static void SetupBuiltinsInternal(Isolate* isolate);
+ static void AddBuiltin(Builtins* builtins, int index, Code* code);
+};
+
+} // namespace internal
+} // namespace v8
« no previous file with comments | « src/isolate.cc ('k') | src/setup-isolate-deserialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698