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

Unified Diff: build/toolchain.gypi

Issue 19384011: Revamp v8_optimized_debug options (Closed) Base URL: https://chromium.googlesource.com/external/v8.git@master
Patch Set: Created 7 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/toolchain.gypi
diff --git a/build/toolchain.gypi b/build/toolchain.gypi
index 95e2cd2ef595a9ac1124ab3d5238f50d608d1fd4..b4c215348e8dc325d0fa18ad81eede0dd4b11e54 100644
--- a/build/toolchain.gypi
+++ b/build/toolchain.gypi
@@ -60,8 +60,14 @@
'v8_enable_backtrace%': 0,
- # Turns on compiler optimizations in Debug builds (#defines are unaffected).
+ # Turns on compiler optimizations in Debug builds:
+ # 0 - optimizations off (default)
+ # 1 - basic optimizations on
+ # 3 - match release mode optimizations
Michael Achenbach 2013/07/22 11:23:19 The issue description introduces mode=2, why is it
'v8_optimized_debug%': 0,
+
+ # #defines ENABLE_CHECK et al in Debug. On by default.
+ 'v8_enable_checks_in_debug%': 1,
# Enable profiling support. Only required on Windows.
'v8_enable_prof%': 0,
@@ -434,13 +440,6 @@
], # conditions
'configurations': {
'Debug': {
- 'defines': [
- 'DEBUG',
- 'ENABLE_DISASSEMBLER',
- 'V8_ENABLE_CHECKS',
- 'OBJECT_PRINT',
- 'VERIFY_HEAP',
- ],
'msvs_settings': {
'VCCLCompilerTool': {
'conditions': [
@@ -449,6 +448,9 @@
}, {
'RuntimeLibrary': '1', # /MTd
}],
+ ['v8_optimized_debug==0', {
+ 'Optimization': '0',
+ }],
['v8_optimized_debug==1', {
'Optimization': '1',
'InlineFunctionExpansion': '2',
@@ -456,25 +458,76 @@
'FavorSizeOrSpeed': '0',
'StringPooling': 'true',
'BasicRuntimeChecks': '0',
- }, {
- 'Optimization': '0',
+ }],
+ ['v8_optimized_debug==3', {
+ 'Optimization': '2',
+ 'InlineFunctionExpansion': '2',
+ 'EnableIntrinsicFunctions': 'true',
+ 'FavorSizeOrSpeed': '0',
+ 'StringPooling': 'true',
+ 'conditions': [
+ ['component=="shared_library"', {
+ 'RuntimeLibrary': '2', #/MD
+ }, {
+ 'RuntimeLibrary': '0', #/MT
+ }],
+ ['v8_target_arch=="x64"', {
+ # TODO(2207): remove this option once the bug is fixed.
+ 'WholeProgramOptimization': 'true',
+ }],
+ ],
}],
],
},
'VCLinkerTool': {
- 'LinkIncremental': '2',
+ 'conditions': [
+ ['v8_optimized_debug==0', {
+ 'LinkIncremental': '2',
+ }],
+ ['v8_optimized_debug==1', {
+ 'LinkIncremental': '2',
+ }],
+ ['v8_optimized_debug==3', {
+ 'LinkIncremental': '1',
+ 'OptimizeReferences': '2',
+ 'EnableCOMDATFolding': '2',
+ }],
+ ],
},
},
'conditions': [
+ ['v8_enable_checks_in_debug==1', {
+ 'defines': [
+ 'DEBUG',
+ 'ENABLE_DISASSEMBLER',
+ 'V8_ENABLE_CHECKS',
+ 'OBJECT_PRINT',
+ 'VERIFY_HEAP',
+ ],
+ }, {
+ 'defines!': ['_DEBUG',],
Michael Achenbach 2013/07/22 11:23:19 Is the "_" intentional?
+ 'defines': ['NDEBUG'],
+ }],
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd"', {
'cflags': [ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter',
'-Wnon-virtual-dtor', '-Woverloaded-virtual',
'<(wno_array_bounds)' ],
'conditions': [
+ ['v8_optimized_debug==0', {
+ 'cflags!': [
+ '-O1',
+ '-O2',
+ '-O3',
+ '-Os',
+ ],
+ 'cflags': [
+ '-O0',
+ ],
+ }],
['v8_optimized_debug==1', {
'cflags!': [
'-O0',
- '-O2',
+ '-O3',
'-Os',
],
'cflags': [
@@ -483,7 +536,20 @@
'-O1',
],
}],
- ['v8_optimized_debug==1 and gcc_version==44 and clang==0', {
+ ['v8_optimized_debug==3', {
+ 'cflags!': [
+ '-O0',
+ '-O1',
+ '-Os',
+ '-g',
+ ],
+ 'cflags': [
+ '-fdata-sections',
+ '-ffunction-sections',
+ '-O3',
+ ],
+ }],
+ ['v8_optimized_debug!=0 and gcc_version==44 and clang==0', {
'cflags': [
# Avoid crashes with gcc 4.4 in the v8 test suite.
'-fno-tree-vrp',
@@ -512,11 +578,16 @@
['OS=="mac"', {
'xcode_settings': {
'conditions': [
+ ['v8_optimized_debug==0', {
+ 'GCC_OPTIMIZATION_LEVEL': '0', # -O0
+ }],
['v8_optimized_debug==1', {
'GCC_OPTIMIZATION_LEVEL': '1', # -O1
'GCC_STRICT_ALIASING': 'YES',
- }, {
- 'GCC_OPTIMIZATION_LEVEL': '0', # -O0
+ }],
+ ['v8_optimized_debug==3', {
+ 'GCC_OPTIMIZATION_LEVEL': '3', # -O3
+ 'GCC_STRICT_ALIASING': 'YES',
}],
],
},
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698