From 40bc08089d0858820cb790bdfb31cef76c88e59b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Wed, 15 Dec 2021 08:33:46 +0100 Subject: [PATCH] tools: update V8 gypfiles for 10.1 PR-URL: https://github.com/nodejs/node/pull/42657 Reviewed-By: Darshan Sen Reviewed-By: Richard Lau Reviewed-By: Jiawen Geng Reviewed-By: Michael Dawson --- configure.py | 1 + tools/v8_gypfiles/features.gypi | 68 ++++++++++++++++++++++++-------- tools/v8_gypfiles/inspector.gypi | 2 +- tools/v8_gypfiles/toolchain.gypi | 2 +- tools/v8_gypfiles/v8.gyp | 40 ++++++++++++++----- 5 files changed, 85 insertions(+), 28 deletions(-) diff --git a/configure.py b/configure.py index 24cc7d91cd5..ba118ef8db2 100755 --- a/configure.py +++ b/configure.py @@ -1446,6 +1446,7 @@ def configure_library(lib, output, pkgname=None): def configure_v8(o): o['variables']['v8_enable_webassembly'] = 1 + o['variables']['v8_enable_javascript_promise_hooks'] = 1 o['variables']['v8_enable_lite_mode'] = 1 if options.v8_lite_mode else 0 o['variables']['v8_enable_gdbjit'] = 1 if options.gdb else 0 o['variables']['v8_no_strict_aliasing'] = 1 # Work around compiler bugs. diff --git a/tools/v8_gypfiles/features.gypi b/tools/v8_gypfiles/features.gypi index 93162f53348..cb3c9dd0f5f 100644 --- a/tools/v8_gypfiles/features.gypi +++ b/tools/v8_gypfiles/features.gypi @@ -160,9 +160,9 @@ # Enables various testing features. 'v8_enable_test_features%': 0, - # Enables raw heap snapshots containing internals. Used for debugging memory - # on platform and embedder level. - 'v8_enable_raw_heap_snapshots%': 0, + # Enable the Maglev compiler. + # Sets -dV8_ENABLE_MAGLEV + 'v8_enable_maglev%': 0, # With post mortem support enabled, metadata is embedded into libv8 that # describes various parameters of the VM for use by debuggers. See @@ -179,9 +179,6 @@ # Controls the threshold for on-heap/off-heap Typed Arrays. 'v8_typed_array_max_size_in_heap%': 64, - # Enable minor mark compact. - 'v8_enable_minor_mc%': 1, - # Enable lazy source positions by default. 'v8_enable_lazy_source_positions%': 1, @@ -217,26 +214,50 @@ # Sets -DV8_COMPRESS_ZONES. 'v8_enable_zone_compression%': 0, + # Enable the experimental V8 sandbox. + # Sets -DV8_SANDBOX. + 'v8_enable_sandbox%': 0, + + # Enable external pointer sandboxing. Requires v8_enable_sandbox. + # Sets -DV8_SANDBOXED_EXTERNAL_POINRTERS. + 'v8_enable_sandboxed_external_pointers%': 0, + + # Enable sandboxed pointers. Requires v8_enable_sandbox. + # Sets -DV8_SANDBOXED_POINTERS. + 'v8_enable_sandboxed_pointers%': 0, + # Experimental feature for collecting per-class zone memory stats. # Requires use_rtti = true 'v8_enable_precise_zone_stats%': 0, + # Experimental feature that uses SwissNameDictionary instead of NameDictionary + # as the backing store for all dictionary mode objects. + 'v8_enable_swiss_name_dictionary%': 0, + # Experimental feature for tracking constness of properties in non-global # dictionaries. Enabling this also always keeps prototypes in dict mode, # meaning that they are not switched to fast mode. # Sets -DV8_DICT_PROPERTY_CONST_TRACKING 'v8_dict_property_const_tracking%': 0, + # Allow for JS promise hooks (instead of just C++). + 'v8_enable_javascript_promise_hooks%': 0, + # Enable allocation folding globally (sets -dV8_ALLOCATION_FOLDING). # When it's disabled, the --turbo-allocation-folding runtime flag will be ignored. 'v8_enable_allocation_folding%': 1, + # Enable runtime verification of heap snapshots produced for devtools. + 'v8_enable_heap_snapshot_verify%': 0, + # Enable global allocation site tracking. 'v8_allocation_site_tracking%': 1, 'v8_scriptormodule_legacy_lifetime%': 1, - 'v8_include_receiver_in_argc%': 1, + # Change code emission and runtime features to be CET shadow-stack compliant + # (incomplete and experimental). + 'v8_enable_cet_shadow_stack%': 0, # Variables from v8.gni @@ -270,9 +291,6 @@ ['v8_promise_internal_field_count!=0', { 'defines': ['V8_PROMISE_INTERNAL_FIELD_COUNT=<(v8_promise_internal_field_count)'], }], - ['v8_enable_raw_heap_snapshots==1', { - 'defines': ['V8_ENABLE_RAW_HEAP_SNAPSHOTS',], - }], ['v8_enable_future==1', { 'defines': ['V8_ENABLE_FUTURE',], }], @@ -285,9 +303,6 @@ ['v8_enable_hugepage==1', { 'defines': ['ENABLE_HUGEPAGE',], }], - ['v8_enable_minor_mc==1', { - 'defines': ['ENABLE_MINOR_MC',], - }], ['v8_enable_pointer_compression==1', { 'defines': [ 'V8_COMPRESS_POINTERS', @@ -303,6 +318,15 @@ ['v8_enable_zone_compression==1', { 'defines': ['V8_COMPRESS_ZONES',], }], + ['v8_enable_sandbox==1', { + 'defines': ['V8_SANDBOX',], + }], + ['v8_enable_sandboxed_pointers==1', { + 'defines': ['V8_SANDBOXED_POINTERS',], + }], + ['v8_enable_sandboxed_external_pointers==1', { + 'defines': ['V8_SANDBOXED_EXTERNAL_POINTERS',], + }], ['v8_enable_object_print==1', { 'defines': ['OBJECT_PRINT',], }], @@ -348,6 +372,9 @@ # ['v8_enable_handle_zapping==1', { # 'defines': ['ENABLE_HANDLE_ZAPPING',], # }], + ['v8_enable_heap_snapshot_verify==1', { + 'defines': ['V8_ENABLE_HEAP_SNAPSHOT_VERIFY',], + }], ['v8_enable_snapshot_native_code_counters==1', { 'defines': ['V8_SNAPSHOT_NATIVE_CODE_COUNTERS',], }], @@ -390,9 +417,18 @@ ['v8_control_flow_integrity==1', { 'defines': ['V8_ENABLE_CONTROL_FLOW_INTEGRITY',], }], + ['v8_enable_cet_shadow_stack==1', { + 'defines': ['V8_ENABLE_CET_SHADOW_STACK',], + }], ['v8_enable_precise_zone_stats==1', { 'defines': ['V8_ENABLE_PRECISE_ZONE_STATS',], }], + ['v8_enable_maglev==1', { + 'defines': ['V8_ENABLE_MAGLEV',], + }], + ['v8_enable_swiss_name_dictionary==1', { + 'defines': ['V8_ENABLE_SWISS_NAME_DICTIONARY',], + }], ['v8_enable_system_instrumentation==1', { 'defines': ['V8_ENABLE_SYSTEM_INSTRUMENTATION',], }], @@ -402,6 +438,9 @@ ['v8_dict_property_const_tracking==1', { 'defines': ['V8_DICT_PROPERTY_CONST_TRACKING',], }], + ['v8_enable_javascript_promise_hooks==1', { + 'defines': ['V8_ENABLE_JAVASCRIPT_PROMISE_HOOKS',], + }], ['v8_enable_allocation_folding==1', { 'defines': ['V8_ALLOCATION_FOLDING',], }], @@ -414,9 +453,6 @@ ['v8_advanced_bigint_algorithms==1', { 'defines': ['V8_ADVANCED_BIGINT_ALGORITHMS',], }], - ['v8_include_receiver_in_argc==1', { - 'defines': ['V8_INCLUDE_RECEIVER_IN_ARGC',], - }], ], # conditions 'defines': [ 'V8_GYP_BUILD', diff --git a/tools/v8_gypfiles/inspector.gypi b/tools/v8_gypfiles/inspector.gypi index ea4860a7274..5f22e9875d6 100644 --- a/tools/v8_gypfiles/inspector.gypi +++ b/tools/v8_gypfiles/inspector.gypi @@ -120,7 +120,6 @@ '<(inspector_protocol_path)/crdtp/protocol_core.h', '<(inspector_protocol_path)/crdtp/serializable.cc', '<(inspector_protocol_path)/crdtp/serializable.h', - '<(inspector_protocol_path)/crdtp/serializer_traits.h', '<(inspector_protocol_path)/crdtp/span.cc', '<(inspector_protocol_path)/crdtp/span.h', '<(inspector_protocol_path)/crdtp/status.cc', @@ -166,6 +165,7 @@ '--jinja_dir', '<(V8_ROOT)/third_party', '--output_base', '<(inspector_generated_output_root)/src/inspector', '--config', '<(inspector_path)/inspector_protocol_config.json', + '--config_value', 'protocol.path=<(v8_inspector_js_protocol)', '--inspector_protocol_dir', '<(inspector_protocol_path)', ], 'message': 'Generating inspector protocol sources from protocol json', diff --git a/tools/v8_gypfiles/toolchain.gypi b/tools/v8_gypfiles/toolchain.gypi index 0f8166011ff..8ade60b4e3e 100644 --- a/tools/v8_gypfiles/toolchain.gypi +++ b/tools/v8_gypfiles/toolchain.gypi @@ -1008,7 +1008,7 @@ ['OS=="mac"', { 'defines': [ 'V8_HAVE_TARGET_OS', - 'V8_TARGET_OS_MACOSX', + 'V8_TARGET_OS_MACOS', ] }], ['OS=="win"', { diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp index 2eab895d312..d9cab2b5eaf 100644 --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -477,7 +477,7 @@ 'toolsets': ['host', 'target'], 'dependencies': [ 'v8_config_headers', - 'cppgc_headers', + 'v8_heap_base_headers', 'v8_version', ], 'direct_dependent_settings': { @@ -529,7 +529,7 @@ 'v8_headers', 'v8_maybe_icu', 'v8_shared_internal_headers', - 'cppgc_headers', + 'v8_heap_base_headers', 'generate_bytecode_builtins_list', 'run_torque', 'v8_libbase', @@ -539,6 +539,11 @@ '