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

BUG=v8:2648

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14371 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 07a2a9cd
...@@ -2611,13 +2611,15 @@ void BinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) { ...@@ -2611,13 +2611,15 @@ void BinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) {
__ add(scratch2, scratch1, Operand(0x40000000), SetCC); __ add(scratch2, scratch1, Operand(0x40000000), SetCC);
// If not try to return a heap number. // If not try to return a heap number.
__ b(mi, &return_heap_number); __ b(mi, &return_heap_number);
// 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;
__ cmp(scratch1, Operand::Zero()); __ cmp(scratch1, Operand::Zero());
__ b(ne, &not_zero); __ b(ne, &not_zero);
__ vmov(scratch2, d5.high()); __ vmov(scratch2, d5.high());
__ tst(scratch2, Operand(HeapNumber::kSignMask)); __ tst(scratch2, Operand(HeapNumber::kSignMask));
__ b(ne, &return_heap_number); __ b(ne, result_type_ <= BinaryOpIC::INT32 ? &transition
: &return_heap_number);
__ bind(&not_zero); __ bind(&not_zero);
// Tag the result and return. // Tag the result and return.
...@@ -2630,8 +2632,6 @@ void BinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) { ...@@ -2630,8 +2632,6 @@ 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
: BinaryOpIC::INT32)) {
// We are using vfp registers so r5 is available. // We are using vfp registers so r5 is available.
heap_number_result = r5; heap_number_result = r5;
BinaryOpStub_GenerateHeapResultAllocation(masm, BinaryOpStub_GenerateHeapResultAllocation(masm,
...@@ -2645,7 +2645,6 @@ void BinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) { ...@@ -2645,7 +2645,6 @@ void BinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) {
__ vstr(d5, r0, HeapNumber::kValueOffset); __ vstr(d5, r0, HeapNumber::kValueOffset);
__ mov(r0, heap_number_result); __ mov(r0, heap_number_result);
__ Ret(); __ 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