Commit b5fe1b4b authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[asm.js] Re-enable lazy validation for asm.js modules.

The modules generated by translation from asm.js to WebAssembly are
valid by construction, an eager sequential validation is not required.
This behavior has been the default and recently broke by a refactoring,
hence this just re-enables the path in question.

R=ahaas@chromium.org
BUG=chromium:969368

Change-Id: I29811a7f278aed0f34c09483394a60b4b865ab6b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1664335Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62248}
parent 6f7ebd03
...@@ -860,7 +860,7 @@ bool CompileLazy(Isolate* isolate, NativeModule* native_module, ...@@ -860,7 +860,7 @@ bool CompileLazy(Isolate* isolate, NativeModule* native_module,
// During lazy compilation, we can only get compilation errors when // During lazy compilation, we can only get compilation errors when
// {--wasm-lazy-validation} is enabled. Otherwise, the module was fully // {--wasm-lazy-validation} is enabled. Otherwise, the module was fully
// verified before starting its execution. // verified before starting its execution.
DCHECK_IMPLIES(result.failed(), FLAG_wasm_lazy_validation); CHECK_IMPLIES(result.failed(), FLAG_wasm_lazy_validation);
const WasmFunction* func = &module->functions[func_index]; const WasmFunction* func = &module->functions[func_index];
if (result.failed()) { if (result.failed()) {
ErrorThrower thrower(isolate, nullptr); ErrorThrower thrower(isolate, nullptr);
...@@ -1129,9 +1129,12 @@ void CompileNativeModule(Isolate* isolate, ErrorThrower* thrower, ...@@ -1129,9 +1129,12 @@ void CompileNativeModule(Isolate* isolate, ErrorThrower* thrower,
NativeModule* native_module) { NativeModule* native_module) {
ModuleWireBytes wire_bytes(native_module->wire_bytes()); ModuleWireBytes wire_bytes(native_module->wire_bytes());
const bool lazy_module = IsLazyModule(wasm_module); const bool lazy_module = IsLazyModule(wasm_module);
if (!FLAG_wasm_lazy_validation && if (!FLAG_wasm_lazy_validation && wasm_module->origin == kWasmOrigin &&
MayCompriseLazyFunctions(wasm_module, native_module->enabled_features(), MayCompriseLazyFunctions(wasm_module, native_module->enabled_features(),
lazy_module)) { lazy_module)) {
// Validate wasm modules for lazy compilation if requested. Never validate
// asm.js modules as these are valid by construction (additionally a CHECK
// will catch this during lazy compilation).
ValidateSequentially(wasm_module, native_module, isolate->counters(), ValidateSequentially(wasm_module, native_module, isolate->counters(),
isolate->allocator(), thrower, lazy_module, isolate->allocator(), thrower, lazy_module,
kOnlyLazyFunctions); kOnlyLazyFunctions);
......
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