Skip to content

Commit e7133f1

Browse files
refacktargos
authored andcommitted
build: configure default v8_optimized_debug
Under the assumption that debugging is more often focused on node core source. This setting compiles V8 with only partial optimizations, DCHECKS, and debug symbols, so it is still very much debuggable, but it is much faster. It does disable SLOW_DCHECKS, but at the advice of the V8 team, those are more important for deep V8 debugging. Override is configurable with `./configure --v8-non-optimized-debug`. PR-URL: #23704 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Ujjwal Sharma <[email protected]>
1 parent 55adc25 commit e7133f1

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

common.gypi

-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828

2929
'openssl_fips%': '',
3030

31-
# Default to -O0 for debug builds.
32-
'v8_optimized_debug%': 0,
33-
3431
# Reset this number to 0 on major V8 upgrades.
3532
# Increment by one for each non-official patch applied to deps/v8.
3633
'v8_embedder_string': '-node.7',

configure.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,12 @@
566566
default=False,
567567
help='get more output from this script')
568568

569+
parser.add_option('--v8-non-optimized-debug',
570+
action='store_true',
571+
dest='v8_non_optimized_debug',
572+
default=False,
573+
help='compile V8 with minimal optimizations and with runtime checks')
574+
569575
# Create compile_commands.json in out/Debug and out/Release.
570576
parser.add_option('-C',
571577
action='store_true',
@@ -1138,7 +1144,7 @@ def configure_library(lib, output):
11381144
def configure_v8(o):
11391145
o['variables']['v8_enable_gdbjit'] = 1 if options.gdb else 0
11401146
o['variables']['v8_no_strict_aliasing'] = 1 # Work around compiler bugs.
1141-
o['variables']['v8_optimized_debug'] = 0 # Compile with -O0 in debug builds.
1147+
o['variables']['v8_optimized_debug'] = 0 if options.v8_non_optimized_debug else 1
11421148
o['variables']['v8_random_seed'] = 0 # Use a random seed for hash tables.
11431149
o['variables']['v8_promise_internal_field_count'] = 1 # Add internal field to promises for async hooks.
11441150
o['variables']['v8_use_snapshot'] = 'false' if options.without_snapshot else 'true'

0 commit comments

Comments
 (0)