| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1291 // tagged as a small integer. | 1291 // tagged as a small integer. |
| 1292 __ InvokeBuiltin(native, JUMP_JS); | 1292 __ InvokeBuiltin(native, JUMP_JS); |
| 1293 } | 1293 } |
| 1294 | 1294 |
| 1295 | 1295 |
| 1296 // This stub does not handle the inlined cases (Smis, Booleans, undefined). | 1296 // This stub does not handle the inlined cases (Smis, Booleans, undefined). |
| 1297 // The stub returns zero for false, and a non-zero value for true. | 1297 // The stub returns zero for false, and a non-zero value for true. |
| 1298 void ToBooleanStub::Generate(MacroAssembler* masm) { | 1298 void ToBooleanStub::Generate(MacroAssembler* masm) { |
| 1299 Label false_result; | 1299 Label false_result; |
| 1300 Label not_heap_number; | 1300 Label not_heap_number; |
| 1301 Register scratch = r7; | 1301 Register scratch = r9.is(tos_) ? r7 : r9; |
| 1302 | 1302 |
| 1303 __ LoadRoot(ip, Heap::kNullValueRootIndex); | 1303 __ LoadRoot(ip, Heap::kNullValueRootIndex); |
| 1304 __ cmp(tos_, ip); | 1304 __ cmp(tos_, ip); |
| 1305 __ b(eq, &false_result); | 1305 __ b(eq, &false_result); |
| 1306 | 1306 |
| 1307 // HeapNumber => false iff +0, -0, or NaN. | 1307 // HeapNumber => false iff +0, -0, or NaN. |
| 1308 __ ldr(scratch, FieldMemOperand(tos_, HeapObject::kMapOffset)); | 1308 __ ldr(scratch, FieldMemOperand(tos_, HeapObject::kMapOffset)); |
| 1309 __ LoadRoot(ip, Heap::kHeapNumberMapRootIndex); | 1309 __ LoadRoot(ip, Heap::kHeapNumberMapRootIndex); |
| 1310 __ cmp(scratch, ip); | 1310 __ cmp(scratch, ip); |
| 1311 __ b(¬_heap_number, ne); | 1311 __ b(¬_heap_number, ne); |
| (...skipping 4490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5802 ASSERT(state_ == CompareIC::SMIS); | 5802 ASSERT(state_ == CompareIC::SMIS); |
| 5803 Label miss; | 5803 Label miss; |
| 5804 __ orr(r2, r1, r0); | 5804 __ orr(r2, r1, r0); |
| 5805 __ tst(r2, Operand(kSmiTagMask)); | 5805 __ tst(r2, Operand(kSmiTagMask)); |
| 5806 __ b(ne, &miss); | 5806 __ b(ne, &miss); |
| 5807 | 5807 |
| 5808 if (GetCondition() == eq) { | 5808 if (GetCondition() == eq) { |
| 5809 // For equality we do not care about the sign of the result. | 5809 // For equality we do not care about the sign of the result. |
| 5810 __ sub(r0, r0, r1, SetCC); | 5810 __ sub(r0, r0, r1, SetCC); |
| 5811 } else { | 5811 } else { |
| 5812 __ sub(r1, r1, r0, SetCC); | 5812 // Untag before subtracting to avoid handling overflow. |
| 5813 // Correct sign of result in case of overflow. | 5813 __ SmiUntag(r1); |
| 5814 __ rsb(r1, r1, Operand(0), SetCC, vs); | 5814 __ sub(r0, r1, SmiUntagOperand(r0)); |
| 5815 __ mov(r0, r1); | |
| 5816 } | 5815 } |
| 5817 __ Ret(); | 5816 __ Ret(); |
| 5818 | 5817 |
| 5819 __ bind(&miss); | 5818 __ bind(&miss); |
| 5820 GenerateMiss(masm); | 5819 GenerateMiss(masm); |
| 5821 } | 5820 } |
| 5822 | 5821 |
| 5823 | 5822 |
| 5824 void ICCompareStub::GenerateHeapNumbers(MacroAssembler* masm) { | 5823 void ICCompareStub::GenerateHeapNumbers(MacroAssembler* masm) { |
| 5825 ASSERT(state_ == CompareIC::HEAP_NUMBERS); | 5824 ASSERT(state_ == CompareIC::HEAP_NUMBERS); |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5996 __ SmiTag(r0, scratch1); | 5995 __ SmiTag(r0, scratch1); |
| 5997 __ Ret(); | 5996 __ Ret(); |
| 5998 } | 5997 } |
| 5999 | 5998 |
| 6000 | 5999 |
| 6001 #undef __ | 6000 #undef __ |
| 6002 | 6001 |
| 6003 } } // namespace v8::internal | 6002 } } // namespace v8::internal |
| 6004 | 6003 |
| 6005 #endif // V8_TARGET_ARCH_ARM | 6004 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |