OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef V8_LOOKUP_INL_H_ | 5 #ifndef V8_LOOKUP_INL_H_ |
6 #define V8_LOOKUP_INL_H_ | 6 #define V8_LOOKUP_INL_H_ |
7 | 7 |
8 #include "src/lookup.h" | 8 #include "src/lookup.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 } | 50 } |
51 if (check_interceptor() && map->has_named_interceptor()) { | 51 if (check_interceptor() && map->has_named_interceptor()) { |
52 return INTERCEPTOR; | 52 return INTERCEPTOR; |
53 } | 53 } |
54 // Fall through. | 54 // Fall through. |
55 case INTERCEPTOR: | 55 case INTERCEPTOR: |
56 if (map->is_dictionary_map()) { | 56 if (map->is_dictionary_map()) { |
57 NameDictionary* dict = JSObject::cast(holder)->property_dictionary(); | 57 NameDictionary* dict = JSObject::cast(holder)->property_dictionary(); |
58 number_ = dict->FindEntry(name_); | 58 number_ = dict->FindEntry(name_); |
59 if (number_ == NameDictionary::kNotFound) return NOT_FOUND; | 59 if (number_ == NameDictionary::kNotFound) return NOT_FOUND; |
60 property_details_ = dict->DetailsAt(number_); | |
61 if (holder->IsGlobalObject()) { | 60 if (holder->IsGlobalObject()) { |
62 if (property_details_.IsDeleted()) return NOT_FOUND; | |
63 PropertyCell* cell = PropertyCell::cast(dict->ValueAt(number_)); | 61 PropertyCell* cell = PropertyCell::cast(dict->ValueAt(number_)); |
64 if (cell->value()->IsTheHole()) return NOT_FOUND; | 62 if (cell->value()->IsTheHole()) return NOT_FOUND; |
65 } | 63 } |
| 64 property_details_ = dict->DetailsAt(number_); |
66 } else { | 65 } else { |
67 DescriptorArray* descriptors = map->instance_descriptors(); | 66 DescriptorArray* descriptors = map->instance_descriptors(); |
68 number_ = descriptors->SearchWithCache(*name_, map); | 67 number_ = descriptors->SearchWithCache(*name_, map); |
69 if (number_ == DescriptorArray::kNotFound) return NOT_FOUND; | 68 if (number_ == DescriptorArray::kNotFound) return NOT_FOUND; |
70 property_details_ = descriptors->GetDetails(number_); | 69 property_details_ = descriptors->GetDetails(number_); |
71 } | 70 } |
72 has_property_ = true; | 71 has_property_ = true; |
73 switch (property_details_.kind()) { | 72 switch (property_details_.kind()) { |
74 case v8::internal::kData: | 73 case v8::internal::kData: |
75 return DATA; | 74 return DATA; |
76 case v8::internal::kAccessor: | 75 case v8::internal::kAccessor: |
77 return ACCESSOR; | 76 return ACCESSOR; |
78 } | 77 } |
79 case ACCESSOR: | 78 case ACCESSOR: |
80 case DATA: | 79 case DATA: |
81 return NOT_FOUND; | 80 return NOT_FOUND; |
82 case INTEGER_INDEXED_EXOTIC: | 81 case INTEGER_INDEXED_EXOTIC: |
83 case JSPROXY: | 82 case JSPROXY: |
84 case TRANSITION: | 83 case TRANSITION: |
85 UNREACHABLE(); | 84 UNREACHABLE(); |
86 } | 85 } |
87 UNREACHABLE(); | 86 UNREACHABLE(); |
88 return state_; | 87 return state_; |
89 } | 88 } |
90 } | 89 } |
91 } // namespace v8::internal | 90 } // namespace v8::internal |
92 | 91 |
93 #endif // V8_LOOKUP_INL_H_ | 92 #endif // V8_LOOKUP_INL_H_ |
OLD | NEW |