Commit dba445c0 authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

[sparkplug] Fix --always-sparkplug in tests

Disable or support --always-sparkplug in various tests that until now
were always expecting only bytecode.

Bug: v8:11420
Change-Id: Ida45041739fb55851aa493c51f1ed796aa1c0606
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2786852Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73668}
parent a1bb0eb1
...@@ -34,11 +34,11 @@ void ExpectSharedFunctionInfoState(SharedFunctionInfo sfi, ...@@ -34,11 +34,11 @@ void ExpectSharedFunctionInfoState(SharedFunctionInfo sfi,
HeapObject script_or_debug_info = sfi.script_or_debug_info(kAcquireLoad); HeapObject script_or_debug_info = sfi.script_or_debug_info(kAcquireLoad);
switch (expectedState) { switch (expectedState) {
case SfiState::Compiled: case SfiState::Compiled:
CHECK(function_data.IsBytecodeArray()); CHECK(function_data.IsBytecodeArray() || function_data.IsBaselineData());
CHECK(script_or_debug_info.IsScript()); CHECK(script_or_debug_info.IsScript());
break; break;
case SfiState::DebugInfo: case SfiState::DebugInfo:
CHECK(function_data.IsBytecodeArray()); CHECK(function_data.IsBytecodeArray() || function_data.IsBaselineData());
CHECK(script_or_debug_info.IsDebugInfo()); CHECK(script_or_debug_info.IsDebugInfo());
{ {
DebugInfo debug_info = DebugInfo::cast(script_or_debug_info); DebugInfo debug_info = DebugInfo::cast(script_or_debug_info);
......
...@@ -1095,6 +1095,9 @@ TEST(TestBytecodeFlushing) { ...@@ -1095,6 +1095,9 @@ TEST(TestBytecodeFlushing) {
FLAG_always_opt = false; FLAG_always_opt = false;
i::FLAG_optimize_for_size = false; i::FLAG_optimize_for_size = false;
#endif // V8_LITE_MODE #endif // V8_LITE_MODE
#if ENABLE_SPARKPLUG
FLAG_always_sparkplug = false;
#endif // ENABLE_SPARKPLUG
i::FLAG_flush_bytecode = true; i::FLAG_flush_bytecode = true;
i::FLAG_allow_natives_syntax = true; i::FLAG_allow_natives_syntax = true;
...@@ -1156,6 +1159,9 @@ HEAP_TEST(Regress10560) { ...@@ -1156,6 +1159,9 @@ HEAP_TEST(Regress10560) {
// Disable flags that allocate a feedback vector eagerly. // Disable flags that allocate a feedback vector eagerly.
i::FLAG_opt = false; i::FLAG_opt = false;
i::FLAG_always_opt = false; i::FLAG_always_opt = false;
#if ENABLE_SPARKPLUG
FLAG_always_sparkplug = false;
#endif // ENABLE_SPARKPLUG
i::FLAG_lazy_feedback_allocation = true; i::FLAG_lazy_feedback_allocation = true;
ManualGCScope manual_gc_scope; ManualGCScope manual_gc_scope;
...@@ -1320,6 +1326,9 @@ TEST(Regress10774) { ...@@ -1320,6 +1326,9 @@ TEST(Regress10774) {
TEST(TestOptimizeAfterBytecodeFlushingCandidate) { TEST(TestOptimizeAfterBytecodeFlushingCandidate) {
FLAG_opt = true; FLAG_opt = true;
FLAG_always_opt = false; FLAG_always_opt = false;
#if ENABLE_SPARKPLUG
FLAG_always_sparkplug = false;
#endif // ENABLE_SPARKPLUG
i::FLAG_optimize_for_size = false; i::FLAG_optimize_for_size = false;
i::FLAG_incremental_marking = true; i::FLAG_incremental_marking = true;
i::FLAG_flush_bytecode = true; i::FLAG_flush_bytecode = true;
......
...@@ -5053,6 +5053,9 @@ TEST(InterpreterGenerators) { ...@@ -5053,6 +5053,9 @@ TEST(InterpreterGenerators) {
#ifndef V8_TARGET_ARCH_ARM #ifndef V8_TARGET_ARCH_ARM
TEST(InterpreterWithNativeStack) { TEST(InterpreterWithNativeStack) {
// "Always sparkplug" messes with this test.
if (FLAG_always_sparkplug) return;
i::FLAG_interpreted_frames_native_stack = true; i::FLAG_interpreted_frames_native_stack = true;
HandleAndZoneScope handles; HandleAndZoneScope handles;
......
...@@ -947,9 +947,10 @@ static int AllocationSitesCount(Heap* heap) { ...@@ -947,9 +947,10 @@ static int AllocationSitesCount(Heap* heap) {
TEST(DecideToPretenureDuringCompilation) { TEST(DecideToPretenureDuringCompilation) {
// The test makes use of optimization and relies on deterministic // The test makes use of optimization and relies on deterministic
// compilation. // compilation.
if (!i::FLAG_opt || i::FLAG_always_opt || i::FLAG_minor_mc || if (!i::FLAG_opt || i::FLAG_always_opt || i::FLAG_always_sparkplug ||
i::FLAG_stress_incremental_marking || i::FLAG_optimize_for_size || i::FLAG_minor_mc || i::FLAG_stress_incremental_marking ||
i::FLAG_turbo_nci || i::FLAG_stress_concurrent_allocation) { i::FLAG_optimize_for_size || i::FLAG_turbo_nci ||
i::FLAG_stress_concurrent_allocation) {
return; return;
} }
......
...@@ -4095,6 +4095,9 @@ TEST(BytecodeFlushEventsEagerLogging) { ...@@ -4095,6 +4095,9 @@ TEST(BytecodeFlushEventsEagerLogging) {
FLAG_always_opt = false; FLAG_always_opt = false;
i::FLAG_optimize_for_size = false; i::FLAG_optimize_for_size = false;
#endif // V8_LITE_MODE #endif // V8_LITE_MODE
#if ENABLE_SPARKPLUG
FLAG_always_sparkplug = false;
#endif // ENABLE_SPARKPLUG
i::FLAG_flush_bytecode = true; i::FLAG_flush_bytecode = true;
i::FLAG_allow_natives_syntax = true; i::FLAG_allow_natives_syntax = true;
......
...@@ -726,9 +726,11 @@ UNINITIALIZED_TEST(ExternalCodeEventListenerInnerFunctions) { ...@@ -726,9 +726,11 @@ UNINITIALIZED_TEST(ExternalCodeEventListenerInnerFunctions) {
v8::ScriptCompiler::CompileUnboundScript(isolate1, &source) v8::ScriptCompiler::CompileUnboundScript(isolate1, &source)
.ToLocalChecked(); .ToLocalChecked();
CHECK_EQ(code_event_handler.CountLines("Function", "f1"), CHECK_EQ(code_event_handler.CountLines("Function", "f1"),
i::FLAG_stress_background_compile ? 2 : 1); 1 + (i::FLAG_stress_background_compile ? 1 : 0) +
(i::FLAG_always_sparkplug ? 1 : 0));
CHECK_EQ(code_event_handler.CountLines("Function", "f2"), CHECK_EQ(code_event_handler.CountLines("Function", "f2"),
i::FLAG_stress_background_compile ? 2 : 1); 1 + (i::FLAG_stress_background_compile ? 1 : 0) +
(i::FLAG_always_sparkplug ? 1 : 0));
cache = v8::ScriptCompiler::CreateCodeCache(script); cache = v8::ScriptCompiler::CreateCodeCache(script);
} }
isolate1->Dispose(); isolate1->Dispose();
......
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