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

Side by Side Diff: gin/BUILD.gn

Issue 2841443005: [Bindings] Create and use V8 context snapshots (Closed)
Patch Set: Work for most comments Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//testing/test.gni") 5 import("//testing/test.gni")
6 import("//v8/gni/v8.gni") 6 import("//v8/gni/v8.gni")
7 7
8 # This is depended upon from the browser DLL on Windows, where V8 is not used, 8 # This is depended upon from the browser DLL on Windows, where V8 is not used,
9 # but features are enabled. This cannot depend on V8. 9 # but features are enabled. This cannot depend on V8.
10 component("gin_features") { 10 component("gin_features") {
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 ] 88 ]
89 89
90 if (v8_use_external_startup_data) { 90 if (v8_use_external_startup_data) {
91 data = [ 91 data = [
92 "$root_out_dir/natives_blob.bin", 92 "$root_out_dir/natives_blob.bin",
93 "$root_out_dir/snapshot_blob.bin", 93 "$root_out_dir/snapshot_blob.bin",
94 ] 94 ]
95 } 95 }
96 96
97 defines = [ "GIN_IMPLEMENTATION" ] 97 defines = [ "GIN_IMPLEMENTATION" ]
98
99 public_deps = [ 98 public_deps = [
100 "//base", 99 "//base",
101 "//v8", 100 "//v8",
102 ] 101 ]
102
103 deps = [ 103 deps = [
104 ":gin_features", 104 ":gin_features",
105 "//base/third_party/dynamic_annotations", 105 "//base/third_party/dynamic_annotations",
106 ] 106 ]
107 107
108 if (is_mac) { 108 if (is_mac) {
109 libs = [ "CoreFoundation.framework" ] 109 libs = [ "CoreFoundation.framework" ]
110 } 110 }
111 111
112 configs += [ "//v8:external_startup_data" ] 112 configs += [ "//v8:external_startup_data" ]
113 } 113 }
114 114
115 executable("gin_shell") { 115 executable("gin_shell") {
116 sources = [ 116 sources = [
117 "shell/gin_main.cc", 117 "shell/gin_main.cc",
118 ] 118 ]
119 119
120 deps = [ 120 deps = [
121 ":gin", 121 ":gin",
122 "//base", 122 "//base",
123 "//base:i18n", 123 "//base:i18n",
124 "//build/config:exe_and_shlib_deps", 124 "//build/config:exe_and_shlib_deps",
125 "//build/win:default_exe_manifest", 125 "//build/win:default_exe_manifest",
126 "//v8", 126 "//v8",
127 ] 127 ]
128 128
129 configs += [ "//v8:external_startup_data" ] 129 configs += [ "//v8:external_startup_data" ]
130 } 130 }
131 131
132 group("blink_v8_snapshot") {
133 public_deps = [
134 ":generate_blink_v8_snapshot",
135 ]
136 }
137
138 action("generate_blink_v8_snapshot") {
139 script = "run.py"
140 output_file = "$root_out_dir/blink_v8_snapshot.bin"
141 output_path = rebase_path(output_file, root_build_dir)
142
143 args = [
144 "./" + rebase_path(
145 get_label_info(":blink_v8_snapshot_generator($host_toolchain)",
146 "root_out_dir") + "/blink_v8_snapshot_generator",
147 root_build_dir),
148 "--output_file=$output_path",
149 ]
150
151 outputs = [
152 output_file,
153 ]
154
155 deps = [
156 ":blink_v8_snapshot_generator($host_toolchain)",
157 ]
158 }
159
160 # This config disables a link time optimization "ICF", which may merge different
161 # functions into one if the function signatures and body of them are identical.
162 config("disable_icf") {
163 visibility = [ ":*" ] # Only targets in this file can depend on this.
164 if (is_win) {
165 ldflags = [ "/OPT:NOICF" ]
166 } else if (is_posix && !is_mac) {
167 ldflags = [ "-Wl,--icf=none" ]
168 }
169 }
170
171 executable("blink_v8_snapshot_generator") {
172 sources = [
173 "shell/blink_v8_snapshot_generator_main.cc",
174 ]
175
176 deps = [
177 ":gin",
178 "//mojo/edk/system:system",
179 "//third_party/WebKit/public:blink",
180 "//v8",
181 ]
182
183 # Link time optimization "ICF" breaks 1:1 mappings of the external references
184 # for V8 snapshot. So, we disable it while taking a V8 snapshot.
185 configs += [
186 "//v8:external_startup_data",
187 ":disable_icf",
188 ]
189 }
190
132 source_set("gin_test") { 191 source_set("gin_test") {
133 testonly = true 192 testonly = true
134 sources = [ 193 sources = [
135 "test/file.cc", 194 "test/file.cc",
136 "test/file.h", 195 "test/file.h",
137 "test/file_runner.cc", 196 "test/file_runner.cc",
138 "test/file_runner.h", 197 "test/file_runner.h",
139 "test/gc.cc", 198 "test/gc.cc",
140 "test/gc.h", 199 "test/gc.h",
141 "test/gtest.cc", 200 "test/gtest.cc",
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 "shell/hello_world.js", 250 "shell/hello_world.js",
192 "test/file_unittests.js", 251 "test/file_unittests.js",
193 "test/gtest_unittests.js", 252 "test/gtest_unittests.js",
194 "../OWNERS", 253 "../OWNERS",
195 ] 254 ]
196 255
197 data_deps = [ 256 data_deps = [
198 ":gin_shell", 257 ":gin_shell",
199 ] 258 ]
200 } 259 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698