Commit c73fa4fc authored by Ross McIlroy's avatar Ross McIlroy Committed by Commit Bot

[Build] Add support for V8 Lite mode.

Adds a build-time flag to control enabling of V8 Lite mode. Currently
this mode enables optimize-for-size and makes that flag read-only so that
it can't be changed at runtime.

This mode also replaces the --minimal flag which was previously used
to make porting easier.

BUG=v8:8293

Change-Id: I8360b4d55dd15a2a7c18429c94329dc5264dea86
Reviewed-on: https://chromium-review.googlesource.com/c/1276467
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: 's avatarDan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56653}
parent 2dd15af7
......@@ -32,6 +32,11 @@ declare_args() {
# Sets -DV8_ENABLE_FUTURE.
v8_enable_future = false
# Lite mode disables a number of performance optimizations to reduce memory
# at the cost of performance.
# Sets --DV8_LITE_MODE.
v8_enable_lite_mode = false
# Sets -DVERIFY_HEAP.
v8_enable_verify_heap = ""
......@@ -314,6 +319,9 @@ config("features") {
if (v8_enable_future) {
defines += [ "V8_ENABLE_FUTURE" ]
}
if (v8_enable_lite_mode) {
defines += [ "V8_LITE_MODE" ]
}
if (v8_enable_gdbjit) {
defines += [ "ENABLE_GDB_JIT_INTERFACE" ]
}
......
......@@ -434,7 +434,6 @@ TF_STUB(StoreFastElementStub, CodeStubAssembler) {
// static
void StoreFastElementStub::GenerateAheadOfTime(Isolate* isolate) {
if (FLAG_minimal) return;
StoreFastElementStub(isolate, false, HOLEY_ELEMENTS, STANDARD_STORE)
.GetCode();
StoreFastElementStub(isolate, false, HOLEY_ELEMENTS,
......
......@@ -321,17 +321,11 @@ DEFINE_BOOL(feedback_normalization, false,
DEFINE_BOOL_READONLY(internalize_on_the_fly, true,
"internalize string keys for generic keyed ICs on the fly")
// Flags for optimization types.
DEFINE_BOOL(optimize_for_size, false,
"Enables optimizations which favor memory size over execution "
"speed")
// Flag for one shot optimiztions.
DEFINE_BOOL(enable_one_shot_optimization, true,
"Enable size optimizations for the code that will "
"only be executed once")
DEFINE_VALUE_IMPLICATION(optimize_for_size, max_semi_space_size, 1)
// Flags for data representation optimizations
DEFINE_BOOL(unbox_double_arrays, true, "automatically unbox arrays of doubles")
......@@ -537,13 +531,6 @@ DEFINE_BOOL(untrusted_code_mitigations, V8_DEFAULT_UNTRUSTED_CODE_MITIGATIONS,
"Enable mitigations for executing untrusted code")
#undef V8_DEFAULT_UNTRUSTED_CODE_MITIGATIONS
// Flags to help platform porters
DEFINE_BOOL(minimal, false,
"simplifies execution model to make porting "
"easier (e.g. always use Ignition, never optimize)")
DEFINE_NEG_IMPLICATION(minimal, opt)
DEFINE_NEG_IMPLICATION(minimal, use_ic)
// Flags for native WebAssembly.
DEFINE_BOOL(expose_wasm, true, "expose wasm interface to JavaScript")
DEFINE_BOOL(assume_asmjs_origin, false,
......@@ -1162,6 +1149,24 @@ DEFINE_SIZE_T(mock_arraybuffer_allocator_limit, 0,
"Memory limit for mock ArrayBuffer allocator used to simulate "
"OOM for testing.")
//
// Flags only available in non-Lite modes.
//
#undef FLAG
#ifdef V8_LITE_MODE
#define FLAG FLAG_READONLY
#define V8_LITE_BOOL true
#else
#define FLAG FLAG_FULL
#define V8_LITE_BOOL false
#endif
// Favor memory over execution speed.
DEFINE_BOOL(optimize_for_size, V8_LITE_BOOL,
"Enables optimizations which favor memory size over execution "
"speed")
DEFINE_VALUE_IMPLICATION(optimize_for_size, max_semi_space_size, 1)
//
// GDB JIT integration flags.
//
......
......@@ -15,6 +15,9 @@ namespace v8 {
namespace internal {
namespace heap {
// Tests don't work when --optimize-for-size is set.
#ifndef V8_LITE_MODE
namespace {
v8::Isolate* NewIsolateForPagePromotion(int min_semi_space_size = 8,
......@@ -241,6 +244,8 @@ UNINITIALIZED_HEAP_TEST(Regress658718) {
isolate->Dispose();
}
#endif // V8_LITE_MODE
} // namespace heap
} // namespace internal
} // namespace v8
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment