Skip to content

Commit

Permalink
optimize for speed using -Ofast
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary Mathews committed Mar 31, 2019
1 parent ed8f1d8 commit 0f5babf
Show file tree
Hide file tree
Showing 5 changed files with 2,445 additions and 0 deletions.
1 change: 1 addition & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def build(scm, arch, mode) {
// Then apply our patch to avoid grabbing android sdk/ndk
sh 'git apply ../ndkr19c_7.3.patch'
sh 'git apply ../compat.patch'
sh 'git apply ../optimize.patch'
// Now let gclient get the dependencies.
sh '../depot_tools/gclient sync --shallow --no-history --reset --force' // needs python
}
Expand Down
1 change: 1 addition & 0 deletions build_mac_v8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ echo "Asking gclient to clean v8 dependencies"
echo "Applying patches"
git apply ../ndkr19c_7.3.patch
git apply ../compat.patch
git apply ../optimize.patch
echo "Asking gclient to update v8 dependencies"
../depot_tools/gclient sync --shallow --no-history --reset --force
cd ..
Expand Down
1 change: 1 addition & 0 deletions build_v8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ buildV8()
# Hack one of the toolchain items to fix AR executable used for android
cp -f ../overrides/build/toolchain/android/BUILD.gn "$V8_DIR/build/toolchain/android/BUILD.gn"
cp -f ../overrides/build/config/android/BUILD.gn "$V8_DIR/build/config/android/BUILD.gn"
cp -f ../overrides/build/config/compiler/BUILD.gn "$V8_DIR/build/config/compiler/BUILD.gn"
ninja -v -C out.gn/$MAKE_TARGET -j $NUM_CPUS v8_monolith

# Copy the static libraries to our staging area.
Expand Down
32 changes: 32 additions & 0 deletions optimize.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
From 764568df0e1fca9e964d5992ffd761f59a416865 Mon Sep 17 00:00:00 2001
From: Gary Mathews <gmathews@appcelerator.com>
Date: Sat, 30 Mar 2019 19:39:12 -0700
Subject: [PATCH] optimize for speed

---
gni/v8.gni | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/gni/v8.gni b/gni/v8.gni
index 1ed8e0382a..2e3dfabbd7 100644
--- a/gni/v8.gni
+++ b/gni/v8.gni
@@ -96,14 +96,7 @@ if (is_debug && !v8_optimized_debug) {
v8_add_configs += [ "//build/config/compiler:no_optimize" ]
} else {
v8_remove_configs += [ "//build/config/compiler:default_optimization" ]
-
- # TODO(crbug.com/621335) Rework this so that we don't have the confusion
- # between "optimize_speed" and "optimize_max".
- if (((is_posix && !is_android) || is_fuchsia) && !using_sanitizer) {
- v8_add_configs += [ "//build/config/compiler:optimize_speed" ]
- } else {
- v8_add_configs += [ "//build/config/compiler:optimize_max" ]
- }
+ v8_add_configs += [ "//build/config/compiler:optimize_speed" ]
}

if (v8_code_coverage && !is_clang) {
--
2.17.2 (Apple Git-113)

0 comments on commit 0f5babf

Please sign in to comment.