| 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 6776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6787 // Check the object's elements are in fast case and writable. | 6787 // Check the object's elements are in fast case and writable. |
| 6788 __ movq(tmp1.reg(), FieldOperand(object.reg(), JSObject::kElementsOffset)); | 6788 __ movq(tmp1.reg(), FieldOperand(object.reg(), JSObject::kElementsOffset)); |
| 6789 __ CompareRoot(FieldOperand(tmp1.reg(), HeapObject::kMapOffset), | 6789 __ CompareRoot(FieldOperand(tmp1.reg(), HeapObject::kMapOffset), |
| 6790 Heap::kFixedArrayMapRootIndex); | 6790 Heap::kFixedArrayMapRootIndex); |
| 6791 deferred->Branch(not_equal); | 6791 deferred->Branch(not_equal); |
| 6792 | 6792 |
| 6793 // Check that both indices are smis. | 6793 // Check that both indices are smis. |
| 6794 Condition both_smi = masm()->CheckBothSmi(index1.reg(), index2.reg()); | 6794 Condition both_smi = masm()->CheckBothSmi(index1.reg(), index2.reg()); |
| 6795 deferred->Branch(NegateCondition(both_smi)); | 6795 deferred->Branch(NegateCondition(both_smi)); |
| 6796 | 6796 |
| 6797 // Check that both indices are valid. |
| 6798 __ movq(tmp2.reg(), FieldOperand(object.reg(), JSArray::kLengthOffset)); |
| 6799 __ SmiCompare(tmp2.reg(), index1.reg()); |
| 6800 deferred->Branch(below_equal); |
| 6801 __ SmiCompare(tmp2.reg(), index2.reg()); |
| 6802 deferred->Branch(below_equal); |
| 6803 |
| 6797 // Bring addresses into index1 and index2. | 6804 // Bring addresses into index1 and index2. |
| 6798 __ SmiToInteger32(index1.reg(), index1.reg()); | 6805 __ SmiToInteger32(index1.reg(), index1.reg()); |
| 6799 __ lea(index1.reg(), FieldOperand(tmp1.reg(), | 6806 __ lea(index1.reg(), FieldOperand(tmp1.reg(), |
| 6800 index1.reg(), | 6807 index1.reg(), |
| 6801 times_pointer_size, | 6808 times_pointer_size, |
| 6802 FixedArray::kHeaderSize)); | 6809 FixedArray::kHeaderSize)); |
| 6803 __ SmiToInteger32(index2.reg(), index2.reg()); | 6810 __ SmiToInteger32(index2.reg(), index2.reg()); |
| 6804 __ lea(index2.reg(), FieldOperand(tmp1.reg(), | 6811 __ lea(index2.reg(), FieldOperand(tmp1.reg(), |
| 6805 index2.reg(), | 6812 index2.reg(), |
| 6806 times_pointer_size, | 6813 times_pointer_size, |
| (...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7874 case Token::IN: { | 7881 case Token::IN: { |
| 7875 Load(left); | 7882 Load(left); |
| 7876 Load(right); | 7883 Load(right); |
| 7877 Result answer = frame_->InvokeBuiltin(Builtins::IN, CALL_FUNCTION, 2); | 7884 Result answer = frame_->InvokeBuiltin(Builtins::IN, CALL_FUNCTION, 2); |
| 7878 frame_->Push(&answer); // push the result | 7885 frame_->Push(&answer); // push the result |
| 7879 return; | 7886 return; |
| 7880 } | 7887 } |
| 7881 case Token::INSTANCEOF: { | 7888 case Token::INSTANCEOF: { |
| 7882 Load(left); | 7889 Load(left); |
| 7883 Load(right); | 7890 Load(right); |
| 7884 InstanceofStub stub; | 7891 InstanceofStub stub(InstanceofStub::kNoFlags); |
| 7885 Result answer = frame_->CallStub(&stub, 2); | 7892 Result answer = frame_->CallStub(&stub, 2); |
| 7886 answer.ToRegister(); | 7893 answer.ToRegister(); |
| 7887 __ testq(answer.reg(), answer.reg()); | 7894 __ testq(answer.reg(), answer.reg()); |
| 7888 answer.Unuse(); | 7895 answer.Unuse(); |
| 7889 destination()->Split(zero); | 7896 destination()->Split(zero); |
| 7890 return; | 7897 return; |
| 7891 } | 7898 } |
| 7892 default: | 7899 default: |
| 7893 UNREACHABLE(); | 7900 UNREACHABLE(); |
| 7894 } | 7901 } |
| (...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8833 void RecordWriteStub::Generate(MacroAssembler* masm) { | 8840 void RecordWriteStub::Generate(MacroAssembler* masm) { |
| 8834 #ifdef ENABLE_CARDMARKING_WRITE_BARRIER | 8841 #ifdef ENABLE_CARDMARKING_WRITE_BARRIER |
| 8835 masm->RecordWriteHelper(object_, addr_, scratch_); | 8842 masm->RecordWriteHelper(object_, addr_, scratch_); |
| 8836 #endif | 8843 #endif |
| 8837 masm->ret(0); | 8844 masm->ret(0); |
| 8838 } | 8845 } |
| 8839 | 8846 |
| 8840 } } // namespace v8::internal | 8847 } } // namespace v8::internal |
| 8841 | 8848 |
| 8842 #endif // V8_TARGET_ARCH_X64 | 8849 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |