OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 1683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1694 // ----------- S t a t e ------------- | 1694 // ----------- S t a t e ------------- |
1695 // -- rax : receiver | 1695 // -- rax : receiver |
1696 // -- rcx : name | 1696 // -- rcx : name |
1697 // -- rsp[0] : return address | 1697 // -- rsp[0] : return address |
1698 // ----------------------------------- | 1698 // ----------------------------------- |
1699 Label miss; | 1699 Label miss; |
1700 | 1700 |
1701 Failure* failure = Failure::InternalError(); | 1701 Failure* failure = Failure::InternalError(); |
1702 bool success = GenerateLoadCallback(object, holder, rax, rcx, rbx, rdx, rdi, | 1702 bool success = GenerateLoadCallback(object, holder, rax, rcx, rbx, rdx, rdi, |
1703 callback, name, &miss, &failure); | 1703 callback, name, &miss, &failure); |
1704 if (!success) return failure; | 1704 if (!success) { |
| 1705 miss.Unuse(); |
| 1706 return failure; |
| 1707 } |
1705 | 1708 |
1706 __ bind(&miss); | 1709 __ bind(&miss); |
1707 GenerateLoadMiss(masm(), Code::LOAD_IC); | 1710 GenerateLoadMiss(masm(), Code::LOAD_IC); |
1708 | 1711 |
1709 // Return the generated code. | 1712 // Return the generated code. |
1710 return GetCode(CALLBACKS, name); | 1713 return GetCode(CALLBACKS, name); |
1711 } | 1714 } |
1712 | 1715 |
1713 | 1716 |
1714 Object* LoadStubCompiler::CompileLoadConstant(JSObject* object, | 1717 Object* LoadStubCompiler::CompileLoadConstant(JSObject* object, |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1750 CheckPrototypes(object, rax, last, rbx, rdx, rdi, name, &miss); | 1753 CheckPrototypes(object, rax, last, rbx, rdx, rdi, name, &miss); |
1751 | 1754 |
1752 // If the last object in the prototype chain is a global object, | 1755 // If the last object in the prototype chain is a global object, |
1753 // check that the global property cell is empty. | 1756 // check that the global property cell is empty. |
1754 if (last->IsGlobalObject()) { | 1757 if (last->IsGlobalObject()) { |
1755 Object* cell = GenerateCheckPropertyCell(masm(), | 1758 Object* cell = GenerateCheckPropertyCell(masm(), |
1756 GlobalObject::cast(last), | 1759 GlobalObject::cast(last), |
1757 name, | 1760 name, |
1758 rdx, | 1761 rdx, |
1759 &miss); | 1762 &miss); |
1760 if (cell->IsFailure()) return cell; | 1763 if (cell->IsFailure()) { |
| 1764 miss.Unuse(); |
| 1765 return cell; |
| 1766 } |
1761 } | 1767 } |
1762 | 1768 |
1763 // Return undefined if maps of the full prototype chain are still the | 1769 // Return undefined if maps of the full prototype chain are still the |
1764 // same and no global property with this name contains a value. | 1770 // same and no global property with this name contains a value. |
1765 __ LoadRoot(rax, Heap::kUndefinedValueRootIndex); | 1771 __ LoadRoot(rax, Heap::kUndefinedValueRootIndex); |
1766 __ ret(0); | 1772 __ ret(0); |
1767 | 1773 |
1768 __ bind(&miss); | 1774 __ bind(&miss); |
1769 GenerateLoadMiss(masm(), Code::LOAD_IC); | 1775 GenerateLoadMiss(masm(), Code::LOAD_IC); |
1770 | 1776 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1888 | 1894 |
1889 __ IncrementCounter(&Counters::keyed_load_callback, 1); | 1895 __ IncrementCounter(&Counters::keyed_load_callback, 1); |
1890 | 1896 |
1891 // Check that the name has not changed. | 1897 // Check that the name has not changed. |
1892 __ Cmp(rax, Handle<String>(name)); | 1898 __ Cmp(rax, Handle<String>(name)); |
1893 __ j(not_equal, &miss); | 1899 __ j(not_equal, &miss); |
1894 | 1900 |
1895 Failure* failure = Failure::InternalError(); | 1901 Failure* failure = Failure::InternalError(); |
1896 bool success = GenerateLoadCallback(receiver, holder, rdx, rax, rbx, rcx, rdi, | 1902 bool success = GenerateLoadCallback(receiver, holder, rdx, rax, rbx, rcx, rdi, |
1897 callback, name, &miss, &failure); | 1903 callback, name, &miss, &failure); |
1898 if (!success) return failure; | 1904 if (!success) { |
| 1905 miss.Unuse(); |
| 1906 return failure; |
| 1907 } |
1899 | 1908 |
1900 __ bind(&miss); | 1909 __ bind(&miss); |
1901 __ DecrementCounter(&Counters::keyed_load_callback, 1); | 1910 __ DecrementCounter(&Counters::keyed_load_callback, 1); |
1902 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 1911 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
1903 | 1912 |
1904 // Return the generated code. | 1913 // Return the generated code. |
1905 return GetCode(CALLBACKS, name); | 1914 return GetCode(CALLBACKS, name); |
1906 } | 1915 } |
1907 | 1916 |
1908 | 1917 |
(...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2822 // Return the generated code. | 2831 // Return the generated code. |
2823 return GetCode(); | 2832 return GetCode(); |
2824 } | 2833 } |
2825 | 2834 |
2826 | 2835 |
2827 #undef __ | 2836 #undef __ |
2828 | 2837 |
2829 } } // namespace v8::internal | 2838 } } // namespace v8::internal |
2830 | 2839 |
2831 #endif // V8_TARGET_ARCH_X64 | 2840 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |