Commit a2807f2a authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm] [asm.js] Store function start position also for init function

The stack check at the beginning of each function maps to the wasm byte
offset 0. For asm.js functions, this byte offset is mapped further to an
asm.js source position. For most functions, we explicitly add an entry
to this side table for offset 0. This was missing for the start
function.

R=ahaas@chromium.org
BUG=v8:4203,chromium:703568

Change-Id: I05bc4a8cfa666864bb7a0b23f75186abe0be9bee
Reviewed-on: https://chromium-review.googlesource.com/458437
Commit-Queue: Brad Nelson <bradnelson@chromium.org>
Reviewed-by: 's avatarBrad Nelson <bradnelson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#44037}
parent 5260a4ed
......@@ -91,6 +91,8 @@ class AsmWasmBuilderImpl final : public AstVisitor<AsmWasmBuilderImpl> {
FunctionSig::Builder b(zone(), 0, 0);
init_function_ = builder_->AddFunction(b.Build());
builder_->MarkStartFunction(init_function_);
// Record start of the function, used as position for the stack check.
init_function_->SetAsmFunctionStartPosition(literal_->start_position());
}
void BuildForeignInitFunction() {
......
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --stack-size=100
function asm() {
'use asm';
return {};
}
function f() {
asm();
f();
}
assertThrows(() => f(), RangeError);
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