Commit efc8cb16 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[turbofan] Fix accumulator use in bytecode analysis.

This fixes the checks of accumulator usage flags in the computation of
the interpreter register liveness during bytecode analysis. The usage
flags at hand are bit patterns as opposed to flat enum values. Use the
safe accessors instead of plain comparison.

R=jarin@chromium.org
TEST=mjsunit/regress/regress-crbug-683581
BUG=chromium:683581

Review-Url: https://codereview.chromium.org/2651653005
Cr-Commit-Position: refs/heads/master@{#42648}
parent d0a24e91
......@@ -98,9 +98,8 @@ void UpdateInLiveness(Bytecode bytecode, BytecodeLivenessState& in_liveness,
const BytecodeArrayAccessor& accessor) {
int num_operands = Bytecodes::NumberOfOperands(bytecode);
const OperandType* operand_types = Bytecodes::GetOperandTypes(bytecode);
AccumulatorUse accumulator_use = Bytecodes::GetAccumulatorUse(bytecode);
if (accumulator_use == AccumulatorUse::kWrite) {
if (Bytecodes::WritesAccumulator(bytecode)) {
in_liveness.MarkAccumulatorDead();
}
for (int i = 0; i < num_operands; ++i) {
......@@ -138,7 +137,7 @@ void UpdateInLiveness(Bytecode bytecode, BytecodeLivenessState& in_liveness,
}
}
if (accumulator_use == AccumulatorUse::kRead) {
if (Bytecodes::ReadsAccumulator(bytecode)) {
in_liveness.MarkAccumulatorLive();
}
for (int i = 0; i < num_operands; ++i) {
......
// 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.
var v = 0;
function foo() {
for (var i = 0; i < 70000; i++) {
v += i;
}
eval();
}
foo()
assertEquals(2449965000, v);
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