Commit ce1fe78d authored by mvstanton's avatar mvstanton Committed by Commit bot

Bugfix: assert in lithium compile for LMaybeGrowElements

BUG=chromium:585041
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#35331}
parent 4c2b0454
......@@ -4192,7 +4192,15 @@ void LCodeGen::DoDeferredMaybeGrowElements(LMaybeGrowElements* instr) {
LOperand* key = instr->key();
if (key->IsConstantOperand()) {
__ Move(r3, Operand(ToSmi(LConstantOperand::cast(key))));
LConstantOperand* constant_key = LConstantOperand::cast(key);
int32_t int_key = ToInteger32(constant_key);
if (Smi::IsValid(int_key)) {
__ mov(r3, Operand(Smi::FromInt(int_key)));
} else {
// We should never get here at runtime because there is a smi check on
// the key before this point.
__ stop("expected smi");
}
} else {
__ Move(r3, ToRegister(key));
__ SmiTag(r3);
......
......@@ -3974,7 +3974,15 @@ void LCodeGen::DoDeferredMaybeGrowElements(LMaybeGrowElements* instr) {
LOperand* key = instr->key();
if (key->IsConstantOperand()) {
__ mov(ebx, ToImmediate(key, Representation::Smi()));
LConstantOperand* constant_key = LConstantOperand::cast(key);
int32_t int_key = ToInteger32(constant_key);
if (Smi::IsValid(int_key)) {
__ mov(ebx, Immediate(Smi::FromInt(int_key)));
} else {
// We should never get here at runtime because there is a smi check on
// the key before this point.
__ int3();
}
} else {
__ Move(ebx, ToRegister(key));
__ SmiTag(ebx);
......
......@@ -4158,7 +4158,15 @@ void LCodeGen::DoDeferredMaybeGrowElements(LMaybeGrowElements* instr) {
LOperand* key = instr->key();
if (key->IsConstantOperand()) {
__ li(a3, Operand(ToSmi(LConstantOperand::cast(key))));
LConstantOperand* constant_key = LConstantOperand::cast(key);
int32_t int_key = ToInteger32(constant_key);
if (Smi::IsValid(int_key)) {
__ li(a3, Operand(Smi::FromInt(int_key)));
} else {
// We should never get here at runtime because there is a smi check on
// the key before this point.
__ stop("expected smi");
}
} else {
__ mov(a3, ToRegister(key));
__ SmiTag(a3);
......
......@@ -4390,7 +4390,15 @@ void LCodeGen::DoDeferredMaybeGrowElements(LMaybeGrowElements* instr) {
LOperand* key = instr->key();
if (key->IsConstantOperand()) {
__ li(a3, Operand(ToSmi(LConstantOperand::cast(key))));
LConstantOperand* constant_key = LConstantOperand::cast(key);
int32_t int_key = ToInteger32(constant_key);
if (Smi::IsValid(int_key)) {
__ li(a3, Operand(Smi::FromInt(int_key)));
} else {
// We should never get here at runtime because there is a smi check on
// the key before this point.
__ stop("expected smi");
}
} else {
__ mov(a3, ToRegister(key));
__ SmiTag(a3);
......
// Copyright 2016 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: --allow-natives-syntax
function f(arr, i) {
arr[i] = 50;
}
function boom(dummy) {
var arr = new Array(10);
f(arr, 10);
if (dummy) {
f(arr, -2147483648);
}
}
boom(false);
%OptimizeFunctionOnNextCall(boom);
boom(false);
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