Commit 6565eb09 authored by Andreas Haas's avatar Andreas Haas Committed by Commit Bot

[wasm] Increase cost of return-call in the interpreter

The wasm interpreter is slow on an arm simulator build with asan when
it comes to return calls. An infinite return-call recursion therefore
caused a timeout on ClusterFuzz. With this CL we increase the costs of
return calls, and thereby avoid the timeout.

R=clemensb@chromium.org

Bug: chromium:1124899
Change-Id: If88e060779fbe2569e289e60170cf487dd31d7db
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2397615Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69740}
parent 64b59264
...@@ -3268,6 +3268,9 @@ class WasmInterpreterInternals { ...@@ -3268,6 +3268,9 @@ class WasmInterpreterInternals {
} break; } break;
case kExprReturnCall: { case kExprReturnCall: {
// Make return calls more expensive, so that return call recursions
// don't cause a timeout.
if (max > 0) max = std::max(0, max - 100);
CallFunctionImmediate<Decoder::kNoValidate> imm(&decoder, CallFunctionImmediate<Decoder::kNoValidate> imm(&decoder,
code->at(pc + 1)); code->at(pc + 1));
InterpreterCode* target = codemap_.GetCode(imm.index); InterpreterCode* target = codemap_.GetCode(imm.index);
...@@ -3280,6 +3283,9 @@ class WasmInterpreterInternals { ...@@ -3280,6 +3283,9 @@ class WasmInterpreterInternals {
} break; } break;
case kExprReturnCallIndirect: { case kExprReturnCallIndirect: {
// Make return calls more expensive, so that return call recursions
// don't cause a timeout.
if (max > 0) max = std::max(0, max - 100);
CallIndirectImmediate<Decoder::kNoValidate> imm( CallIndirectImmediate<Decoder::kNoValidate> imm(
WasmFeatures::All(), &decoder, code->at(pc + 1)); WasmFeatures::All(), &decoder, code->at(pc + 1));
uint32_t entry_index = Pop().to<uint32_t>(); uint32_t entry_index = Pop().to<uint32_t>();
......
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