Commit 5b981d35 authored by Zhi An Ng's avatar Zhi An Ng Committed by Commit Bot

Revert "Reland "[wasm] Perform NativeModule tier down in parallel.""

This reverts commit faccc95b.

Reason for revert: Causing some failures, e.g. https://ci.chromium.org/p/v8/builders/ci/V8%20Linux%20-%20verify%20csa/15741 and https://ci.chromium.org/p/v8/builders/ci/V8%20Linux64/35635 and https://ci.chromium.org/p/v8/builders/ci/V8%20Mac64/32736

Original change's description:
> Reland "[wasm] Perform NativeModule tier down in parallel."
> 
> This is a reland of 3352fcc9
> 
> Disable stress-opt for test and check recompilation before clearing
> callbacks.
> 
> Original change's description:
> > [wasm] Perform NativeModule tier down in parallel.
> >
> > Reuse logic in {CompileNativeModule} function in module-compiler.cc:
> > initialize parallel compile jobs, then wait for them to finish while
> > taking part in this compilation.
> >
> > Bug: v8:9654
> > Change-Id: I9974d9f8b516e9faec716a592c7c0ee9c7077d8e
> > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1977041
> > Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
> > Reviewed-by: Clemens Backes <clemensb@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#65763}
> 
> Bug: v8:9654
> Change-Id: I8e8830f05e189596207365b7332a2cc25e493e47
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2002945
> Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
> Reviewed-by: Clemens Backes <clemensb@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#65901}

TBR=clemensb@chromium.org,duongn@microsoft.com

Change-Id: I99f5a5455a022d0cbff3da54610cedfe6380a094
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:9654
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2012985Reviewed-by: 's avatarZhi An Ng <zhin@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65903}
parent 49ca64b8
......@@ -92,8 +92,7 @@ class WireBytesStorage {
enum class CompilationEvent : uint8_t {
kFinishedBaselineCompilation,
kFinishedTopTierCompilation,
kFailedCompilation,
kFinishedRecompilation
kFailedCompilation
};
// The implementation of {CompilationState} lives in module-compiler.cc.
......@@ -118,7 +117,6 @@ class CompilationState {
bool failed() const;
V8_EXPORT_PRIVATE bool baseline_compilation_finished() const;
V8_EXPORT_PRIVATE bool top_tier_compilation_finished() const;
V8_EXPORT_PRIVATE bool recompilation_finished() const;
// Override {operator delete} to avoid implicit instantiation of {operator
// delete} with {size_t} argument. The {size_t} argument would be incorrect.
......
This diff is collapsed.
......@@ -44,9 +44,6 @@ std::shared_ptr<NativeModule> CompileToNativeModule(
std::shared_ptr<const WasmModule> module, const ModuleWireBytes& wire_bytes,
Handle<FixedArray>* export_wrappers_out);
void RecompileNativeModule(Isolate* isolate, NativeModule* native_module,
ExecutionTier tier);
V8_EXPORT_PRIVATE
void CompileJsToWasmWrappers(Isolate* isolate, const WasmModule* module,
Handle<FixedArray>* export_wrappers_out);
......
......@@ -1818,8 +1818,13 @@ void NativeModule::TierDown(Isolate* isolate) {
tier_down_ = true;
}
// Tier down all functions.
isolate->wasm_engine()->RecompileAllFunctions(isolate, this,
ExecutionTier::kLiftoff);
// TODO(duongn): parallelize this eventually.
for (uint32_t index = module_->num_imported_functions;
index < num_functions(); index++) {
isolate->wasm_engine()->CompileFunction(isolate, this, index,
ExecutionTier::kLiftoff);
DCHECK(!compilation_state()->failed());
}
}
void NativeModule::TierUp(Isolate* isolate) {
......
......@@ -488,12 +488,6 @@ void WasmEngine::CompileFunction(Isolate* isolate, NativeModule* native_module,
&native_module->module()->functions[function_index], tier);
}
void WasmEngine::RecompileAllFunctions(Isolate* isolate,
NativeModule* native_module,
ExecutionTier tier) {
RecompileNativeModule(isolate, native_module, tier);
}
std::shared_ptr<NativeModule> WasmEngine::ExportNativeModule(
Handle<WasmModuleObject> module_object) {
return module_object->shared_native_module();
......
......@@ -148,10 +148,6 @@ class V8_EXPORT_PRIVATE WasmEngine {
void CompileFunction(Isolate* isolate, NativeModule* native_module,
uint32_t function_index, ExecutionTier tier);
// Recompiles all functions at a specific compilation tier.
void RecompileAllFunctions(Isolate* isolate, NativeModule* native_module,
ExecutionTier tier);
// Exports the sharable parts of the given module object so that they can be
// transferred to a different Context/Isolate using the same engine.
std::shared_ptr<NativeModule> ExportNativeModule(
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --allow-natives-syntax --liftoff --wasm-tier-up --no-stress-opt
// Flags: --allow-natives-syntax --wasm-tier-up
load('test/mjsunit/wasm/wasm-module-builder.js');
......@@ -41,6 +41,7 @@ function check(instance) {
check(instance);
})();
async function testTierDownToLiftoffAsync() {
print(arguments.callee.name);
const instance = await create_builder().asyncInstantiate();
......
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