Commit 3dd19524 authored by Milad Fa's avatar Milad Fa Committed by V8 LUCI CQ

[sparkplug] Fix Batch compilation on unsupported platforms

Few of the changes added under https://crrev.com/c/2891656
do not compile if sparkplug is not implement on a platform.

Bug: v8:11790, v8:11421
Change-Id: Iec40e89ab56a6923b30a5567e4a49e4f1763eece
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2933656Reviewed-by: 's avatarPatrick Thier <pthier@chromium.org>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#74921}
parent c6cdb078
......@@ -4,6 +4,11 @@
#include "src/baseline/baseline-batch-compiler.h"
// TODO(v8:11421): Remove #if once baseline compiler is ported to other
// architectures.
#if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_ARM64 || \
V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_RISCV64
#include "src/baseline/baseline-compiler.h"
#include "src/codegen/compiler.h"
#include "src/execution/isolate.h"
......@@ -119,3 +124,29 @@ void BaselineBatchCompiler::ClearBatch() {
} // namespace baseline
} // namespace internal
} // namespace v8
#else
namespace v8 {
namespace internal {
namespace baseline {
BaselineBatchCompiler::BaselineBatchCompiler(Isolate* isolate)
: isolate_(isolate),
compilation_queue_(Handle<WeakFixedArray>::null()),
last_index_(0),
estimated_instruction_size_(0),
enabled_(false) {}
BaselineBatchCompiler::~BaselineBatchCompiler() {
if (!compilation_queue_.is_null()) {
GlobalHandles::Destroy(compilation_queue_.location());
compilation_queue_ = Handle<WeakFixedArray>::null();
}
}
} // namespace baseline
} // namespace internal
} // namespace v8
#endif
......@@ -68,6 +68,11 @@ void EmitReturnBaseline(MacroAssembler* masm) {
namespace v8 {
namespace internal {
bool CanCompileWithBaseline(Isolate* isolate,
Handle<SharedFunctionInfo> shared) {
return false;
}
MaybeHandle<Code> GenerateBaselineCode(Isolate* isolate,
Handle<SharedFunctionInfo> shared) {
UNREACHABLE();
......
......@@ -13878,7 +13878,9 @@ UNINITIALIZED_TEST(SetJitCodeEventHandler) {
i::FLAG_incremental_marking = false;
i::FLAG_stress_concurrent_allocation = false; // For SimulateFullSpace.
// Batch compilation can cause different owning spaces for foo and bar.
#if ENABLE_SPARKPLUG
i::FLAG_baseline_batch_compilation = false;
#endif
if (i::FLAG_never_compact) return;
const char* script =
"function bar() {"
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