Commit 92c27e5e authored by Manos Koukoutos's avatar Manos Koukoutos Committed by V8 LUCI CQ

Revert "[maglev] Finish & enable basic Maglev concurrent tierups"

This reverts commit 406bcd69.

Reason for revert: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64/46797/overview

Original change's description:
> [maglev] Finish & enable basic Maglev concurrent tierups
>
> This implements the last bits of basic concurrent Maglev compilation.
> When jobs have been processed, schedule an interrupt to trigger codegen
> and building the Code object on the main thread.
>
> Bug: v8:7700
> Change-Id: I348ade4777ddddf7c3a6b0575d9f51e5fa00c9fb
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3528494
> Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> Commit-Queue: Jakob Gruber <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#79516}

Bug: v8:7700
Change-Id: I1faa092b96e56149b4db2e271680f39c7af61554
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532231
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79517}
parent 406bcd69
......@@ -10,7 +10,6 @@
#include "src/execution/isolate.h"
#include "src/execution/simulator.h"
#include "src/logging/counters.h"
#include "src/maglev/maglev-concurrent-dispatcher.h"
#include "src/objects/backing-store.h"
#include "src/roots/roots-inl.h"
#include "src/tracing/trace-event.h"
......@@ -326,14 +325,6 @@ Object StackGuard::HandleInterrupts() {
isolate_->baseline_batch_compiler()->InstallBatch();
}
#ifdef V8_ENABLE_MAGLEV
if (TestAndClear(&interrupt_flags, INSTALL_MAGLEV_CODE)) {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),
"V8.FinalizeMaglevConcurrentCompilation");
isolate_->maglev_concurrent_dispatcher()->FinalizeFinishedJobs();
}
#endif // V8_ENABLE_MAGLEV
if (TestAndClear(&interrupt_flags, API_INTERRUPT)) {
TRACE_EVENT0("v8.execute", "V8.InvokeApiInterruptCallbacks");
// Callbacks must be invoked outside of ExecutionAccess lock.
......
......@@ -54,8 +54,7 @@ class V8_EXPORT_PRIVATE V8_NODISCARD StackGuard final {
V(DEOPT_MARKED_ALLOCATION_SITES, DeoptMarkedAllocationSites, 5) \
V(GROW_SHARED_MEMORY, GrowSharedMemory, 6) \
V(LOG_WASM_CODE, LogWasmCode, 7) \
V(WASM_CODE_GC, WasmCodeGC, 8) \
V(INSTALL_MAGLEV_CODE, InstallMaglevCode, 9)
V(WASM_CODE_GC, WasmCodeGC, 8)
#define V(NAME, Name, id) \
inline bool Check##Name() { return CheckInterrupt(NAME); } \
......
......@@ -59,8 +59,9 @@ class OptimizationDecision {
public:
static constexpr OptimizationDecision Maglev() {
// TODO(v8:7700): Consider using another reason here.
// TODO(v8:7700): Support concurrency.
return {OptimizationReason::kHotAndStable, CodeKind::MAGLEV,
ConcurrencyMode::kConcurrent};
ConcurrencyMode::kNotConcurrent};
}
static constexpr OptimizationDecision TurbofanHotAndStable() {
return {OptimizationReason::kHotAndStable, CodeKind::TURBOFAN,
......
......@@ -63,6 +63,9 @@ class MaglevCompilationInfo final {
void set_graph(Graph* graph) { graph_ = graph; }
Graph* graph() const { return graph_; }
void set_codet(MaybeHandle<CodeT> codet) { codet_ = codet; }
MaybeHandle<CodeT> codet() const { return codet_; }
// Flag accessors (for thread-safe access to global flags).
// TODO(v8:7700): Consider caching these.
#define V(Name) \
......@@ -100,6 +103,9 @@ class MaglevCompilationInfo final {
// Produced off-thread during ExecuteJobImpl.
Graph* graph_ = nullptr;
// Produced during FinalizeJobImpl.
MaybeHandle<CodeT> codet_;
#define V(Name) const bool Name##_;
MAGLEV_COMPILATION_FLAG_LIST(V)
#undef V
......
......@@ -106,12 +106,9 @@ CompilationJob::Status MaglevCompilationJob::ExecuteJobImpl(
}
CompilationJob::Status MaglevCompilationJob::FinalizeJobImpl(Isolate* isolate) {
Handle<CodeT> codet;
if (!maglev::MaglevCompiler::GenerateCode(info()->toplevel_compilation_unit())
.ToHandle(&codet)) {
return CompilationJob::FAILED;
}
info()->function()->set_code(*codet);
info()->set_codet(maglev::MaglevCompiler::GenerateCode(
info()->toplevel_compilation_unit()));
// TODO(v8:7700): Actual return codes.
return CompilationJob::SUCCEEDED;
}
......@@ -135,7 +132,8 @@ class MaglevConcurrentDispatcher::JobTask final : public v8::JobTask {
CHECK_EQ(status, CompilationJob::SUCCEEDED);
outgoing_queue()->Enqueue(std::move(job));
}
isolate()->stack_guard()->RequestInstallMaglevCode();
// TODO(v8:7700):
// isolate_->stack_guard()->RequestInstallMaglevCode();
}
size_t GetMaxConcurrency(size_t) const override {
......@@ -180,7 +178,6 @@ void MaglevConcurrentDispatcher::EnqueueJob(
}
void MaglevConcurrentDispatcher::FinalizeFinishedJobs() {
HandleScope handle_scope(isolate_);
while (!outgoing_queue_.IsEmpty()) {
std::unique_ptr<MaglevCompilationJob> job;
outgoing_queue_.Dequeue(&job);
......
......@@ -21,13 +21,6 @@ namespace maglev {
class MaglevCompilationInfo;
// TODO(v8:7700): While basic infrastructure now exists, there are many TODOs
// that should still be addressed soon:
// - Full tracing support through --trace-opt.
// - Concurrent codegen.
// - Concurrent Code object creation (optional?).
// - Test support for concurrency (see %FinalizeOptimization).
// Exports needed functionality without exposing implementation details.
class ExportedMaglevCompilationInfo final {
public:
......
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