| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 5578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5589 // Smi-tagging is equivalent to multiplying by 2. | 5589 // Smi-tagging is equivalent to multiplying by 2. |
| 5590 STATIC_ASSERT(kSmiTag == 0); | 5590 STATIC_ASSERT(kSmiTag == 0); |
| 5591 STATIC_ASSERT(kSmiTagSize == 1); | 5591 STATIC_ASSERT(kSmiTagSize == 1); |
| 5592 | 5592 |
| 5593 // Check that both indices are smis. | 5593 // Check that both indices are smis. |
| 5594 __ mov(tmp2, index1); | 5594 __ mov(tmp2, index1); |
| 5595 __ orr(tmp2, tmp2, index2); | 5595 __ orr(tmp2, tmp2, index2); |
| 5596 __ tst(tmp2, Operand(kSmiTagMask)); | 5596 __ tst(tmp2, Operand(kSmiTagMask)); |
| 5597 deferred->Branch(nz); | 5597 deferred->Branch(nz); |
| 5598 | 5598 |
| 5599 // Check that both indices are valid. |
| 5600 __ ldr(tmp2, FieldMemOperand(object, JSArray::kLengthOffset)); |
| 5601 __ cmp(tmp2, index1); |
| 5602 __ cmp(tmp2, index2, hi); |
| 5603 deferred->Branch(ls); |
| 5604 |
| 5599 // Bring the offsets into the fixed array in tmp1 into index1 and | 5605 // Bring the offsets into the fixed array in tmp1 into index1 and |
| 5600 // index2. | 5606 // index2. |
| 5601 __ mov(tmp2, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); | 5607 __ mov(tmp2, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
| 5602 __ add(index1, tmp2, Operand(index1, LSL, kPointerSizeLog2 - kSmiTagSize)); | 5608 __ add(index1, tmp2, Operand(index1, LSL, kPointerSizeLog2 - kSmiTagSize)); |
| 5603 __ add(index2, tmp2, Operand(index2, LSL, kPointerSizeLog2 - kSmiTagSize)); | 5609 __ add(index2, tmp2, Operand(index2, LSL, kPointerSizeLog2 - kSmiTagSize)); |
| 5604 | 5610 |
| 5605 // Swap elements. | 5611 // Swap elements. |
| 5606 Register tmp3 = object; | 5612 Register tmp3 = object; |
| 5607 object = no_reg; | 5613 object = no_reg; |
| 5608 __ ldr(tmp3, MemOperand(tmp1, index1)); | 5614 __ ldr(tmp3, MemOperand(tmp1, index1)); |
| (...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6461 Load(left); | 6467 Load(left); |
| 6462 Load(right); | 6468 Load(right); |
| 6463 frame_->InvokeBuiltin(Builtins::IN, CALL_JS, 2); | 6469 frame_->InvokeBuiltin(Builtins::IN, CALL_JS, 2); |
| 6464 frame_->EmitPush(r0); | 6470 frame_->EmitPush(r0); |
| 6465 break; | 6471 break; |
| 6466 } | 6472 } |
| 6467 | 6473 |
| 6468 case Token::INSTANCEOF: { | 6474 case Token::INSTANCEOF: { |
| 6469 Load(left); | 6475 Load(left); |
| 6470 Load(right); | 6476 Load(right); |
| 6471 InstanceofStub stub; | 6477 InstanceofStub stub(InstanceofStub::kNoFlags); |
| 6472 frame_->CallStub(&stub, 2); | 6478 frame_->CallStub(&stub, 2); |
| 6473 // At this point if instanceof succeeded then r0 == 0. | 6479 // At this point if instanceof succeeded then r0 == 0. |
| 6474 __ tst(r0, Operand(r0)); | 6480 __ tst(r0, Operand(r0)); |
| 6475 cc_reg_ = eq; | 6481 cc_reg_ = eq; |
| 6476 break; | 6482 break; |
| 6477 } | 6483 } |
| 6478 | 6484 |
| 6479 default: | 6485 default: |
| 6480 UNREACHABLE(); | 6486 UNREACHABLE(); |
| 6481 } | 6487 } |
| (...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7374 specialized_on_rhs_ ? "_ConstantRhs" : "", | 7380 specialized_on_rhs_ ? "_ConstantRhs" : "", |
| 7375 BinaryOpIC::GetName(runtime_operands_type_)); | 7381 BinaryOpIC::GetName(runtime_operands_type_)); |
| 7376 return name_; | 7382 return name_; |
| 7377 } | 7383 } |
| 7378 | 7384 |
| 7379 #undef __ | 7385 #undef __ |
| 7380 | 7386 |
| 7381 } } // namespace v8::internal | 7387 } } // namespace v8::internal |
| 7382 | 7388 |
| 7383 #endif // V8_TARGET_ARCH_ARM | 7389 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |