Commit 48a6766e authored by Benedikt Meurer's avatar Benedikt Meurer

[x86] Disable invalid checked load/store optimization.

TEST=mjsunit/compiler/regress-lena
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/784153006

Cr-Commit-Position: refs/heads/master@{#25722}
parent 93f35310
......@@ -454,29 +454,6 @@ void InstructionSelector::VisitCheckedLoad(Node* node) {
UNREACHABLE();
return;
}
if (offset->opcode() == IrOpcode::kInt32Add && CanCover(node, offset)) {
Int32Matcher mlength(length);
Int32BinopMatcher moffset(offset);
if (mlength.HasValue() && moffset.right().HasValue() &&
mlength.Value() > moffset.right().Value()) {
Int32Matcher mbuffer(buffer);
InstructionOperand* offset_operand = g.UseRegister(moffset.left().node());
InstructionOperand* length_operand =
g.TempImmediate(mlength.Value() - moffset.right().Value());
if (mbuffer.HasValue()) {
Emit(opcode | AddressingModeField::encode(kMode_MRI),
g.DefineAsRegister(node), offset_operand, length_operand,
offset_operand,
g.TempImmediate(mbuffer.Value() + moffset.right().Value()));
} else {
Emit(opcode | AddressingModeField::encode(kMode_MR1I),
g.DefineAsRegister(node), offset_operand, length_operand,
g.UseRegister(buffer), offset_operand,
g.UseImmediate(moffset.right().node()));
}
return;
}
}
InstructionOperand* offset_operand = g.UseRegister(offset);
InstructionOperand* length_operand =
g.CanBeImmediate(length) ? g.UseImmediate(length) : g.UseRegister(length);
......@@ -525,28 +502,6 @@ void InstructionSelector::VisitCheckedStore(Node* node) {
? g.UseImmediate(value)
: ((rep == kRepWord8 || rep == kRepBit) ? g.UseByteRegister(value)
: g.UseRegister(value));
if (offset->opcode() == IrOpcode::kInt32Add && CanCover(node, offset)) {
Int32Matcher mbuffer(buffer);
Int32Matcher mlength(length);
Int32BinopMatcher moffset(offset);
if (mlength.HasValue() && moffset.right().HasValue() &&
mlength.Value() > moffset.right().Value()) {
InstructionOperand* offset_operand = g.UseRegister(moffset.left().node());
InstructionOperand* length_operand =
g.TempImmediate(mlength.Value() - moffset.right().Value());
if (mbuffer.HasValue()) {
Emit(opcode | AddressingModeField::encode(kMode_MRI), nullptr,
offset_operand, length_operand, value_operand, offset_operand,
g.TempImmediate(mbuffer.Value() + moffset.right().Value()));
} else {
Emit(opcode | AddressingModeField::encode(kMode_MR1I), nullptr,
offset_operand, length_operand, value_operand,
g.UseRegister(buffer), offset_operand,
g.UseImmediate(moffset.right().node()));
}
return;
}
}
InstructionOperand* offset_operand = g.UseRegister(offset);
InstructionOperand* length_operand =
g.CanBeImmediate(length) ? g.UseImmediate(length) : g.UseRegister(length);
......
......@@ -230,21 +230,6 @@ void InstructionSelector::VisitCheckedLoad(Node* node) {
UNREACHABLE();
return;
}
if (offset->opcode() == IrOpcode::kInt32Add && CanCover(node, offset)) {
Int32Matcher mlength(length);
Int32BinopMatcher moffset(offset);
if (mlength.HasValue() && moffset.right().HasValue() &&
mlength.Value() > moffset.right().Value()) {
InstructionOperand* offset_operand = g.UseRegister(moffset.left().node());
InstructionOperand* length_operand =
g.TempImmediate(mlength.Value() - moffset.right().Value());
Emit(opcode | AddressingModeField::encode(kMode_MR1I),
g.DefineAsRegister(node), offset_operand, length_operand,
g.UseRegister(buffer), offset_operand,
g.UseImmediate(moffset.right().node()));
return;
}
}
InstructionOperand* offset_operand = g.UseRegister(offset);
InstructionOperand* length_operand =
g.CanBeImmediate(length) ? g.UseImmediate(length) : g.UseRegister(length);
......@@ -284,20 +269,6 @@ void InstructionSelector::VisitCheckedStore(Node* node) {
}
InstructionOperand* value_operand =
g.CanBeImmediate(value) ? g.UseImmediate(value) : g.UseRegister(value);
if (offset->opcode() == IrOpcode::kInt32Add && CanCover(node, offset)) {
Int32Matcher mlength(length);
Int32BinopMatcher moffset(offset);
if (mlength.HasValue() && moffset.right().HasValue() &&
mlength.Value() > moffset.right().Value()) {
InstructionOperand* offset_operand = g.UseRegister(moffset.left().node());
InstructionOperand* length_operand =
g.TempImmediate(mlength.Value() - moffset.right().Value());
Emit(opcode | AddressingModeField::encode(kMode_MR1I), nullptr,
offset_operand, length_operand, value_operand, g.UseRegister(buffer),
offset_operand, g.UseImmediate(moffset.right().node()));
return;
}
}
InstructionOperand* offset_operand = g.UseRegister(offset);
InstructionOperand* length_operand =
g.CanBeImmediate(length) ? g.UseImmediate(length) : g.UseRegister(length);
......
// Copyright 2014 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.
function module(stdlib, foreign, heap) {
"use asm";
var MEM32 = new stdlib.Int32Array(heap);
function foo(i) {
i = i|0;
MEM32[0] = i;
return MEM32[i + 4 >> 2]|0;
}
return { foo: foo };
}
var foo = module(this, {}, new ArrayBuffer(64*1024)).foo;
assertEquals(-4, foo(-4));
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