| 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 6895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6906 // Check the object's elements are in fast case and writable. | 6906 // Check the object's elements are in fast case and writable. |
| 6907 __ movq(tmp1.reg(), FieldOperand(object.reg(), JSObject::kElementsOffset)); | 6907 __ movq(tmp1.reg(), FieldOperand(object.reg(), JSObject::kElementsOffset)); |
| 6908 __ CompareRoot(FieldOperand(tmp1.reg(), HeapObject::kMapOffset), | 6908 __ CompareRoot(FieldOperand(tmp1.reg(), HeapObject::kMapOffset), |
| 6909 Heap::kFixedArrayMapRootIndex); | 6909 Heap::kFixedArrayMapRootIndex); |
| 6910 deferred->Branch(not_equal); | 6910 deferred->Branch(not_equal); |
| 6911 | 6911 |
| 6912 // Check that both indices are smis. | 6912 // Check that both indices are smis. |
| 6913 Condition both_smi = masm()->CheckBothSmi(index1.reg(), index2.reg()); | 6913 Condition both_smi = masm()->CheckBothSmi(index1.reg(), index2.reg()); |
| 6914 deferred->Branch(NegateCondition(both_smi)); | 6914 deferred->Branch(NegateCondition(both_smi)); |
| 6915 | 6915 |
| 6916 // Check that both indices are valid. |
| 6917 __ movq(tmp2.reg(), FieldOperand(object.reg(), JSArray::kLengthOffset)); |
| 6918 __ cmpl(tmp2.reg(), index1.reg()); |
| 6919 deferred->Branch(below_equal); |
| 6920 __ cmpl(tmp2.reg(), index2.reg()); |
| 6921 deferred->Branch(below_equal); |
| 6922 |
| 6916 // Bring addresses into index1 and index2. | 6923 // Bring addresses into index1 and index2. |
| 6917 __ SmiToInteger32(index1.reg(), index1.reg()); | 6924 __ SmiToInteger32(index1.reg(), index1.reg()); |
| 6918 __ lea(index1.reg(), FieldOperand(tmp1.reg(), | 6925 __ lea(index1.reg(), FieldOperand(tmp1.reg(), |
| 6919 index1.reg(), | 6926 index1.reg(), |
| 6920 times_pointer_size, | 6927 times_pointer_size, |
| 6921 FixedArray::kHeaderSize)); | 6928 FixedArray::kHeaderSize)); |
| 6922 __ SmiToInteger32(index2.reg(), index2.reg()); | 6929 __ SmiToInteger32(index2.reg(), index2.reg()); |
| 6923 __ lea(index2.reg(), FieldOperand(tmp1.reg(), | 6930 __ lea(index2.reg(), FieldOperand(tmp1.reg(), |
| 6924 index2.reg(), | 6931 index2.reg(), |
| 6925 times_pointer_size, | 6932 times_pointer_size, |
| (...skipping 1997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8923 #undef __ | 8930 #undef __ |
| 8924 | 8931 |
| 8925 void RecordWriteStub::Generate(MacroAssembler* masm) { | 8932 void RecordWriteStub::Generate(MacroAssembler* masm) { |
| 8926 masm->RecordWriteHelper(object_, addr_, scratch_); | 8933 masm->RecordWriteHelper(object_, addr_, scratch_); |
| 8927 masm->ret(0); | 8934 masm->ret(0); |
| 8928 } | 8935 } |
| 8929 | 8936 |
| 8930 } } // namespace v8::internal | 8937 } } // namespace v8::internal |
| 8931 | 8938 |
| 8932 #endif // V8_TARGET_ARCH_X64 | 8939 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |