OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |