diff --git a/BUILD.gn b/BUILD.gn index 5c1d5f1bb8..159ea937fa 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -345,10 +345,9 @@ if (v8_enable_heap_sandbox == "") { v8_enable_heap_sandbox = false } if (v8_enable_short_builtin_calls == "") { - v8_enable_short_builtin_calls = false + v8_enable_short_builtin_calls = + v8_current_cpu == "x64" || (!is_android && v8_current_cpu == "arm64") } -assert(!v8_enable_short_builtin_calls || v8_enable_pointer_compression, - "Short builtin calls feature requires pointer compression") if (v8_enable_single_generation == "") { v8_enable_single_generation = v8_disable_write_barriers } @@ -380,6 +379,10 @@ if (v8_multi_arch_build && v8_enable_pointer_compression = !v8_enable_pointer_compression v8_enable_pointer_compression_shared_cage = v8_enable_pointer_compression } +if (v8_enable_short_builtin_calls && !v8_enable_pointer_compression) { + # Disable short calls when pointer compression is not enabled. + v8_enable_short_builtin_calls = false +} if (v8_enable_shared_ro_heap == "") { v8_enable_shared_ro_heap = !v8_enable_pointer_compression } diff --git a/src/common/globals.h b/src/common/globals.h index f480038785..e6c317d2cd 100644 --- a/src/common/globals.h +++ b/src/common/globals.h @@ -106,9 +106,6 @@ STATIC_ASSERT(V8_DEFAULT_STACK_SIZE_KB* KB + // and friends. #error Short builtin calls feature requires pointer compression #endif -#define V8_SHORT_BUILTIN_CALLS_BOOL true -#else -#define V8_SHORT_BUILTIN_CALLS_BOOL false #endif // Determine whether dict mode prototypes feature is enabled. diff --git a/src/flags/flag-definitions.h b/src/flags/flag-definitions.h index d8882fbb97..eb9312834d 100644 --- a/src/flags/flag-definitions.h +++ b/src/flags/flag-definitions.h @@ -1535,10 +1535,21 @@ DEFINE_BOOL(adjust_os_scheduling_parameters, true, "adjust OS specific scheduling params for the isolate") DEFINE_BOOL(experimental_flush_embedded_blob_icache, false, "Used in an experiment to evaluate icache flushing on certain CPUs") -DEFINE_BOOL_READONLY( - short_builtin_calls, V8_SHORT_BUILTIN_CALLS_BOOL, - "Put embedded builtins code into the code range for shorter " - "builtin calls/jumps") + +// Flags for short builtin calls feature +#undef FLAG +#if V8_SHORT_BUILTIN_CALLS +#define FLAG FLAG_FULL +#else +#define FLAG FLAG_READONLY +#endif + +DEFINE_BOOL(short_builtin_calls, false, + "Put embedded builtins code into the code range for shorter " + "builtin calls/jumps") + +#undef FLAG +#define FLAG FLAG_FULL // runtime.cc DEFINE_BOOL(runtime_call_stats, false, "report runtime call counts and times")