Chromium Code Reviews| Index: build/toolchain.gypi |
| diff --git a/build/toolchain.gypi b/build/toolchain.gypi |
| index 95e2cd2ef595a9ac1124ab3d5238f50d608d1fd4..0b7b6dca053760a8a3e285f52a99908d57aeca96 100644 |
| --- a/build/toolchain.gypi |
| +++ b/build/toolchain.gypi |
| @@ -60,9 +60,15 @@ |
| '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 |
| '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, |
| @@ -435,7 +441,6 @@ |
| 'configurations': { |
| 'Debug': { |
| 'defines': [ |
| - 'DEBUG', |
| 'ENABLE_DISASSEMBLER', |
| 'V8_ENABLE_CHECKS', |
| 'OBJECT_PRINT', |
| @@ -449,6 +454,9 @@ |
| }, { |
| 'RuntimeLibrary': '1', # /MTd |
| }], |
| + ['v8_optimized_debug==0', { |
| + 'Optimization': '0', |
| + }], |
| ['v8_optimized_debug==1', { |
| 'Optimization': '1', |
| 'InlineFunctionExpansion': '2', |
| @@ -456,25 +464,74 @@ |
| 'FavorSizeOrSpeed': '0', |
| 'StringPooling': 'true', |
| 'BasicRuntimeChecks': '0', |
| - }, { |
| - 'Optimization': '0', |
| + }], |
| + ['v8_optimized_debug==3', { |
| + 'Optimization': '2', |
| + 'InlineFunctionExpansion': '2', |
| + 'EnableIntrinsicFunctions': 'true', |
| + 'FavorSizeOrSpeed': '0', |
| + 'StringPooling': 'true', |
| + 'BasicRuntimeChecks': '0', |
|
Dirk Pranke
2013/07/23 02:02:01
This was a flag missed on Windows that would cause
|
| + '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', |
| + ], |
| + }, { |
| + 'defines': [ |
| + 'NDEBUG', |
| + ], |
|
Dirk Pranke
2013/07/23 02:02:01
See comments above. This also means that 'v8_enabl
|
| + }], |
| ['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 +540,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 +582,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', |
| }], |
| ], |
| }, |