[wasm-hints] Unify Lazy Validation
Treat lazy functions the same no matter whether they are lazy due to compilation hints or flags ({--wasm-lazy-compilation}, {--asm-wasm-lazy-compilation}). Test coverage is given by regression tests 956771 and 956771b. Bug: v8:9003 Change-Id: I123f83636f055fb142cd71f6cde88480f3c141bd Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1585846 Commit-Queue: Frederik Gossen <frgossen@google.com> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by: Clemens Hammacher <clemensh@chromium.org> Cr-Commit-Position: refs/heads/master@{#61116}
This commit is contained in:
parent
da6ebfafad
commit
0ffd860e03
@ -992,23 +992,7 @@ void CompileNativeModule(Isolate* isolate, ErrorThrower* thrower,
|
||||
const WasmModule* wasm_module,
|
||||
NativeModule* native_module) {
|
||||
ModuleWireBytes wire_bytes(native_module->wire_bytes());
|
||||
auto* compilation_state = Impl(native_module->compilation_state());
|
||||
const bool lazy_module = IsLazyModule(wasm_module);
|
||||
if (lazy_module) {
|
||||
if (wasm_module->origin == kWasmOrigin && !FLAG_wasm_lazy_validation) {
|
||||
// Validate wasm modules for lazy compilation if requested. Never validate
|
||||
// asm.js modules as these are valid by construction (otherwise a CHECK
|
||||
// will fail during lazy compilation).
|
||||
ValidateSequentially(wasm_module, native_module, isolate->counters(),
|
||||
isolate->allocator(), thrower, lazy_module);
|
||||
// On error: Return and leave the module in an unexecutable state.
|
||||
if (thrower->error()) return;
|
||||
}
|
||||
compilation_state->InitializeCompilationProgress(lazy_module);
|
||||
native_module->UseLazyStubs();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!FLAG_wasm_lazy_validation &&
|
||||
MayCompriseLazyFunctions(wasm_module, native_module->enabled_features(),
|
||||
lazy_module)) {
|
||||
@ -1029,6 +1013,7 @@ void CompileNativeModule(Isolate* isolate, ErrorThrower* thrower,
|
||||
// compilation failed.
|
||||
auto baseline_finished_semaphore = std::make_shared<base::Semaphore>(0);
|
||||
// The callback captures a shared ptr to the semaphore.
|
||||
auto* compilation_state = Impl(native_module->compilation_state());
|
||||
compilation_state->AddCallback(
|
||||
[baseline_finished_semaphore](CompilationEvent event) {
|
||||
if (event == CompilationEvent::kFinishedBaselineCompilation ||
|
||||
|
Loading…
Reference in New Issue
Block a user