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

Unified Diff: gin/BUILD.gn

Issue 2841443005: [Bindings] Create and use V8 context snapshots (Closed)
Patch Set: Work for most comments Created 3 years, 7 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
Index: gin/BUILD.gn
diff --git a/gin/BUILD.gn b/gin/BUILD.gn
index f386fb6b22253fc5d1befbfdb564a22036d67ec6..87cc3a5e69183a5537e9f4fe7b677a193b71743f 100644
--- a/gin/BUILD.gn
+++ b/gin/BUILD.gn
@@ -95,11 +95,11 @@ component("gin") {
}
defines = [ "GIN_IMPLEMENTATION" ]
-
public_deps = [
"//base",
"//v8",
]
+
deps = [
":gin_features",
"//base/third_party/dynamic_annotations",
@@ -130,6 +130,62 @@ executable("gin_shell") {
configs += [ "//v8:external_startup_data" ]
}
+group("v8_context_snapshot_for_blink") {
+ public_deps = [
+ ":generate_v8_context_snapshot_for_blink",
+ ]
+}
+
+action("generate_v8_context_snapshot_for_blink") {
+ script = "run.py"
+ output_file = "$root_out_dir/context_blob.bin"
+ output_path = rebase_path(output_file, root_build_dir)
+
+ args = [
+ "./" + rebase_path(get_label_info(":gin_blink_snapshot($host_toolchain)",
+ "root_out_dir") + "/gin_blink_snapshot",
+ root_build_dir),
+ "--output_file=$output_path",
+ ]
+
+ outputs = [
+ output_file,
+ ]
+
+ deps = [
+ ":gin_blink_snapshot($host_toolchain)",
+ ]
+}
+
+# This config disables a link time optimization which merge some pointers,
+# but we must keep duplicated entries in external references for V8 snapshot.
Yuki 2017/05/30 14:35:56 Good comment. Let's make this a little more expli
peria 2017/06/01 08:33:32 Done.
+config("disable_icf") {
+ visibility = [ ":*" ] # Only targets in this file can depend on this.
+ if (is_win) {
+ ldflags = [ "/OPT:NOICF" ]
+ } else if (is_posix && !is_mac) {
+ ldflags = [ "-Wl,--icf=none" ]
+ }
+}
+
+executable("gin_blink_snapshot") {
Yuki 2017/05/30 14:35:56 nit: s/gin_blink_snapshot/gin_blink_v8_snapshot/
peria 2017/06/01 08:33:32 Done.
+ sources = [
+ "shell/gin_prepare_main.cc",
+ ]
+
+ deps = [
+ ":gin",
+ "//mojo/edk/system:system",
+ "//third_party/WebKit/public:blink",
+ "//v8",
+ ]
+
+ configs += [
+ "//v8:external_startup_data",
+ ":disable_icf",
+ ]
+}
+
source_set("gin_test") {
testonly = true
sources = [

Powered by Google App Engine
This is Rietveld 408576698