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

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

Issue 2428473002: [ic] Cache weak cells containing prototypes in respective PrototypeInfo objects. (Closed)
Patch Set: Created 4 years, 2 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/ia32/handler-compiler-ia32.cc ('k') | src/ic/mips/handler-compiler-mips.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-arguments-inl.h" 8 #include "src/api-arguments-inl.h"
9 #include "src/api.h" 9 #include "src/api.h"
10 #include "src/arguments.h" 10 #include "src/arguments.h"
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after
886 886
887 Handle<Object> LoadIC::SimpleLoadFromPrototype(Handle<Map> receiver_map, 887 Handle<Object> LoadIC::SimpleLoadFromPrototype(Handle<Map> receiver_map,
888 Handle<JSObject> holder, 888 Handle<JSObject> holder,
889 Handle<Object> smi_handler) { 889 Handle<Object> smi_handler) {
890 DCHECK(IsPrototypeValidityCellCheckEnough(receiver_map, holder)); 890 DCHECK(IsPrototypeValidityCellCheckEnough(receiver_map, holder));
891 891
892 Handle<Cell> validity_cell = 892 Handle<Cell> validity_cell =
893 Map::GetOrCreatePrototypeChainValidityCell(receiver_map, isolate()); 893 Map::GetOrCreatePrototypeChainValidityCell(receiver_map, isolate());
894 DCHECK(!validity_cell.is_null()); 894 DCHECK(!validity_cell.is_null());
895 895
896 Factory* factory = isolate()->factory(); 896 Handle<WeakCell> holder_cell =
897 897 Map::GetOrCreatePrototypeWeakCell(holder, isolate());
898 Handle<WeakCell> holder_cell = factory->NewWeakCell(holder); 898 return isolate()->factory()->NewTuple3(validity_cell, holder_cell,
899 return factory->NewTuple3(validity_cell, holder_cell, smi_handler); 899 smi_handler);
900 } 900 }
901 901
902 bool IsCompatibleReceiver(LookupIterator* lookup, Handle<Map> receiver_map) { 902 bool IsCompatibleReceiver(LookupIterator* lookup, Handle<Map> receiver_map) {
903 DCHECK(lookup->state() == LookupIterator::ACCESSOR); 903 DCHECK(lookup->state() == LookupIterator::ACCESSOR);
904 Isolate* isolate = lookup->isolate(); 904 Isolate* isolate = lookup->isolate();
905 Handle<Object> accessors = lookup->GetAccessors(); 905 Handle<Object> accessors = lookup->GetAccessors();
906 if (accessors->IsAccessorInfo()) { 906 if (accessors->IsAccessorInfo()) {
907 Handle<AccessorInfo> info = Handle<AccessorInfo>::cast(accessors); 907 Handle<AccessorInfo> info = Handle<AccessorInfo>::cast(accessors);
908 if (info->getter() != NULL && 908 if (info->getter() != NULL &&
909 !AccessorInfo::IsCompatibleReceiverMap(isolate, info, receiver_map)) { 909 !AccessorInfo::IsCompatibleReceiverMap(isolate, info, receiver_map)) {
(...skipping 2068 matching lines...) Expand 10 before | Expand all | Expand 10 after
2978 DCHECK_EQ(LookupIterator::INTERCEPTOR, it.state()); 2978 DCHECK_EQ(LookupIterator::INTERCEPTOR, it.state());
2979 it.Next(); 2979 it.Next();
2980 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, 2980 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result,
2981 Object::GetProperty(&it)); 2981 Object::GetProperty(&it));
2982 } 2982 }
2983 2983
2984 return *result; 2984 return *result;
2985 } 2985 }
2986 } // namespace internal 2986 } // namespace internal
2987 } // namespace v8 2987 } // namespace v8
OLDNEW
« no previous file with comments | « src/ic/ia32/handler-compiler-ia32.cc ('k') | src/ic/mips/handler-compiler-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698