diff options
Diffstat (limited to 'deps/v8/src/runtime/runtime-compiler.cc')
-rw-r--r-- | deps/v8/src/runtime/runtime-compiler.cc | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/deps/v8/src/runtime/runtime-compiler.cc b/deps/v8/src/runtime/runtime-compiler.cc index 93733fe90f0..a0e7a2410ad 100644 --- a/deps/v8/src/runtime/runtime-compiler.cc +++ b/deps/v8/src/runtime/runtime-compiler.cc @@ -123,22 +123,17 @@ RUNTIME_FUNCTION(Runtime_InstantiateAsmJs) { if (args[3].IsJSArrayBuffer()) { memory = args.at<JSArrayBuffer>(3); } - if (function->shared().HasAsmWasmData()) { - Handle<SharedFunctionInfo> shared(function->shared(), isolate); + Handle<SharedFunctionInfo> shared(function->shared(), isolate); + if (shared->HasAsmWasmData()) { Handle<AsmWasmData> data(shared->asm_wasm_data(), isolate); MaybeHandle<Object> result = AsmJs::InstantiateAsmWasm( isolate, shared, data, stdlib, foreign, memory); - if (!result.is_null()) { - return *result.ToHandleChecked(); - } - } - // Remove wasm data, mark as broken for asm->wasm, replace function code with - // UncompiledData, and return a smi 0 to indicate failure. - if (function->shared().HasAsmWasmData()) { - SharedFunctionInfo::DiscardCompiled(isolate, - handle(function->shared(), isolate)); + if (!result.is_null()) return *result.ToHandleChecked(); + // Remove wasm data, mark as broken for asm->wasm, replace function code + // with UncompiledData, and return a smi 0 to indicate failure. + SharedFunctionInfo::DiscardCompiled(isolate, shared); } - function->shared().set_is_asm_wasm_broken(true); + shared->set_is_asm_wasm_broken(true); DCHECK(function->code() == isolate->builtins()->builtin(Builtins::kInstantiateAsmJs)); function->set_code(isolate->builtins()->builtin(Builtins::kCompileLazy)); @@ -176,6 +171,12 @@ RUNTIME_FUNCTION(Runtime_NotifyDeoptimized) { JavaScriptFrame* top_frame = top_it.frame(); isolate->set_context(Context::cast(top_frame->context())); + int count = optimized_code->deoptimization_count(); + if (type == DeoptimizeKind::kSoft && count < FLAG_reuse_opt_code_count) { + optimized_code->increment_deoptimization_count(); + return ReadOnlyRoots(isolate).undefined_value(); + } + // Invalidate the underlying optimized code on non-lazy deopts. if (type != DeoptimizeKind::kLazy) { Deoptimizer::DeoptimizeFunction(*function, *optimized_code); |