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

[Liftoff] Fix DCHECK error

Fix fixes a minor DCHECK error, which fired because usually only
LiftoffRegisters of the same type should be compared against each
other. In the RegisterReuseMap we store both register pairs and single
registers, hence check for pair vs non-pair comparisons explicitly.

R=ahaas@chromium.org

Bug: v8:6600, chromium:922670
Change-Id: I18beb61b6b1906cc42bcf6e7dfdd5eb803e874d7
Reviewed-on: https://chromium-review.googlesource.com/c/1421921Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58956}
parent 1f1bd71d
......@@ -348,7 +348,7 @@ class RegisterReuseMap {
base::Optional<LiftoffRegister> Lookup(LiftoffRegister src) {
for (auto it = map_.begin(), end = map_.end(); it != end; it += 2) {
if (*it == src) return *(it + 1);
if (it->is_pair() == src.is_pair() && *it == src) return *(it + 1);
}
return {};
}
......
// Copyright 2019 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');
const builder = new WasmModuleBuilder();
const sig = builder.addType(makeSig([kWasmI32], []));
builder.addFunction(undefined, sig)
.addLocals({i64_count: 1})
.addBody([
kExprLoop, kWasmI32,
kExprGetLocal, 1,
kExprI64Const, 1,
kExprLoop, kWasmI32,
kExprGetLocal, 0,
kExprI32Const, 1,
kExprI32Const, 1,
kExprIf, kWasmI32,
kExprI32Const, 1,
kExprElse,
kExprUnreachable,
kExprEnd,
kExprSelect,
kExprUnreachable,
kExprEnd,
kExprUnreachable,
kExprEnd,
kExprUnreachable
]);
builder.instantiate();
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