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 1600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1611 const int kEndElementsOffset = | 1611 const int kEndElementsOffset = |
1612 FixedArray::kHeaderSize - kHeapObjectTag - argc * kPointerSize; | 1612 FixedArray::kHeaderSize - kHeapObjectTag - argc * kPointerSize; |
1613 __ str(r4, MemOperand(end_elements, kEndElementsOffset, PreIndex)); | 1613 __ str(r4, MemOperand(end_elements, kEndElementsOffset, PreIndex)); |
1614 | 1614 |
1615 // Check for a smi. | 1615 // Check for a smi. |
1616 __ Drop(argc + 1); | 1616 __ Drop(argc + 1); |
1617 __ Ret(); | 1617 __ Ret(); |
1618 | 1618 |
1619 __ bind(&with_write_barrier); | 1619 __ bind(&with_write_barrier); |
1620 | 1620 |
1621 if (FLAG_smi_only_arrays) { | 1621 __ ldr(r6, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
1622 __ ldr(r6, FieldMemOperand(receiver, HeapObject::kMapOffset)); | 1622 __ CheckFastSmiOnlyElements(r6, r6, &call_builtin); |
1623 __ CheckFastSmiOnlyElements(r6, r6, &call_builtin); | |
1624 } | |
1625 | 1623 |
1626 // Save new length. | 1624 // Save new length. |
1627 __ str(r0, FieldMemOperand(receiver, JSArray::kLengthOffset)); | 1625 __ str(r0, FieldMemOperand(receiver, JSArray::kLengthOffset)); |
1628 | 1626 |
1629 // Push the element. | 1627 // Push the element. |
1630 // We may need a register containing the address end_elements below, | 1628 // We may need a register containing the address end_elements below, |
1631 // so write back the value in end_elements. | 1629 // so write back the value in end_elements. |
1632 __ add(end_elements, elements, | 1630 __ add(end_elements, elements, |
1633 Operand(r0, LSL, kPointerSizeLog2 - kSmiTagSize)); | 1631 Operand(r0, LSL, kPointerSizeLog2 - kSmiTagSize)); |
1634 __ str(r4, MemOperand(end_elements, kEndElementsOffset, PreIndex)); | 1632 __ str(r4, MemOperand(end_elements, kEndElementsOffset, PreIndex)); |
(...skipping 10 matching lines...) Expand all Loading... |
1645 | 1643 |
1646 __ bind(&attempt_to_grow_elements); | 1644 __ bind(&attempt_to_grow_elements); |
1647 // r0: array's length + 1. | 1645 // r0: array's length + 1. |
1648 // r4: elements' length. | 1646 // r4: elements' length. |
1649 | 1647 |
1650 if (!FLAG_inline_new) { | 1648 if (!FLAG_inline_new) { |
1651 __ b(&call_builtin); | 1649 __ b(&call_builtin); |
1652 } | 1650 } |
1653 | 1651 |
1654 __ ldr(r2, MemOperand(sp, (argc - 1) * kPointerSize)); | 1652 __ ldr(r2, MemOperand(sp, (argc - 1) * kPointerSize)); |
1655 if (FLAG_smi_only_arrays) { | 1653 // Growing elements that are SMI-only requires special handling in case |
1656 // Growing elements that are SMI-only requires special handling in case | 1654 // the new element is non-Smi. For now, delegate to the builtin. |
1657 // the new element is non-Smi. For now, delegate to the builtin. | 1655 Label no_fast_elements_check; |
1658 Label no_fast_elements_check; | 1656 __ JumpIfSmi(r2, &no_fast_elements_check); |
1659 __ JumpIfSmi(r2, &no_fast_elements_check); | 1657 __ ldr(r7, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
1660 __ ldr(r7, FieldMemOperand(receiver, HeapObject::kMapOffset)); | 1658 __ CheckFastObjectElements(r7, r7, &call_builtin); |
1661 __ CheckFastObjectElements(r7, r7, &call_builtin); | 1659 __ bind(&no_fast_elements_check); |
1662 __ bind(&no_fast_elements_check); | |
1663 } | |
1664 | 1660 |
1665 Isolate* isolate = masm()->isolate(); | 1661 Isolate* isolate = masm()->isolate(); |
1666 ExternalReference new_space_allocation_top = | 1662 ExternalReference new_space_allocation_top = |
1667 ExternalReference::new_space_allocation_top_address(isolate); | 1663 ExternalReference::new_space_allocation_top_address(isolate); |
1668 ExternalReference new_space_allocation_limit = | 1664 ExternalReference new_space_allocation_limit = |
1669 ExternalReference::new_space_allocation_limit_address(isolate); | 1665 ExternalReference::new_space_allocation_limit_address(isolate); |
1670 | 1666 |
1671 const int kAllocationDelta = 4; | 1667 const int kAllocationDelta = 4; |
1672 // Load top and check if it is the end of elements. | 1668 // Load top and check if it is the end of elements. |
1673 __ add(end_elements, elements, | 1669 __ add(end_elements, elements, |
(...skipping 2773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4447 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); | 4443 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); |
4448 __ Jump(ic, RelocInfo::CODE_TARGET); | 4444 __ Jump(ic, RelocInfo::CODE_TARGET); |
4449 } | 4445 } |
4450 | 4446 |
4451 | 4447 |
4452 #undef __ | 4448 #undef __ |
4453 | 4449 |
4454 } } // namespace v8::internal | 4450 } } // namespace v8::internal |
4455 | 4451 |
4456 #endif // V8_TARGET_ARCH_ARM | 4452 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |