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 1560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1571 CompileTimeValue::IsCompileTimeValue(subexpr)) { | 1571 CompileTimeValue::IsCompileTimeValue(subexpr)) { |
1572 continue; | 1572 continue; |
1573 } | 1573 } |
1574 | 1574 |
1575 if (!result_saved) { | 1575 if (!result_saved) { |
1576 __ push(r0); | 1576 __ push(r0); |
1577 result_saved = true; | 1577 result_saved = true; |
1578 } | 1578 } |
1579 VisitForAccumulatorValue(subexpr); | 1579 VisitForAccumulatorValue(subexpr); |
1580 | 1580 |
1581 __ ldr(r6, MemOperand(sp)); // Copy of array literal. | 1581 __ ldr(r1, MemOperand(sp)); // Copy of array literal. |
1582 __ ldr(r1, FieldMemOperand(r6, JSObject::kElementsOffset)); | 1582 __ ldr(r2, FieldMemOperand(r1, JSObject::kMapOffset)); |
1583 __ ldr(r2, FieldMemOperand(r6, JSObject::kMapOffset)); | |
1584 int offset = FixedArray::kHeaderSize + (i * kPointerSize); | |
1585 | |
1586 Label element_done; | |
1587 Label double_elements; | |
1588 Label smi_element; | |
1589 Label slow_elements; | |
1590 Label fast_elements; | |
1591 __ CheckFastElements(r2, r3, &double_elements); | |
1592 | |
1593 // FAST_SMI_ONLY_ELEMENTS or FAST_ELEMENTS | |
1594 __ JumpIfSmi(result_register(), &smi_element); | |
1595 __ CheckFastSmiOnlyElements(r2, r3, &fast_elements); | |
1596 | |
1597 // Store into the array literal requires a elements transition. Call into | |
1598 // the runtime. | |
1599 __ bind(&slow_elements); | |
1600 __ push(r6); // Copy of array literal. | |
1601 __ mov(r1, Operand(Smi::FromInt(i))); | |
1602 __ mov(r2, Operand(Smi::FromInt(NONE))); // PropertyAttributes | |
1603 __ mov(r3, Operand(Smi::FromInt(strict_mode_flag()))); // Strict mode. | |
1604 __ Push(r1, result_register(), r2, r3); | |
1605 __ CallRuntime(Runtime::kSetProperty, 5); | |
1606 __ b(&element_done); | |
1607 | |
1608 // Array literal has ElementsKind of FAST_DOUBLE_ELEMENTS. | |
1609 __ bind(&double_elements); | |
1610 __ mov(r3, Operand(Smi::FromInt(i))); | 1583 __ mov(r3, Operand(Smi::FromInt(i))); |
1611 __ StoreNumberToDoubleElements(result_register(), r3, r6, r1, r4, r5, r9, | 1584 __ mov(r4, Operand(Smi::FromInt(expr->literal_index()))); |
1612 r7, &slow_elements); | 1585 StoreArrayLiteralElementStub stub; |
1613 __ b(&element_done); | 1586 __ CallStub(&stub); |
1614 | |
1615 // Array literal has ElementsKind of FAST_ELEMENTS and value is an object. | |
1616 __ bind(&fast_elements); | |
1617 __ str(result_register(), FieldMemOperand(r1, offset)); | |
1618 // Update the write barrier for the array store. | |
1619 __ RecordWriteField( | |
1620 r1, offset, result_register(), r2, kLRHasBeenSaved, kDontSaveFPRegs, | |
1621 EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); | |
1622 __ b(&element_done); | |
1623 | |
1624 // Array literal has ElementsKind of FAST_SMI_ONLY_ELEMENTS or | |
1625 // FAST_ELEMENTS, and value is Smi. | |
1626 __ bind(&smi_element); | |
1627 __ str(result_register(), FieldMemOperand(r1, offset)); | |
1628 // Fall through | |
1629 | |
1630 __ bind(&element_done); | |
1631 | 1587 |
1632 PrepareForBailoutForId(expr->GetIdForElement(i), NO_REGISTERS); | 1588 PrepareForBailoutForId(expr->GetIdForElement(i), NO_REGISTERS); |
1633 } | 1589 } |
1634 | 1590 |
1635 if (result_saved) { | 1591 if (result_saved) { |
1636 context()->PlugTOS(); | 1592 context()->PlugTOS(); |
1637 } else { | 1593 } else { |
1638 context()->Plug(r0); | 1594 context()->Plug(r0); |
1639 } | 1595 } |
1640 } | 1596 } |
(...skipping 2754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4395 *context_length = 0; | 4351 *context_length = 0; |
4396 return previous_; | 4352 return previous_; |
4397 } | 4353 } |
4398 | 4354 |
4399 | 4355 |
4400 #undef __ | 4356 #undef __ |
4401 | 4357 |
4402 } } // namespace v8::internal | 4358 } } // namespace v8::internal |
4403 | 4359 |
4404 #endif // V8_TARGET_ARCH_ARM | 4360 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |