Commit 5847574e authored by Ross McIlroy's avatar Ross McIlroy Committed by Commit Bot

[Lite] Disable optimization for Lite mode.

BUG=v8:8293

Change-Id: I6b2e02420ab69fb1d2e24945d48b08d2bc24b0d0
Reviewed-on: https://chromium-review.googlesource.com/c/1280526
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: 's avatarDan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56795}
parent 5694ac22
......@@ -903,7 +903,6 @@ DEFINE_BOOL(trace_deopt, false, "trace optimize function deoptimization")
DEFINE_BOOL(trace_file_names, false,
"include file names in trace-opt/trace-deopt output")
DEFINE_BOOL(trace_interrupts, false, "trace interrupts when they are handled")
DEFINE_BOOL(opt, true, "use adaptive optimizations")
DEFINE_BOOL(always_opt, false, "always try to optimize functions")
DEFINE_BOOL(always_osr, false, "always try to OSR functions")
DEFINE_BOOL(prepare_always_opt, false, "prepare for turning on always opt")
......@@ -1161,6 +1160,9 @@ DEFINE_SIZE_T(mock_arraybuffer_allocator_limit, 0,
#define V8_LITE_BOOL false
#endif
// Enable recompilation of function with optimized code.
DEFINE_BOOL(opt, !V8_LITE_BOOL, "use adaptive optimizations")
// Favor memory over execution speed.
DEFINE_BOOL(optimize_for_size, V8_LITE_BOOL,
"Enables optimizations which favor memory size over execution "
......
......@@ -2963,8 +2963,10 @@ TEST(ReleaseOverReservedPages) {
if (FLAG_never_compact) return;
FLAG_trace_gc = true;
// The optimizer can allocate stuff, messing up the test.
#ifndef V8_LITE_MODE
FLAG_opt = false;
FLAG_always_opt = false;
#endif // V8_LITE_MODE
// - Parallel compaction increases fragmentation, depending on how existing
// memory is distributed. Since this is non-deterministic because of
// concurrent sweeping, we disable it for this test.
......@@ -3305,7 +3307,10 @@ UNINITIALIZED_TEST(ReleaseStackTraceData) {
// See: https://codereview.chromium.org/181833004/
return;
}
FLAG_use_ic = false; // ICs retain objects.
#ifndef V8_LITE_MODE
// ICs retain objects.
FLAG_use_ic = false;
#endif // V8_LITE_MODE
FLAG_concurrent_recompilation = false;
v8::Isolate::CreateParams create_params;
create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
......@@ -3359,7 +3364,9 @@ UNINITIALIZED_TEST(ReleaseStackTraceData) {
TEST(Regress169928) {
FLAG_allow_natives_syntax = true;
#ifndef V8_LITE_MODE
FLAG_opt = false;
#endif // V8_LITE_MODE
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
LocalContext env;
......
......@@ -23024,7 +23024,9 @@ void TestStubCache(bool primary) {
} else {
i::FLAG_test_secondary_stub_cache = true;
}
#ifndef V8_LITE_MODE
i::FLAG_opt = false;
#endif // V8_LITE_MODE
v8::Isolate::CreateParams create_params;
create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
......@@ -23964,7 +23966,9 @@ TEST(AccessCheckThrows) {
TEST(AccessCheckInIC) {
i::FLAG_native_code_counters = true;
#ifndef V8_LITE_MODE
i::FLAG_opt = false;
#endif // V8_LITE_MODE
v8::Isolate::CreateParams create_params;
create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
......@@ -26567,6 +26571,7 @@ TEST(StringConcatOverflow) {
}
TEST(TurboAsmDisablesNeuter) {
#ifndef V8_LITE_MODE
i::FLAG_opt = true;
i::FLAG_allow_natives_syntax = true;
v8::V8::Initialize();
......@@ -26603,6 +26608,7 @@ TEST(TurboAsmDisablesNeuter) {
result = CompileRun(store).As<v8::ArrayBuffer>();
CHECK(!result->IsNeuterable());
#endif // V8_LITE_MODE
}
......
......@@ -1097,7 +1097,9 @@ TEST(BoundFunctionCall) {
// This tests checks distribution of the samples through the source lines.
static void TickLines(bool optimize) {
if (!optimize) i::FLAG_opt = false;
#ifndef V8_LITE_MODE
FLAG_opt = optimize;
#endif // V8_LITE_MODE
CcTest::InitializeVM();
LocalContext env;
i::FLAG_allow_natives_syntax = true;
......
......@@ -711,6 +711,7 @@ TEST(LineNumber) {
}
TEST(BailoutReason) {
#ifndef V8_LITE_MODE
i::FLAG_allow_natives_syntax = true;
i::FLAG_always_opt = false;
i::FLAG_opt = true;
......@@ -752,6 +753,7 @@ TEST(BailoutReason) {
current = PickChild(current, "Debugger");
CHECK(const_cast<v8::CpuProfileNode*>(current));
CHECK(!strcmp("Optimization disabled for test", current->GetBailoutReason()));
#endif // V8_LITE_MODE
}
} // namespace test_profile_generator
......
......@@ -2234,10 +2234,8 @@ TEST(CodeSerializerIsolatesEager) {
TEST(CodeSerializerAfterExecute) {
// We test that no compilations happen when running this code. Forcing
// to always optimize breaks this test.
bool prev_opt_value = FLAG_opt;
bool prev_always_opt_value = FLAG_always_opt;
FLAG_always_opt = false;
FLAG_opt = false;
const char* source = "function f() { return 'abc'; }; f() + 'def'";
v8::ScriptCompiler::CachedData* cache =
CompileRunAndProduceCache(source, CodeCacheType::kAfterExecute);
......@@ -2290,7 +2288,6 @@ TEST(CodeSerializerAfterExecute) {
// Restore the flags.
FLAG_always_opt = prev_always_opt_value;
FLAG_opt = prev_opt_value;
}
TEST(CodeSerializerFlagChange) {
......
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