Revision: 21618
Author: joc...@chromium.org
Date: Tue Jun 3 06:50:46 2014 UTC
Log: First cut at run_mksnapshot action for gn
BUG=none
R=bre...@chromium.org
LOG=n
Review URL: https://codereview.chromium.org/293363009
http://code.google.com/p/v8/source/detail?r=21618
Added:
/branches/bleeding_edge/tools/run.py
Modified:
/branches/bleeding_edge/BUILD.gn
=======================================
--- /dev/null
+++ /branches/bleeding_edge/tools/run.py Tue Jun 3 06:50:46 2014 UTC
@@ -0,0 +1,12 @@
+#!/usr/bin/env python
+# Copyright 2014 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.
+
+"""This program wraps an arbitrary command since gn currently can only
execute
+scripts."""
+
+import subprocess
+import sys
+
+sys.exit(subprocess.call(sys.argv[1:]))
=======================================
--- /branches/bleeding_edge/BUILD.gn Mon Jun 2 11:10:03 2014 UTC
+++ /branches/bleeding_edge/BUILD.gn Tue Jun 3 06:50:46 2014 UTC
@@ -15,9 +15,10 @@
v8_object_print = false
v8_postmortem_support = false
v8_use_default_platform = true
-#v8_use_snapshot = true
+v8_use_snapshot = true
v8_enable_extra_checks = is_debug
v8_target_arch = cpu_arch
+v8_random_seed = "314159265"
###############################################################################
@@ -185,6 +186,8 @@
"src/regexp.js",
"src/arraybuffer.js",
"src/typedarray.js",
+ "src/weak_collection.js",
+ "src/promise.js",
"src/object-observe.js",
"src/macros.py",
]
@@ -199,7 +202,7 @@
args =
rebase_path(outputs, root_build_dir) +
- [ "EXPERIMENTAL", v8_compress_startup_data ] +
+ [ "CORE", v8_compress_startup_data ] +
rebase_path(sources, root_build_dir)
}
@@ -217,8 +220,6 @@
"src/symbol.js",
"src/proxy.js",
"src/collection.js",
- "src/weak_collection.js",
- "src/promise.js",
"src/generator.js",
"src/array-iterator.js",
"src/harmony-string.js",
@@ -232,7 +233,7 @@
args =
rebase_path(outputs, root_build_dir) +
- [ "CORE", v8_compress_startup_data ] +
+ [ "EXPERIMENTAL", v8_compress_startup_data ] +
rebase_path(sources, root_build_dir)
}
@@ -255,6 +256,33 @@
rebase_path(sources, root_build_dir)
}
+action("run_mksnapshot") {
+ visibility = ":*" # Only targets in this file can depend on this.
+
+ deps = [ ":mksnapshot($host_toolchain)" ]
+
+ script = "tools/run.py"
+
+ outputs = [
+ "$target_gen_dir/snapshot.cc"
+ ]
+
+ args = [
+ "./" + rebase_path(get_label_info(":mksnapshot($host_toolchain)",
+ "root_out_dir") + "/mksnapshot",
+ root_build_dir),
+ "--log-snapshot-positions",
+ "--logfile", rebase_path("$target_gen_dir/snapshot.log",
root_build_dir)
+ ]
+
+ if (v8_random_seed != "0") {
+ args += [ "--random-seed", v8_random_seed ]
+ }
+
+ args += rebase_path(outputs, root_build_dir)
+}
+
+
###############################################################################
# Source Sets (aka static libraries)
#
@@ -280,6 +308,29 @@
configs += [ "//build/config/compiler:no_chromium_code" ]
configs += [ ":internal_config", ":features", ":toolchain" ]
}
+
+source_set("v8_snapshot") {
+ visibility = ":*" # Only targets in this file can depend on this.
+
+ deps = [
+ ":js2c",
+ ":js2c_experimental",
+ ":generate_trig_table",
+ ":run_mksnapshot",
+ ":v8_base",
+ ]
+
+ sources = [
+ "$target_gen_dir/libraries.cc",
+ "$target_gen_dir/experimental-libraries.cc",
+ "$target_gen_dir/trig-table.cc",
+ "$target_gen_dir/snapshot.cc",
+ ]
+
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
+ configs += [ ":internal_config", ":features", ":toolchain" ]
+}
source_set("v8_base") {
visibility = ":*" # Only targets in this file can depend on this.
@@ -908,17 +959,10 @@
# Executables
#
-if (current_toolchain != host_toolchain && is_android) {
+executable("mksnapshot") {
+ visibility = ":*" # Only targets in this file can depend on this.
-source_set("mksnapshot") {
sources = [
- ]
-}
-
-} else {
-
-executable("mksnapshot") {
- sources = [
"src/mksnapshot.cc",
]
@@ -936,7 +980,55 @@
}
}
+###############################################################################
+# Public targets
+#
+
+if (component_mode == "shared_library") {
+
+component("v8") {
+ sources = [
+ "src/v8dll-main.cc",
+ ]
+
+ if (v8_use_snapshot) {
+ deps = [
+ ":v8_base",
+ ":v8_snapshot",
+ ]
+ } else {
+ deps = [
+ ":v8_base",
+ ":v8_nosnapshot",
+ ]
+ }
+
+ if (is_android && current_toolchain != host_toolchain) {
+ libs = [ "log" ]
+ }
+
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
+ configs += [ ":internal_config", ":features", ":toolchain" ]
+
+ # TODO(jochen): Support direct dependent configs.
}
+} else {
+
group("v8") {
+ if (v8_use_snapshot) {
+ deps = [
+ ":v8_base",
+ ":v8_snapshot",
+ ]
+ } else {
+ deps = [
+ ":v8_base",
+ ":v8_nosnapshot",
+ ]
+ }
+ # TODO(jochen): Support direct dependent configs.
+}
+
}
--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.