1cec66d31b
When initializing the stack state at a merge point, don't force all stack slots into registers. Allow constants to stay constants as long as they are not part of the merge. Otherwise we might break assumptions of outer blocks which then try to merge a register into a constant and fail. Also, add some documentation to {InitMergeStackSlot} to document the intent of the implementation. R=titzer@chromium.org Bug: v8:784050, v8:6600 Change-Id: I3a4c83b446909027be075d3207cb7c748a6b1aad Reviewed-on: https://chromium-review.googlesource.com/766353 Reviewed-by: Ben Titzer <titzer@chromium.org> Commit-Queue: Clemens Hammacher <clemensh@chromium.org> Cr-Commit-Position: refs/heads/master@{#49423}
26 lines
920 B
JavaScript
26 lines
920 B
JavaScript
// 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.
|
|
|
|
load('test/mjsunit/wasm/wasm-constants.js');
|
|
load('test/mjsunit/wasm/wasm-module-builder.js');
|
|
|
|
var builder = new WasmModuleBuilder();
|
|
builder.addFunction('test', kSig_v_v)
|
|
.addBodyWithEnd([
|
|
kExprI32Const, 0x0, // const 0
|
|
kExprI32Const, 0x0, // const 0
|
|
kExprBrIf, 0x00, // br depth=0
|
|
kExprLoop, 0x7f, // loop i32
|
|
kExprBlock, 0x7f, // block i32
|
|
kExprI32Const, 0x0, // const 0
|
|
kExprBr, 0x00, // br depth=0
|
|
kExprEnd, // end
|
|
kExprBr, 0x00, // br depth=0
|
|
kExprEnd, // end
|
|
kExprUnreachable, // unreachable
|
|
kExprEnd, // end
|
|
])
|
|
.exportFunc();
|
|
builder.instantiate();
|