Fix has_constant_parameter_count() confusion in LReturn

BUG=chromium:431602
LOG=y
R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#25249}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25249 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
jkummerow@chromium.org 2014-11-10 15:24:58 +00:00
parent b9886ae9ff
commit d3b68cf370
9 changed files with 35 additions and 0 deletions

View File

@ -2964,6 +2964,7 @@ void LCodeGen::DoReturn(LReturn* instr) {
__ add(sp, sp, Operand(sp_delta));
}
} else {
DCHECK(info()->IsStub()); // Functions would need to drop one more value.
Register reg = ToRegister(instr->parameter_count());
// The argument count parameter is a smi
__ SmiUntag(reg);

View File

@ -4766,6 +4766,7 @@ void LCodeGen::DoReturn(LReturn* instr) {
int parameter_count = ToInteger32(instr->constant_parameter_count());
__ Drop(parameter_count + 1);
} else {
DCHECK(info()->IsStub()); // Functions would need to drop one more value.
Register parameter_count = ToRegister(instr->parameter_count());
__ DropBySMI(parameter_count);
}

View File

@ -2834,6 +2834,10 @@ void HConstant::Initialize(Representation r) {
// could cause heap object checks not to get emitted.
object_ = Unique<Object>(Handle<Object>::null());
}
if (r.IsSmiOrInteger32()) {
// If it's not a heap object, it can't be in new space.
bit_field_ = IsNotInNewSpaceField::update(bit_field_, true);
}
set_representation(r);
SetFlag(kUseGVN);
}

View File

@ -2753,6 +2753,7 @@ void LCodeGen::EmitReturn(LReturn* instr, bool dynamic_frame_alignment) {
}
__ Ret((parameter_count + extra_value_count) * kPointerSize, ecx);
} else {
DCHECK(info()->IsStub()); // Functions would need to drop one more value.
Register reg = ToRegister(instr->parameter_count());
// The argument count parameter is a smi
__ SmiUntag(reg);
@ -2770,6 +2771,7 @@ void LCodeGen::EmitReturn(LReturn* instr, bool dynamic_frame_alignment) {
if (dynamic_frame_alignment) {
__ inc(reg); // 1 more for alignment
}
__ shl(reg, kPointerSizeLog2);
__ add(esp, reg);
__ jmp(return_addr_reg);

View File

@ -2858,6 +2858,7 @@ void LCodeGen::DoReturn(LReturn* instr) {
__ Addu(sp, sp, Operand(sp_delta));
}
} else {
DCHECK(info()->IsStub()); // Functions would need to drop one more value.
Register reg = ToRegister(instr->parameter_count());
// The argument count parameter is a smi
__ SmiUntag(reg);

View File

@ -2828,6 +2828,7 @@ void LCodeGen::DoReturn(LReturn* instr) {
__ Daddu(sp, sp, Operand(sp_delta));
}
} else {
DCHECK(info()->IsStub()); // Functions would need to drop one more value.
Register reg = ToRegister(instr->parameter_count());
// The argument count parameter is a smi
__ SmiUntag(reg);

View File

@ -2822,6 +2822,7 @@ void LCodeGen::DoReturn(LReturn* instr) {
__ Ret((ToInteger32(instr->constant_parameter_count()) + 1) * kPointerSize,
rcx);
} else {
DCHECK(info()->IsStub()); // Functions would need to drop one more value.
Register reg = ToRegister(instr->parameter_count());
// The argument count parameter is a smi
__ SmiToInteger32(reg, reg);

View File

@ -3050,6 +3050,7 @@ void LCodeGen::EmitReturn(LReturn* instr, bool dynamic_frame_alignment) {
}
__ Ret((parameter_count + extra_value_count) * kPointerSize, ecx);
} else {
DCHECK(info()->IsStub()); // Functions would need to drop one more value.
Register reg = ToRegister(instr->parameter_count());
// The argument count parameter is a smi
__ SmiUntag(reg);

View File

@ -0,0 +1,23 @@
// 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: --always-opt
var heap_number_producer = {y:1.5};
heap_number_producer.y = 0;
var heap_number_zero = heap_number_producer.y;
var non_constant_eight = {};
non_constant_eight = 8;
function BreakIt() {
return heap_number_zero | (1 | non_constant_eight);
}
function expose(a, b, c) {
return b;
}
assertEquals(9, expose(8, 9, 10));
assertEquals(9, expose(8, BreakIt(), 10));
assertEquals(9, BreakIt());