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

Side by Side Diff: src/ic/ic.cc

Issue 1675223002: Mark maps having a hidden prototype rather than maps of hidden prototypes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comment Created 4 years, 10 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
« no previous file with comments | « src/ic/handler-compiler.cc ('k') | src/lookup.cc » ('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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/ic/ic.h" 5 #include "src/ic/ic.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/arguments.h" 9 #include "src/arguments.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after
1442 Handle<JSObject> holder = it->GetHolder<JSObject>(); 1442 Handle<JSObject> holder = it->GetHolder<JSObject>();
1443 if (receiver.is_identical_to(holder)) { 1443 if (receiver.is_identical_to(holder)) {
1444 it->PrepareForDataProperty(value); 1444 it->PrepareForDataProperty(value);
1445 // The previous receiver map might just have been deprecated, 1445 // The previous receiver map might just have been deprecated,
1446 // so reload it. 1446 // so reload it.
1447 update_receiver_map(receiver); 1447 update_receiver_map(receiver);
1448 return true; 1448 return true;
1449 } 1449 }
1450 1450
1451 // Receiver != holder. 1451 // Receiver != holder.
1452 PrototypeIterator iter(it->isolate(), receiver);
1453 if (receiver->IsJSGlobalProxy()) { 1452 if (receiver->IsJSGlobalProxy()) {
1453 PrototypeIterator iter(it->isolate(),
1454 Handle<JSGlobalProxy>::cast(receiver));
1454 return it->GetHolder<Object>().is_identical_to( 1455 return it->GetHolder<Object>().is_identical_to(
1455 PrototypeIterator::GetCurrent(iter)); 1456 PrototypeIterator::GetCurrent(iter));
1456 } 1457 }
1457 1458
1458 if (it->HolderIsReceiverOrHiddenPrototype()) return false; 1459 if (it->HolderIsReceiverOrHiddenPrototype()) return false;
1459 1460
1460 it->PrepareTransitionToDataProperty(value, NONE, store_mode); 1461 it->PrepareTransitionToDataProperty(value, NONE, store_mode);
1461 return it->IsCacheableTransition(); 1462 return it->IsCacheableTransition();
1462 } 1463 }
1463 } 1464 }
(...skipping 1442 matching lines...) Expand 10 before | Expand all | Expand 10 after
2906 RUNTIME_FUNCTION(Runtime_StorePropertyWithInterceptor) { 2907 RUNTIME_FUNCTION(Runtime_StorePropertyWithInterceptor) {
2907 HandleScope scope(isolate); 2908 HandleScope scope(isolate);
2908 DCHECK(args.length() == 3); 2909 DCHECK(args.length() == 3);
2909 StoreICNexus nexus(isolate); 2910 StoreICNexus nexus(isolate);
2910 StoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); 2911 StoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus);
2911 Handle<JSObject> receiver = args.at<JSObject>(0); 2912 Handle<JSObject> receiver = args.at<JSObject>(0);
2912 Handle<Name> name = args.at<Name>(1); 2913 Handle<Name> name = args.at<Name>(1);
2913 Handle<Object> value = args.at<Object>(2); 2914 Handle<Object> value = args.at<Object>(2);
2914 #ifdef DEBUG 2915 #ifdef DEBUG
2915 PrototypeIterator iter(isolate, receiver, 2916 PrototypeIterator iter(isolate, receiver,
2916 PrototypeIterator::START_AT_RECEIVER); 2917 PrototypeIterator::START_AT_RECEIVER,
2918 PrototypeIterator::END_AT_NON_HIDDEN);
2917 bool found = false; 2919 bool found = false;
2918 for (; !iter.IsAtEnd(PrototypeIterator::END_AT_NON_HIDDEN); iter.Advance()) { 2920 for (; !iter.IsAtEnd(); iter.Advance()) {
2919 Handle<Object> current = PrototypeIterator::GetCurrent(iter); 2921 Handle<Object> current = PrototypeIterator::GetCurrent(iter);
2920 if (current->IsJSObject() && 2922 if (current->IsJSObject() &&
2921 Handle<JSObject>::cast(current)->HasNamedInterceptor()) { 2923 Handle<JSObject>::cast(current)->HasNamedInterceptor()) {
2922 found = true; 2924 found = true;
2923 break; 2925 break;
2924 } 2926 }
2925 } 2927 }
2926 DCHECK(found); 2928 DCHECK(found);
2927 #endif 2929 #endif
2928 Handle<Object> result; 2930 Handle<Object> result;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
2974 KeyedLoadICNexus nexus(vector, vector_slot); 2976 KeyedLoadICNexus nexus(vector, vector_slot);
2975 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); 2977 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus);
2976 ic.UpdateState(receiver, key); 2978 ic.UpdateState(receiver, key);
2977 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); 2979 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key));
2978 } 2980 }
2979 2981
2980 return *result; 2982 return *result;
2981 } 2983 }
2982 } // namespace internal 2984 } // namespace internal
2983 } // namespace v8 2985 } // namespace v8
OLDNEW
« no previous file with comments | « src/ic/handler-compiler.cc ('k') | src/lookup.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698