OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 1599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1610 | 1610 |
1611 // Return the generated code. | 1611 // Return the generated code. |
1612 return GetCode(NORMAL, name); | 1612 return GetCode(NORMAL, name); |
1613 } | 1613 } |
1614 | 1614 |
1615 | 1615 |
1616 Object* LoadStubCompiler::CompileLoadNonexistent(String* name, | 1616 Object* LoadStubCompiler::CompileLoadNonexistent(String* name, |
1617 JSObject* object, | 1617 JSObject* object, |
1618 JSObject* last) { | 1618 JSObject* last) { |
1619 // ----------- S t a t e ------------- | 1619 // ----------- S t a t e ------------- |
1620 // -- r2 : name | 1620 // -- r0 : receiver |
1621 // -- lr : return address | 1621 // -- lr : return address |
1622 // -- [sp] : receiver | |
1623 // ----------------------------------- | 1622 // ----------------------------------- |
1624 Label miss; | 1623 Label miss; |
1625 | 1624 |
1626 // Load receiver. | |
1627 __ ldr(r0, MemOperand(sp, 0)); | |
1628 | |
1629 // Check that receiver is not a smi. | 1625 // Check that receiver is not a smi. |
1630 __ tst(r0, Operand(kSmiTagMask)); | 1626 __ tst(r0, Operand(kSmiTagMask)); |
1631 __ b(eq, &miss); | 1627 __ b(eq, &miss); |
1632 | 1628 |
1633 // Check the maps of the full prototype chain. | 1629 // Check the maps of the full prototype chain. |
1634 CheckPrototypes(object, r0, last, r3, r1, name, &miss); | 1630 CheckPrototypes(object, r0, last, r3, r1, name, &miss); |
1635 | 1631 |
1636 // If the last object in the prototype chain is a global object, | 1632 // If the last object in the prototype chain is a global object, |
1637 // check that the global property cell is empty. | 1633 // check that the global property cell is empty. |
1638 if (last->IsGlobalObject()) { | 1634 if (last->IsGlobalObject()) { |
(...skipping 16 matching lines...) Expand all Loading... |
1655 // Return the generated code. | 1651 // Return the generated code. |
1656 return GetCode(NONEXISTENT, Heap::empty_string()); | 1652 return GetCode(NONEXISTENT, Heap::empty_string()); |
1657 } | 1653 } |
1658 | 1654 |
1659 | 1655 |
1660 Object* LoadStubCompiler::CompileLoadField(JSObject* object, | 1656 Object* LoadStubCompiler::CompileLoadField(JSObject* object, |
1661 JSObject* holder, | 1657 JSObject* holder, |
1662 int index, | 1658 int index, |
1663 String* name) { | 1659 String* name) { |
1664 // ----------- S t a t e ------------- | 1660 // ----------- S t a t e ------------- |
| 1661 // -- r0 : receiver |
1665 // -- r2 : name | 1662 // -- r2 : name |
1666 // -- lr : return address | 1663 // -- lr : return address |
1667 // -- [sp] : receiver | |
1668 // ----------------------------------- | 1664 // ----------------------------------- |
1669 Label miss; | 1665 Label miss; |
1670 | 1666 |
1671 __ ldr(r0, MemOperand(sp, 0)); | |
1672 | |
1673 GenerateLoadField(object, holder, r0, r3, r1, index, name, &miss); | 1667 GenerateLoadField(object, holder, r0, r3, r1, index, name, &miss); |
1674 __ bind(&miss); | 1668 __ bind(&miss); |
1675 GenerateLoadMiss(masm(), Code::LOAD_IC); | 1669 GenerateLoadMiss(masm(), Code::LOAD_IC); |
1676 | 1670 |
1677 // Return the generated code. | 1671 // Return the generated code. |
1678 return GetCode(FIELD, name); | 1672 return GetCode(FIELD, name); |
1679 } | 1673 } |
1680 | 1674 |
1681 | 1675 |
1682 Object* LoadStubCompiler::CompileLoadCallback(String* name, | 1676 Object* LoadStubCompiler::CompileLoadCallback(String* name, |
1683 JSObject* object, | 1677 JSObject* object, |
1684 JSObject* holder, | 1678 JSObject* holder, |
1685 AccessorInfo* callback) { | 1679 AccessorInfo* callback) { |
1686 // ----------- S t a t e ------------- | 1680 // ----------- S t a t e ------------- |
| 1681 // -- r0 : receiver |
1687 // -- r2 : name | 1682 // -- r2 : name |
1688 // -- lr : return address | 1683 // -- lr : return address |
1689 // -- [sp] : receiver | |
1690 // ----------------------------------- | 1684 // ----------------------------------- |
1691 Label miss; | 1685 Label miss; |
1692 | 1686 |
1693 __ ldr(r0, MemOperand(sp, 0)); | |
1694 Failure* failure = Failure::InternalError(); | 1687 Failure* failure = Failure::InternalError(); |
1695 bool success = GenerateLoadCallback(object, holder, r0, r2, r3, r1, | 1688 bool success = GenerateLoadCallback(object, holder, r0, r2, r3, r1, |
1696 callback, name, &miss, &failure); | 1689 callback, name, &miss, &failure); |
1697 if (!success) return failure; | 1690 if (!success) return failure; |
1698 | 1691 |
1699 __ bind(&miss); | 1692 __ bind(&miss); |
1700 GenerateLoadMiss(masm(), Code::LOAD_IC); | 1693 GenerateLoadMiss(masm(), Code::LOAD_IC); |
1701 | 1694 |
1702 // Return the generated code. | 1695 // Return the generated code. |
1703 return GetCode(CALLBACKS, name); | 1696 return GetCode(CALLBACKS, name); |
1704 } | 1697 } |
1705 | 1698 |
1706 | 1699 |
1707 Object* LoadStubCompiler::CompileLoadConstant(JSObject* object, | 1700 Object* LoadStubCompiler::CompileLoadConstant(JSObject* object, |
1708 JSObject* holder, | 1701 JSObject* holder, |
1709 Object* value, | 1702 Object* value, |
1710 String* name) { | 1703 String* name) { |
1711 // ----------- S t a t e ------------- | 1704 // ----------- S t a t e ------------- |
| 1705 // -- r0 : receiver |
1712 // -- r2 : name | 1706 // -- r2 : name |
1713 // -- lr : return address | 1707 // -- lr : return address |
1714 // -- [sp] : receiver | |
1715 // ----------------------------------- | 1708 // ----------------------------------- |
1716 Label miss; | 1709 Label miss; |
1717 | 1710 |
1718 __ ldr(r0, MemOperand(sp, 0)); | |
1719 | |
1720 GenerateLoadConstant(object, holder, r0, r3, r1, value, name, &miss); | 1711 GenerateLoadConstant(object, holder, r0, r3, r1, value, name, &miss); |
1721 __ bind(&miss); | 1712 __ bind(&miss); |
1722 GenerateLoadMiss(masm(), Code::LOAD_IC); | 1713 GenerateLoadMiss(masm(), Code::LOAD_IC); |
1723 | 1714 |
1724 // Return the generated code. | 1715 // Return the generated code. |
1725 return GetCode(CONSTANT_FUNCTION, name); | 1716 return GetCode(CONSTANT_FUNCTION, name); |
1726 } | 1717 } |
1727 | 1718 |
1728 | 1719 |
1729 Object* LoadStubCompiler::CompileLoadInterceptor(JSObject* object, | 1720 Object* LoadStubCompiler::CompileLoadInterceptor(JSObject* object, |
1730 JSObject* holder, | 1721 JSObject* holder, |
1731 String* name) { | 1722 String* name) { |
1732 // ----------- S t a t e ------------- | 1723 // ----------- S t a t e ------------- |
| 1724 // -- r0 : receiver |
1733 // -- r2 : name | 1725 // -- r2 : name |
1734 // -- lr : return address | 1726 // -- lr : return address |
1735 // -- [sp] : receiver | |
1736 // ----------------------------------- | 1727 // ----------------------------------- |
1737 Label miss; | 1728 Label miss; |
1738 | 1729 |
1739 __ ldr(r0, MemOperand(sp, 0)); | |
1740 | |
1741 LookupResult lookup; | 1730 LookupResult lookup; |
1742 LookupPostInterceptor(holder, name, &lookup); | 1731 LookupPostInterceptor(holder, name, &lookup); |
1743 GenerateLoadInterceptor(object, | 1732 GenerateLoadInterceptor(object, |
1744 holder, | 1733 holder, |
1745 &lookup, | 1734 &lookup, |
1746 r0, | 1735 r0, |
1747 r2, | 1736 r2, |
1748 r3, | 1737 r3, |
1749 r1, | 1738 r1, |
1750 name, | 1739 name, |
1751 &miss); | 1740 &miss); |
1752 __ bind(&miss); | 1741 __ bind(&miss); |
1753 GenerateLoadMiss(masm(), Code::LOAD_IC); | 1742 GenerateLoadMiss(masm(), Code::LOAD_IC); |
1754 | 1743 |
1755 // Return the generated code. | 1744 // Return the generated code. |
1756 return GetCode(INTERCEPTOR, name); | 1745 return GetCode(INTERCEPTOR, name); |
1757 } | 1746 } |
1758 | 1747 |
1759 | 1748 |
1760 Object* LoadStubCompiler::CompileLoadGlobal(JSObject* object, | 1749 Object* LoadStubCompiler::CompileLoadGlobal(JSObject* object, |
1761 GlobalObject* holder, | 1750 GlobalObject* holder, |
1762 JSGlobalPropertyCell* cell, | 1751 JSGlobalPropertyCell* cell, |
1763 String* name, | 1752 String* name, |
1764 bool is_dont_delete) { | 1753 bool is_dont_delete) { |
1765 // ----------- S t a t e ------------- | 1754 // ----------- S t a t e ------------- |
| 1755 // -- r0 : receiver |
1766 // -- r2 : name | 1756 // -- r2 : name |
1767 // -- lr : return address | 1757 // -- lr : return address |
1768 // -- r0 : receiver | |
1769 // -- sp[0] : receiver | |
1770 // ----------------------------------- | 1758 // ----------------------------------- |
1771 Label miss; | 1759 Label miss; |
1772 | 1760 |
1773 // If the object is the holder then we know that it's a global | 1761 // If the object is the holder then we know that it's a global |
1774 // object which can only happen for contextual calls. In this case, | 1762 // object which can only happen for contextual calls. In this case, |
1775 // the receiver cannot be a smi. | 1763 // the receiver cannot be a smi. |
1776 if (object != holder) { | 1764 if (object != holder) { |
1777 __ tst(r0, Operand(kSmiTagMask)); | 1765 __ tst(r0, Operand(kSmiTagMask)); |
1778 __ b(eq, &miss); | 1766 __ b(eq, &miss); |
1779 } | 1767 } |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2146 // Return the generated code. | 2134 // Return the generated code. |
2147 return GetCode(); | 2135 return GetCode(); |
2148 } | 2136 } |
2149 | 2137 |
2150 | 2138 |
2151 #undef __ | 2139 #undef __ |
2152 | 2140 |
2153 } } // namespace v8::internal | 2141 } } // namespace v8::internal |
2154 | 2142 |
2155 #endif // V8_TARGET_ARCH_ARM | 2143 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |