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 1517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1528 // ----------------------------------- | 1528 // ----------------------------------- |
1529 | 1529 |
1530 __ Push(a1, a2, a0); | 1530 __ Push(a1, a2, a0); |
1531 // Perform tail call to the entry. | 1531 // Perform tail call to the entry. |
1532 ExternalReference ref = ExternalReference(IC_Utility(kStoreIC_Miss), | 1532 ExternalReference ref = ExternalReference(IC_Utility(kStoreIC_Miss), |
1533 masm->isolate()); | 1533 masm->isolate()); |
1534 __ TailCallExternalReference(ref, 3, 1); | 1534 __ TailCallExternalReference(ref, 3, 1); |
1535 } | 1535 } |
1536 | 1536 |
1537 | 1537 |
1538 void StoreIC::GenerateArrayLength(MacroAssembler* masm) { | |
1539 // ----------- S t a t e ------------- | |
1540 // -- a0 : value | |
1541 // -- a1 : receiver | |
1542 // -- a2 : name | |
1543 // -- ra : return address | |
1544 // ----------------------------------- | |
1545 // | |
1546 // This accepts as a receiver anything JSArray::SetElementsLength accepts | |
1547 // (currently anything except for external arrays which means anything with | |
1548 // elements of FixedArray type). Value must be a number, but only smis are | |
1549 // accepted as the most common case. | |
1550 | |
1551 Label miss; | |
1552 | |
1553 Register receiver = a1; | |
1554 Register value = a0; | |
1555 Register scratch = a3; | |
1556 | |
1557 // Check that the receiver isn't a smi. | |
1558 __ JumpIfSmi(receiver, &miss); | |
1559 | |
1560 // Check that the object is a JS array. | |
1561 __ GetObjectType(receiver, scratch, scratch); | |
1562 __ Branch(&miss, ne, scratch, Operand(JS_ARRAY_TYPE)); | |
1563 | |
1564 // Check that elements are FixedArray. | |
1565 // We rely on StoreIC_ArrayLength below to deal with all types of | |
1566 // fast elements (including COW). | |
1567 __ lw(scratch, FieldMemOperand(receiver, JSArray::kElementsOffset)); | |
1568 __ GetObjectType(scratch, scratch, scratch); | |
1569 __ Branch(&miss, ne, scratch, Operand(FIXED_ARRAY_TYPE)); | |
1570 | |
1571 // Check that the array has fast properties, otherwise the length | |
1572 // property might have been redefined. | |
1573 __ lw(scratch, FieldMemOperand(receiver, JSArray::kPropertiesOffset)); | |
1574 __ lw(scratch, FieldMemOperand(scratch, FixedArray::kMapOffset)); | |
1575 __ LoadRoot(at, Heap::kHashTableMapRootIndex); | |
1576 __ Branch(&miss, eq, scratch, Operand(at)); | |
1577 | |
1578 // Check that value is a smi. | |
1579 __ JumpIfNotSmi(value, &miss); | |
1580 | |
1581 // Prepare tail call to StoreIC_ArrayLength. | |
1582 __ Push(receiver, value); | |
1583 | |
1584 ExternalReference ref = ExternalReference(IC_Utility(kStoreIC_ArrayLength), | |
1585 masm->isolate()); | |
1586 __ TailCallExternalReference(ref, 2, 1); | |
1587 | |
1588 __ bind(&miss); | |
1589 | |
1590 GenerateMiss(masm); | |
1591 } | |
1592 | |
1593 | |
1594 void StoreIC::GenerateNormal(MacroAssembler* masm) { | 1538 void StoreIC::GenerateNormal(MacroAssembler* masm) { |
1595 // ----------- S t a t e ------------- | 1539 // ----------- S t a t e ------------- |
1596 // -- a0 : value | 1540 // -- a0 : value |
1597 // -- a1 : receiver | 1541 // -- a1 : receiver |
1598 // -- a2 : name | 1542 // -- a2 : name |
1599 // -- ra : return address | 1543 // -- ra : return address |
1600 // ----------------------------------- | 1544 // ----------------------------------- |
1601 Label miss; | 1545 Label miss; |
1602 | 1546 |
1603 GenerateStringDictionaryReceiverCheck(masm, a1, a3, t0, t1, &miss); | 1547 GenerateStringDictionaryReceiverCheck(masm, a1, a3, t0, t1, &miss); |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1728 } else { | 1672 } else { |
1729 ASSERT(Assembler::IsBne(branch_instr)); | 1673 ASSERT(Assembler::IsBne(branch_instr)); |
1730 patcher.ChangeBranchCondition(eq); | 1674 patcher.ChangeBranchCondition(eq); |
1731 } | 1675 } |
1732 } | 1676 } |
1733 | 1677 |
1734 | 1678 |
1735 } } // namespace v8::internal | 1679 } } // namespace v8::internal |
1736 | 1680 |
1737 #endif // V8_TARGET_ARCH_MIPS | 1681 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |