Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Side by Side Diff: src/ic.cc

Issue 176843018: Only use the non-strict-arguments-stub if the store site is non-strict. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix the fix Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/mjsunit/regress-keyed-store-non-strict-arguments.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1671 matching lines...) Expand 10 before | Expand all | Expand 10 after
1682 } 1682 }
1683 1683
1684 if (use_ic) { 1684 if (use_ic) {
1685 ASSERT(!object->IsJSGlobalProxy()); 1685 ASSERT(!object->IsJSGlobalProxy());
1686 1686
1687 if (object->IsJSObject()) { 1687 if (object->IsJSObject()) {
1688 Handle<JSObject> receiver = Handle<JSObject>::cast(object); 1688 Handle<JSObject> receiver = Handle<JSObject>::cast(object);
1689 bool key_is_smi_like = key->IsSmi() || !key->ToSmi()->IsFailure(); 1689 bool key_is_smi_like = key->IsSmi() || !key->ToSmi()->IsFailure();
1690 if (receiver->elements()->map() == 1690 if (receiver->elements()->map() ==
1691 isolate()->heap()->non_strict_arguments_elements_map()) { 1691 isolate()->heap()->non_strict_arguments_elements_map()) {
1692 stub = non_strict_arguments_stub(); 1692 if (strict_mode() == kNonStrictMode) {
1693 stub = non_strict_arguments_stub();
1694 }
1693 } else if (key_is_smi_like && 1695 } else if (key_is_smi_like &&
1694 !(target().is_identical_to(non_strict_arguments_stub()))) { 1696 !(target().is_identical_to(non_strict_arguments_stub()))) {
1695 // We should go generic if receiver isn't a dictionary, but our 1697 // We should go generic if receiver isn't a dictionary, but our
1696 // prototype chain does have dictionary elements. This ensures that 1698 // prototype chain does have dictionary elements. This ensures that
1697 // other non-dictionary receivers in the polymorphic case benefit 1699 // other non-dictionary receivers in the polymorphic case benefit
1698 // from fast path keyed stores. 1700 // from fast path keyed stores.
1699 if (!(receiver->map()->DictionaryElementsInPrototypeChainOnly())) { 1701 if (!(receiver->map()->DictionaryElementsInPrototypeChainOnly())) {
1700 KeyedAccessStoreMode store_mode = 1702 KeyedAccessStoreMode store_mode =
1701 GetStoreMode(receiver, key, value); 1703 GetStoreMode(receiver, key, value);
1702 stub = StoreElementStub(receiver, store_mode); 1704 stub = StoreElementStub(receiver, store_mode);
(...skipping 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after
2811 #undef ADDR 2813 #undef ADDR
2812 }; 2814 };
2813 2815
2814 2816
2815 Address IC::AddressFromUtilityId(IC::UtilityId id) { 2817 Address IC::AddressFromUtilityId(IC::UtilityId id) {
2816 return IC_utilities[id]; 2818 return IC_utilities[id];
2817 } 2819 }
2818 2820
2819 2821
2820 } } // namespace v8::internal 2822 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress-keyed-store-non-strict-arguments.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698