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
parent b9886ae9
......@@ -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);
......
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
// 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());
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