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,
HeapObject script_or_debug_info = sfi.script_or_debug_info(kAcquireLoad);
switch (expectedState) {
case SfiState::Compiled:
CHECK(function_data.IsBytecodeArray());
CHECK(function_data.IsBytecodeArray() || function_data.IsBaselineData());
CHECK(script_or_debug_info.IsScript());
break;
case SfiState::DebugInfo:
CHECK(function_data.IsBytecodeArray());
CHECK(function_data.IsBytecodeArray() || function_data.IsBaselineData());
CHECK(script_or_debug_info.IsDebugInfo());
{
DebugInfo debug_info = DebugInfo::cast(script_or_debug_info);
......
......@@ -1095,6 +1095,9 @@ TEST(TestBytecodeFlushing) {
FLAG_always_opt = false;
i::FLAG_optimize_for_size = false;
#endif // V8_LITE_MODE
#if ENABLE_SPARKPLUG
FLAG_always_sparkplug = false;
#endif // ENABLE_SPARKPLUG
i::FLAG_flush_bytecode = true;
i::FLAG_allow_natives_syntax = true;
......@@ -1156,6 +1159,9 @@ HEAP_TEST(Regress10560) {
// Disable flags that allocate a feedback vector eagerly.
i::FLAG_opt = false;
i::FLAG_always_opt = false;
#if ENABLE_SPARKPLUG
FLAG_always_sparkplug = false;
#endif // ENABLE_SPARKPLUG
i::FLAG_lazy_feedback_allocation = true;
ManualGCScope manual_gc_scope;
......@@ -1320,6 +1326,9 @@ TEST(Regress10774) {
TEST(TestOptimizeAfterBytecodeFlushingCandidate) {
FLAG_opt = true;
FLAG_always_opt = false;
#if ENABLE_SPARKPLUG
FLAG_always_sparkplug = false;
#endif // ENABLE_SPARKPLUG
i::FLAG_optimize_for_size = false;
i::FLAG_incremental_marking = true;
i::FLAG_flush_bytecode = true;
......
......@@ -5053,6 +5053,9 @@ TEST(InterpreterGenerators) {
#ifndef V8_TARGET_ARCH_ARM
TEST(InterpreterWithNativeStack) {
// "Always sparkplug" messes with this test.
if (FLAG_always_sparkplug) return;
i::FLAG_interpreted_frames_native_stack = true;
HandleAndZoneScope handles;
......
......@@ -947,9 +947,10 @@ static int AllocationSitesCount(Heap* heap) {
TEST(DecideToPretenureDuringCompilation) {
// The test makes use of optimization and relies on deterministic
// compilation.
if (!i::FLAG_opt || i::FLAG_always_opt || i::FLAG_minor_mc ||
i::FLAG_stress_incremental_marking || i::FLAG_optimize_for_size ||
i::FLAG_turbo_nci || i::FLAG_stress_concurrent_allocation) {
if (!i::FLAG_opt || i::FLAG_always_opt || i::FLAG_always_sparkplug ||
i::FLAG_minor_mc || i::FLAG_stress_incremental_marking ||
i::FLAG_optimize_for_size || i::FLAG_turbo_nci ||
i::FLAG_stress_concurrent_allocation) {
return;
}
......
......@@ -4095,6 +4095,9 @@ TEST(BytecodeFlushEventsEagerLogging) {
FLAG_always_opt = false;
i::FLAG_optimize_for_size = false;
#endif // V8_LITE_MODE
#if ENABLE_SPARKPLUG
FLAG_always_sparkplug = false;
#endif // ENABLE_SPARKPLUG
i::FLAG_flush_bytecode = true;
i::FLAG_allow_natives_syntax = true;
......
......@@ -726,9 +726,11 @@ UNINITIALIZED_TEST(ExternalCodeEventListenerInnerFunctions) {
v8::ScriptCompiler::CompileUnboundScript(isolate1, &source)
.ToLocalChecked();
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"),
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);
}
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