From 475c5faad16c0ce419f1e85e26699669f5d33680 Mon Sep 17 00:00:00 2001 From: Jakob Gruber Date: Wed, 6 May 2020 13:41:26 +0200 Subject: [PATCH] [nci] Add NCI build- and runtime flags In upcoming work these flags will be used to configure the experimental native context independent code feature. Build-time flags: v8_enable_nci_code Defines: V8_ENABLE_NCI_CODE Runtime flags: --turbo-nci --turbo-nci-as-highest_tier --print-nci-code --trace-turbo-nci Drive-by: Remove unused embedded builtins and jitless defines. Bug: v8:8888 Change-Id: I4466b440634a787bd84b052fe2466b22540216a4 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2184295 Reviewed-by: Georg Neis Commit-Queue: Jakob Gruber Cr-Commit-Position: refs/heads/master@{#67650} --- BUILD.gn | 15 +++++++-------- src/flags/flag-definitions.h | 9 +++++++++ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index e6d9723bc8..57968c1be4 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -225,6 +225,10 @@ declare_args() { # Enable V8 heap sandbox experimental feature. # Sets -DV8_HEAP_SANDBOX. v8_enable_heap_sandbox = "" + + # Experimental support for native context independent code. + # https://crbug.com/v8/8888 + v8_enable_nci_code = false } # Derived defaults. @@ -453,10 +457,6 @@ config("features") { } if (v8_enable_lite_mode) { defines += [ "V8_LITE_MODE" ] - - # TODO(v8:7777): Remove the define once the --jitless runtime flag does - # everything we need. - defines += [ "V8_JITLESS_MODE" ] } if (v8_enable_gdbjit) { defines += [ "ENABLE_GDB_JIT_INTERFACE" ] @@ -526,10 +526,6 @@ config("features") { if (v8_check_microtasks_scopes_consistency) { defines += [ "V8_CHECK_MICROTASKS_SCOPES_CONSISTENCY" ] } - - # TODO(v8:8519): Remove the define once all use-sites in - # the code are removed/fixed - defines += [ "V8_EMBEDDED_BUILTINS" ] if (v8_use_multi_snapshots) { defines += [ "V8_MULTI_SNAPSHOTS" ] } @@ -557,6 +553,9 @@ config("features") { if (v8_enable_wasm_gdb_remote_debugging) { defines += [ "V8_ENABLE_WASM_GDB_REMOTE_DEBUGGING" ] } + if (v8_enable_nci_code) { + defines += [ "V8_ENABLE_NCI_CODE" ] + } } config("toolchain") { diff --git a/src/flags/flag-definitions.h b/src/flags/flag-definitions.h index f738784180..08e42b5783 100644 --- a/src/flags/flag-definitions.h +++ b/src/flags/flag-definitions.h @@ -650,6 +650,15 @@ DEFINE_BOOL(turbo_fast_api_calls, false, "enable fast API calls from TurboFan") DEFINE_INT(reuse_opt_code_count, 0, "don't discard optimized code for the specified number of deopts.") +// Native context independent (NCI) code. +DEFINE_BOOL(turbo_nci, false, + "enable experimental native context independent code.") +DEFINE_BOOL(turbo_nci_as_highest_tier, false, + "replace default TF with NCI code as the highest tier for testing " + "purposes.") +DEFINE_BOOL(print_nci_code, false, "print native context independent code.") +DEFINE_BOOL(trace_turbo_nci, false, "trace native context independent code.") + // Favor memory over execution speed. DEFINE_BOOL(optimize_for_size, false, "Enables optimizations which favor memory size over execution "