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 1576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1587 __ bind(¬_fast_object); | 1587 __ bind(¬_fast_object); |
1588 __ CheckFastSmiOnlyElements(a3, t3, &call_builtin); | 1588 __ CheckFastSmiOnlyElements(a3, t3, &call_builtin); |
1589 // edx: receiver | 1589 // edx: receiver |
1590 // r3: map | 1590 // r3: map |
1591 __ LoadTransitionedArrayMapConditional(FAST_SMI_ONLY_ELEMENTS, | 1591 __ LoadTransitionedArrayMapConditional(FAST_SMI_ONLY_ELEMENTS, |
1592 FAST_ELEMENTS, | 1592 FAST_ELEMENTS, |
1593 a3, | 1593 a3, |
1594 t3, | 1594 t3, |
1595 &call_builtin); | 1595 &call_builtin); |
1596 __ mov(a2, receiver); | 1596 __ mov(a2, receiver); |
1597 ElementsTransitionGenerator::GenerateSmiOnlyToObject(masm()); | 1597 ElementsTransitionGenerator::GenerateMapChangeElementTransition(masm()); |
1598 __ bind(&fast_object); | 1598 __ bind(&fast_object); |
1599 } else { | 1599 } else { |
1600 __ CheckFastObjectElements(a3, a3, &call_builtin); | 1600 __ CheckFastObjectElements(a3, a3, &call_builtin); |
1601 } | 1601 } |
1602 | 1602 |
1603 // Save new length. | 1603 // Save new length. |
1604 __ sw(v0, FieldMemOperand(receiver, JSArray::kLengthOffset)); | 1604 __ sw(v0, FieldMemOperand(receiver, JSArray::kLengthOffset)); |
1605 | 1605 |
1606 // Store the value. | 1606 // Store the value. |
1607 // We may need a register containing the address end_elements below, | 1607 // We may need a register containing the address end_elements below, |
(...skipping 2699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4307 | 4307 |
4308 // Make sure elements is a fast element array, not 'cow'. | 4308 // Make sure elements is a fast element array, not 'cow'. |
4309 __ CheckMap(elements_reg, | 4309 __ CheckMap(elements_reg, |
4310 scratch, | 4310 scratch, |
4311 Heap::kFixedArrayMapRootIndex, | 4311 Heap::kFixedArrayMapRootIndex, |
4312 &miss_force_generic, | 4312 &miss_force_generic, |
4313 DONT_DO_SMI_CHECK); | 4313 DONT_DO_SMI_CHECK); |
4314 | 4314 |
4315 __ bind(&finish_store); | 4315 __ bind(&finish_store); |
4316 | 4316 |
4317 if (elements_kind == FAST_SMI_ONLY_ELEMENTS) { | 4317 if (IsFastSmiElementsKind(elements_kind)) { |
4318 __ Addu(scratch, | 4318 __ Addu(scratch, |
4319 elements_reg, | 4319 elements_reg, |
4320 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); | 4320 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
4321 STATIC_ASSERT(kSmiTag == 0 && kSmiTagSize < kPointerSizeLog2); | 4321 STATIC_ASSERT(kSmiTag == 0 && kSmiTagSize < kPointerSizeLog2); |
4322 __ sll(scratch2, key_reg, kPointerSizeLog2 - kSmiTagSize); | 4322 __ sll(scratch2, key_reg, kPointerSizeLog2 - kSmiTagSize); |
4323 __ Addu(scratch, scratch, scratch2); | 4323 __ Addu(scratch, scratch, scratch2); |
4324 __ sw(value_reg, MemOperand(scratch)); | 4324 __ sw(value_reg, MemOperand(scratch)); |
4325 } else { | 4325 } else { |
4326 ASSERT(elements_kind == FAST_ELEMENTS); | 4326 ASSERT(IsFastObjectElementsKind(elements_kind)); |
4327 __ Addu(scratch, | 4327 __ Addu(scratch, |
4328 elements_reg, | 4328 elements_reg, |
4329 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); | 4329 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
4330 STATIC_ASSERT(kSmiTag == 0 && kSmiTagSize < kPointerSizeLog2); | 4330 STATIC_ASSERT(kSmiTag == 0 && kSmiTagSize < kPointerSizeLog2); |
4331 __ sll(scratch2, key_reg, kPointerSizeLog2 - kSmiTagSize); | 4331 __ sll(scratch2, key_reg, kPointerSizeLog2 - kSmiTagSize); |
4332 __ Addu(scratch, scratch, scratch2); | 4332 __ Addu(scratch, scratch, scratch2); |
4333 __ sw(value_reg, MemOperand(scratch)); | 4333 __ sw(value_reg, MemOperand(scratch)); |
4334 __ mov(receiver_reg, value_reg); | 4334 __ mov(receiver_reg, value_reg); |
4335 ASSERT(elements_kind == FAST_ELEMENTS); | |
4336 __ RecordWrite(elements_reg, // Object. | 4335 __ RecordWrite(elements_reg, // Object. |
4337 scratch, // Address. | 4336 scratch, // Address. |
4338 receiver_reg, // Value. | 4337 receiver_reg, // Value. |
4339 kRAHasNotBeenSaved, | 4338 kRAHasNotBeenSaved, |
4340 kDontSaveFPRegs); | 4339 kDontSaveFPRegs); |
4341 } | 4340 } |
4342 // value_reg (a0) is preserved. | 4341 // value_reg (a0) is preserved. |
4343 // Done. | 4342 // Done. |
4344 __ Ret(); | 4343 __ Ret(); |
4345 | 4344 |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4564 __ Jump(ic_slow, RelocInfo::CODE_TARGET); | 4563 __ Jump(ic_slow, RelocInfo::CODE_TARGET); |
4565 } | 4564 } |
4566 } | 4565 } |
4567 | 4566 |
4568 | 4567 |
4569 #undef __ | 4568 #undef __ |
4570 | 4569 |
4571 } } // namespace v8::internal | 4570 } } // namespace v8::internal |
4572 | 4571 |
4573 #endif // V8_TARGET_ARCH_MIPS | 4572 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |