Commit 2ab83cf1 authored by ishell@chromium.org's avatar ishell@chromium.org

HAllocate should never generate allocation code if the requested size does not...

HAllocate should never generate allocation code if the requested size does not fit into page. Regression test included.

BUG=347543
LOG=N
R=hpayer@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19591 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent d9a66ad9
......@@ -1486,7 +1486,11 @@ void LCodeGen::DoAllocate(LAllocate* instr) {
if (instr->size()->IsConstantOperand()) {
int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
__ Allocate(size, result, temp1, temp2, deferred->entry(), flags);
if (size <= Page::kMaxRegularHeapObjectSize) {
__ Allocate(size, result, temp1, temp2, deferred->entry(), flags);
} else {
__ B(deferred->entry());
}
} else {
Register size = ToRegister32(instr->size());
__ Sxtw(size.X(), size);
......
......@@ -5252,7 +5252,11 @@ void LCodeGen::DoAllocate(LAllocate* instr) {
if (instr->size()->IsConstantOperand()) {
int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
__ Allocate(size, result, scratch, scratch2, deferred->entry(), flags);
if (size <= Page::kMaxRegularHeapObjectSize) {
__ Allocate(size, result, scratch, scratch2, deferred->entry(), flags);
} else {
__ jmp(deferred->entry());
}
} else {
Register size = ToRegister(instr->size());
__ Allocate(size,
......
......@@ -5784,7 +5784,11 @@ void LCodeGen::DoAllocate(LAllocate* instr) {
if (instr->size()->IsConstantOperand()) {
int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
__ Allocate(size, result, temp, no_reg, deferred->entry(), flags);
if (size <= Page::kMaxRegularHeapObjectSize) {
__ Allocate(size, result, temp, no_reg, deferred->entry(), flags);
} else {
__ jmp(deferred->entry());
}
} else {
Register size = ToRegister(instr->size());
__ Allocate(size, result, temp, no_reg, deferred->entry(), flags);
......
......@@ -5208,7 +5208,11 @@ void LCodeGen::DoAllocate(LAllocate* instr) {
}
if (instr->size()->IsConstantOperand()) {
int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
__ Allocate(size, result, scratch, scratch2, deferred->entry(), flags);
if (size <= Page::kMaxRegularHeapObjectSize) {
__ Allocate(size, result, scratch, scratch2, deferred->entry(), flags);
} else {
__ jmp(deferred->entry());
}
} else {
Register size = ToRegister(instr->size());
__ Allocate(size,
......
......@@ -5084,7 +5084,11 @@ void LCodeGen::DoAllocate(LAllocate* instr) {
if (instr->size()->IsConstantOperand()) {
int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
__ Allocate(size, result, temp, no_reg, deferred->entry(), flags);
if (size <= Page::kMaxRegularHeapObjectSize) {
__ Allocate(size, result, temp, no_reg, deferred->entry(), flags);
} else {
__ jmp(deferred->entry());
}
} else {
Register size = ToRegister(instr->size());
__ Allocate(size, result, temp, no_reg, deferred->entry(), flags);
......
// 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.
// Flags: --allow-natives-syntax --debug-code --fold-constants
function f(a) {
a[5000000] = 256;
assertEquals(256, a[5000000]);
}
var v1 = new Array(5000001);
var v2 = new Array(10);
f(v1);
f(v2);
f(v2);
%OptimizeFunctionOnNextCall(f);
f(v2);
f(v1);
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