Commit c2fbc08b authored by palfia@homejinni.com's avatar palfia@homejinni.com

MIPS: ARM: Fix erroneous detection of Double result type in Integer32 BinaryOpStubs

Port r14371 (b5c4a990)

BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14384 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 5d7e335a
...@@ -2511,12 +2511,17 @@ void BinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) { ...@@ -2511,12 +2511,17 @@ void BinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) {
__ Addu(scratch2, scratch1, Operand(0x40000000)); __ Addu(scratch2, scratch1, Operand(0x40000000));
// If not try to return a heap number. // If not try to return a heap number.
__ Branch(&return_heap_number, lt, scratch2, Operand(zero_reg)); __ Branch(&return_heap_number, lt, scratch2, Operand(zero_reg));
// Check for minus zero. Return heap number for minus zero. // Check for minus zero. Return heap number for minus zero if
// double results are allowed; otherwise transition.
Label not_zero; Label not_zero;
__ Branch(&not_zero, ne, scratch1, Operand(zero_reg)); __ Branch(&not_zero, ne, scratch1, Operand(zero_reg));
__ mfc1(scratch2, f11); __ mfc1(scratch2, f11);
__ And(scratch2, scratch2, HeapNumber::kSignMask); __ And(scratch2, scratch2, HeapNumber::kSignMask);
__ Branch(&return_heap_number, ne, scratch2, Operand(zero_reg)); __ Branch(result_type_ <= BinaryOpIC::INT32 ? &transition
: &return_heap_number,
ne,
scratch2,
Operand(zero_reg));
__ bind(&not_zero); __ bind(&not_zero);
// Tag the result and return. // Tag the result and return.
...@@ -2529,21 +2534,18 @@ void BinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) { ...@@ -2529,21 +2534,18 @@ void BinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) {
__ bind(&return_heap_number); __ bind(&return_heap_number);
// Return a heap number, or fall through to type transition or runtime // Return a heap number, or fall through to type transition or runtime
// call if we can't. // call if we can't.
if (result_type_ >= ((op_ == Token::DIV) ? BinaryOpIC::NUMBER // We are using FPU registers so s0 is available.
: BinaryOpIC::INT32)) { heap_number_result = s0;
// We are using FPU registers so s0 is available. BinaryOpStub_GenerateHeapResultAllocation(masm,
heap_number_result = s0; heap_number_result,
BinaryOpStub_GenerateHeapResultAllocation(masm, heap_number_map,
heap_number_result, scratch1,
heap_number_map, scratch2,
scratch1, &call_runtime,
scratch2, mode_);
&call_runtime, __ mov(v0, heap_number_result);
mode_); __ sdc1(f10, FieldMemOperand(v0, HeapNumber::kValueOffset));
__ mov(v0, heap_number_result); __ Ret();
__ sdc1(f10, FieldMemOperand(v0, HeapNumber::kValueOffset));
__ Ret();
}
// A DIV operation expecting an integer result falls through // A DIV operation expecting an integer result falls through
// to type transition. // to type transition.
......
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