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 1630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1641 } | 1641 } |
1642 | 1642 |
1643 | 1643 |
1644 Handle<Code> CallStubCompiler::CompileArrayPushCall( | 1644 Handle<Code> CallStubCompiler::CompileArrayPushCall( |
1645 Handle<Object> object, | 1645 Handle<Object> object, |
1646 Handle<JSObject> holder, | 1646 Handle<JSObject> holder, |
1647 Handle<Cell> cell, | 1647 Handle<Cell> cell, |
1648 Handle<JSFunction> function, | 1648 Handle<JSFunction> function, |
1649 Handle<String> name, | 1649 Handle<String> name, |
1650 Code::StubType type) { | 1650 Code::StubType type) { |
1651 // ----------- S t a t e ------------- | 1651 // If object is not an array or is observed or sealed, bail out to regular |
1652 // -- rcx : name | 1652 // call. |
1653 // -- rsp[0] : return address | |
1654 // -- rsp[(argc - n) * 8] : arg[n] (zero-based) | |
1655 // -- ... | |
1656 // -- rsp[(argc + 1) * 8] : receiver | |
1657 // ----------------------------------- | |
1658 | |
1659 // If object is not an array or is observed, bail out to regular call. | |
1660 if (!object->IsJSArray() || | 1653 if (!object->IsJSArray() || |
1661 !cell.is_null() || | 1654 !cell.is_null() || |
1662 Handle<JSArray>::cast(object)->map()->is_observed()) { | 1655 Handle<JSArray>::cast(object)->map()->is_observed() || |
| 1656 !Handle<JSArray>::cast(object)->map()->is_extensible()) { |
1663 return Handle<Code>::null(); | 1657 return Handle<Code>::null(); |
1664 } | 1658 } |
1665 | 1659 |
1666 Label miss; | 1660 Label miss; |
1667 | 1661 |
1668 HandlerFrontendHeader(object, holder, name, RECEIVER_MAP_CHECK, &miss); | 1662 HandlerFrontendHeader(object, holder, name, RECEIVER_MAP_CHECK, &miss); |
1669 | 1663 |
1670 const int argc = arguments().immediate(); | 1664 const int argc = arguments().immediate(); |
1671 StackArgumentsAccessor args(rsp, argc); | 1665 StackArgumentsAccessor args(rsp, argc); |
1672 if (argc == 0) { | 1666 if (argc == 0) { |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1888 } | 1882 } |
1889 | 1883 |
1890 | 1884 |
1891 Handle<Code> CallStubCompiler::CompileArrayPopCall( | 1885 Handle<Code> CallStubCompiler::CompileArrayPopCall( |
1892 Handle<Object> object, | 1886 Handle<Object> object, |
1893 Handle<JSObject> holder, | 1887 Handle<JSObject> holder, |
1894 Handle<Cell> cell, | 1888 Handle<Cell> cell, |
1895 Handle<JSFunction> function, | 1889 Handle<JSFunction> function, |
1896 Handle<String> name, | 1890 Handle<String> name, |
1897 Code::StubType type) { | 1891 Code::StubType type) { |
1898 // If object is not an array or is observed, bail out to regular call. | 1892 // If object is not an array or is observed or sealed, bail out to regular |
| 1893 // call. |
1899 if (!object->IsJSArray() || | 1894 if (!object->IsJSArray() || |
1900 !cell.is_null() || | 1895 !cell.is_null() || |
1901 Handle<JSArray>::cast(object)->map()->is_observed()) { | 1896 Handle<JSArray>::cast(object)->map()->is_observed() || |
| 1897 !Handle<JSArray>::cast(object)->map()->is_extensible()) { |
1902 return Handle<Code>::null(); | 1898 return Handle<Code>::null(); |
1903 } | 1899 } |
1904 | 1900 |
1905 Label miss, return_undefined, call_builtin; | 1901 Label miss, return_undefined, call_builtin; |
1906 | 1902 |
1907 HandlerFrontendHeader(object, holder, name, RECEIVER_MAP_CHECK, &miss); | 1903 HandlerFrontendHeader(object, holder, name, RECEIVER_MAP_CHECK, &miss); |
1908 | 1904 |
1909 // Get the elements array of the object. | 1905 // Get the elements array of the object. |
1910 __ movq(rbx, FieldOperand(rdx, JSArray::kElementsOffset)); | 1906 __ movq(rbx, FieldOperand(rdx, JSArray::kElementsOffset)); |
1911 | 1907 |
(...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2996 // ----------------------------------- | 2992 // ----------------------------------- |
2997 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 2993 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
2998 } | 2994 } |
2999 | 2995 |
3000 | 2996 |
3001 #undef __ | 2997 #undef __ |
3002 | 2998 |
3003 } } // namespace v8::internal | 2999 } } // namespace v8::internal |
3004 | 3000 |
3005 #endif // V8_TARGET_ARCH_X64 | 3001 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |