Skip to content

Commit 24dd67f

Browse files
refackMylesBorins
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 d82e818 commit 24dd67f

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

common.gypi

Lines changed: 0 additions & 3 deletions
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.44',

configure.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,12 @@
576576
default=True,
577577
help='get more output from this script')
578578

579+
parser.add_option('--v8-non-optimized-debug',
580+
action='store_true',
581+
dest='v8_non_optimized_debug',
582+
default=False,
583+
help='compile V8 with minimal optimizations and with runtime checks')
584+
579585
# Create compile_commands.json in out/Debug and out/Release.
580586
parser.add_option('-C',
581587
action='store_true',
@@ -1156,7 +1162,7 @@ def configure_library(lib, output):
11561162
def configure_v8(o):
11571163
o['variables']['v8_enable_gdbjit'] = 1 if options.gdb else 0
11581164
o['variables']['v8_no_strict_aliasing'] = 1 # Work around compiler bugs.
1159-
o['variables']['v8_optimized_debug'] = 0 # Compile with -O0 in debug builds.
1165+
o['variables']['v8_optimized_debug'] = 0 if options.v8_non_optimized_debug else 1
11601166
o['variables']['v8_random_seed'] = 0 # Use a random seed for hash tables.
11611167
o['variables']['v8_promise_internal_field_count'] = 1 # Add internal field to promises for async hooks.
11621168
o['variables']['v8_use_snapshot'] = 'false' if options.without_snapshot else 'true'

0 commit comments

Comments
 (0)