Reviewers: danno,

Description:
Add a 'v8_optimized_debug' option to the build flags

This allows us to do a build with the DEBUG macros enabled and
with all of the compiler optimizations still happening. This provides
a speedup of 3x - 4x when running the layout tests in chromium/blink.

[email protected]
BUG=https://code.google.com/p/chromium/issues/detail?id=254188

Please review this at https://codereview.chromium.org/18431003/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M build/common.gypi


Index: build/common.gypi
diff --git a/build/common.gypi b/build/common.gypi
index dbb33a867bfb9abd6aaeb88a542aa69b168c082d..29a3799174f741df61130d0913c2ba90beb4c410 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -77,6 +77,9 @@

     'v8_object_print%': 0,

+ # Turns on compiler optimizations in Debug builds (#defines are unaffected).
+    'v8_optimized_debug%': 0,
+
     # Enable profiling support. Only required on Windows.
     'v8_enable_prof%': 0,

@@ -500,7 +503,6 @@
         ],
         'msvs_settings': {
           'VCCLCompilerTool': {
-            'Optimization': '0',

             'conditions': [
               ['OS=="win" and component=="shared_library"', {
@@ -508,6 +510,16 @@
               }, {
                 'RuntimeLibrary': '1',  # /MTd
               }],
+              ['v8_optimized_debug==1', {
+                'Optimization': '2',
+                'InlineFunctionExpansion': '2',
+                'EnableIntrinsicFunctions': 'true',
+                'FavorSizeOrSpeed': '0',
+                'StringPooling': 'true',
+                'BasicRuntimeChecks': '0',
+              }, {
+                'Optimization': '0',
+              }],
             ],
           },
           'VCLinkerTool': {
@@ -521,6 +533,26 @@
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd"', { 'cflags': [ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter',
                         '-Wnon-virtual-dtor', '-Woverloaded-virtual' ],
+            'conditions': [
+              ['v8_optimized_debug==1', {
+                'cflags!': [
+                  '-O0',
+                  '-O2',
+                  '-Os',
+                ],
+                'cflags': [
+                  '-fdata-sections',
+                  '-ffunction-sections',
+                  '-O3',
+                ],
+              }],
+              ['v8_optimized_debug==1 and gcc_version==44 and clang==0', {
+                'cflags': [
+                  # Avoid crashes with gcc 4.4 in the v8 test suite.
+                  '-fno-tree-vrp',
+                ],
+              }],
+            ],
           }],
           ['OS=="linux" and v8_enable_backtrace==1', {
             # Support for backtrace_symbols.
@@ -542,7 +574,14 @@
           }],
           ['OS=="mac"', {
             'xcode_settings': {
-              'GCC_OPTIMIZATION_LEVEL': '0',  # -O0
+               'conditions': [
+                 ['v8_optimized_debug==1', {
+                   'GCC_OPTIMIZATION_LEVEL': '3',  # -O3
+                   'GCC_STRICT_ALIASING': 'YES',
+                 }, {
+                   'GCC_OPTIMIZATION_LEVEL': '0',  # -O0
+                 }]
+               ],
             },
           }],
         ],
@@ -557,6 +596,7 @@
           }],
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd"', {
             'cflags!': [
+              '-O0',
               '-O2',
               '-Os',
             ],
@@ -576,6 +616,7 @@
           }],
           ['OS=="android"', {
             'cflags!': [
+              '-O0',
               '-O3',
               '-Os',
             ],


--
--
v8-dev mailing list
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to