| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 6767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6778 | 6778 |
| 6779 __ bind(&miss); | 6779 __ bind(&miss); |
| 6780 GenerateMiss(masm); | 6780 GenerateMiss(masm); |
| 6781 } | 6781 } |
| 6782 | 6782 |
| 6783 | 6783 |
| 6784 void ICCompareStub::GenerateHeapNumbers(MacroAssembler* masm) { | 6784 void ICCompareStub::GenerateHeapNumbers(MacroAssembler* masm) { |
| 6785 ASSERT(state_ == CompareIC::HEAP_NUMBERS); | 6785 ASSERT(state_ == CompareIC::HEAP_NUMBERS); |
| 6786 | 6786 |
| 6787 Label generic_stub; | 6787 Label generic_stub; |
| 6788 Label unordered; | 6788 Label unordered, maybe_undefined1, maybe_undefined2; |
| 6789 Label miss; | 6789 Label miss; |
| 6790 __ And(a2, a1, Operand(a0)); | 6790 __ And(a2, a1, Operand(a0)); |
| 6791 __ JumpIfSmi(a2, &generic_stub); | 6791 __ JumpIfSmi(a2, &generic_stub); |
| 6792 | 6792 |
| 6793 __ GetObjectType(a0, a2, a2); | 6793 __ GetObjectType(a0, a2, a2); |
| 6794 __ Branch(&miss, ne, a2, Operand(HEAP_NUMBER_TYPE)); | 6794 __ Branch(&maybe_undefined1, ne, a2, Operand(HEAP_NUMBER_TYPE)); |
| 6795 __ GetObjectType(a1, a2, a2); | 6795 __ GetObjectType(a1, a2, a2); |
| 6796 __ Branch(&miss, ne, a2, Operand(HEAP_NUMBER_TYPE)); | 6796 __ Branch(&maybe_undefined2, ne, a2, Operand(HEAP_NUMBER_TYPE)); |
| 6797 | 6797 |
| 6798 // Inlining the double comparison and falling back to the general compare | 6798 // Inlining the double comparison and falling back to the general compare |
| 6799 // stub if NaN is involved or FPU is unsupported. | 6799 // stub if NaN is involved or FPU is unsupported. |
| 6800 if (CpuFeatures::IsSupported(FPU)) { | 6800 if (CpuFeatures::IsSupported(FPU)) { |
| 6801 CpuFeatures::Scope scope(FPU); | 6801 CpuFeatures::Scope scope(FPU); |
| 6802 | 6802 |
| 6803 // Load left and right operand. | 6803 // Load left and right operand. |
| 6804 __ Subu(a2, a1, Operand(kHeapObjectTag)); | 6804 __ Subu(a2, a1, Operand(kHeapObjectTag)); |
| 6805 __ ldc1(f0, MemOperand(a2, HeapNumber::kValueOffset)); | 6805 __ ldc1(f0, MemOperand(a2, HeapNumber::kValueOffset)); |
| 6806 __ Subu(a2, a0, Operand(kHeapObjectTag)); | 6806 __ Subu(a2, a0, Operand(kHeapObjectTag)); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 6818 __ Ret(USE_DELAY_SLOT); | 6818 __ Ret(USE_DELAY_SLOT); |
| 6819 __ li(v0, Operand(GREATER)); // In delay slot. | 6819 __ li(v0, Operand(GREATER)); // In delay slot. |
| 6820 | 6820 |
| 6821 __ bind(&fpu_eq); | 6821 __ bind(&fpu_eq); |
| 6822 __ Ret(USE_DELAY_SLOT); | 6822 __ Ret(USE_DELAY_SLOT); |
| 6823 __ li(v0, Operand(EQUAL)); // In delay slot. | 6823 __ li(v0, Operand(EQUAL)); // In delay slot. |
| 6824 | 6824 |
| 6825 __ bind(&fpu_lt); | 6825 __ bind(&fpu_lt); |
| 6826 __ Ret(USE_DELAY_SLOT); | 6826 __ Ret(USE_DELAY_SLOT); |
| 6827 __ li(v0, Operand(LESS)); // In delay slot. | 6827 __ li(v0, Operand(LESS)); // In delay slot. |
| 6828 } |
| 6828 | 6829 |
| 6829 __ bind(&unordered); | 6830 __ bind(&unordered); |
| 6830 } | |
| 6831 | 6831 |
| 6832 CompareStub stub(GetCondition(), strict(), NO_COMPARE_FLAGS, a1, a0); | 6832 CompareStub stub(GetCondition(), strict(), NO_COMPARE_FLAGS, a1, a0); |
| 6833 __ bind(&generic_stub); | 6833 __ bind(&generic_stub); |
| 6834 __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET); | 6834 __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET); |
| 6835 | 6835 |
| 6836 __ bind(&maybe_undefined1); |
| 6837 if (Token::IsOrderedRelationalCompareOp(op_)) { |
| 6838 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); |
| 6839 __ Branch(&miss, ne, a0, Operand(at)); |
| 6840 __ GetObjectType(a1, a2, a2); |
| 6841 __ Branch(&maybe_undefined2, ne, a2, Operand(HEAP_NUMBER_TYPE)); |
| 6842 __ jmp(&unordered); |
| 6843 } |
| 6844 |
| 6845 __ bind(&maybe_undefined2); |
| 6846 if (Token::IsOrderedRelationalCompareOp(op_)) { |
| 6847 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); |
| 6848 __ Branch(&unordered, eq, a1, Operand(at)); |
| 6849 } |
| 6850 |
| 6836 __ bind(&miss); | 6851 __ bind(&miss); |
| 6837 GenerateMiss(masm); | 6852 GenerateMiss(masm); |
| 6838 } | 6853 } |
| 6839 | 6854 |
| 6840 | 6855 |
| 6841 void ICCompareStub::GenerateSymbols(MacroAssembler* masm) { | 6856 void ICCompareStub::GenerateSymbols(MacroAssembler* masm) { |
| 6842 ASSERT(state_ == CompareIC::SYMBOLS); | 6857 ASSERT(state_ == CompareIC::SYMBOLS); |
| 6843 Label miss; | 6858 Label miss; |
| 6844 | 6859 |
| 6845 // Registers containing left and right operands respectively. | 6860 // Registers containing left and right operands respectively. |
| (...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7654 __ Ret(USE_DELAY_SLOT); | 7669 __ Ret(USE_DELAY_SLOT); |
| 7655 __ mov(v0, a0); | 7670 __ mov(v0, a0); |
| 7656 } | 7671 } |
| 7657 | 7672 |
| 7658 | 7673 |
| 7659 #undef __ | 7674 #undef __ |
| 7660 | 7675 |
| 7661 } } // namespace v8::internal | 7676 } } // namespace v8::internal |
| 7662 | 7677 |
| 7663 #endif // V8_TARGET_ARCH_MIPS | 7678 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |