| 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 29 matching lines...) Expand all Loading... |
| 40 if (map->IsJSProxyMap()) return JSPROXY; | 40 if (map->IsJSProxyMap()) return JSPROXY; |
| 41 if (map->is_access_check_needed()) return ACCESS_CHECK; | 41 if (map->is_access_check_needed()) return ACCESS_CHECK; |
| 42 // Fall through. | 42 // Fall through. |
| 43 case ACCESS_CHECK: | 43 case ACCESS_CHECK: |
| 44 if (check_interceptor() && map->has_named_interceptor()) { | 44 if (check_interceptor() && map->has_named_interceptor()) { |
| 45 return INTERCEPTOR; | 45 return INTERCEPTOR; |
| 46 } | 46 } |
| 47 // Fall through. | 47 // Fall through. |
| 48 case INTERCEPTOR: | 48 case INTERCEPTOR: |
| 49 if (map->is_dictionary_map()) { | 49 if (map->is_dictionary_map()) { |
| 50 property_encoding_ = DICTIONARY; | |
| 51 if (holder == NULL) return UNKNOWN; | 50 if (holder == NULL) return UNKNOWN; |
| 52 NameDictionary* dict = JSObject::cast(holder)->property_dictionary(); | 51 NameDictionary* dict = JSObject::cast(holder)->property_dictionary(); |
| 53 number_ = dict->FindEntry(name_); | 52 number_ = dict->FindEntry(name_); |
| 54 if (number_ == NameDictionary::kNotFound) return NOT_FOUND; | 53 if (number_ == NameDictionary::kNotFound) return NOT_FOUND; |
| 55 property_details_ = dict->DetailsAt(number_); | 54 property_details_ = dict->DetailsAt(number_); |
| 56 if (holder->IsGlobalObject()) { | 55 if (holder->IsGlobalObject()) { |
| 57 if (property_details_.IsDeleted()) return NOT_FOUND; | 56 if (property_details_.IsDeleted()) return NOT_FOUND; |
| 58 PropertyCell* cell = PropertyCell::cast(dict->ValueAt(number_)); | 57 PropertyCell* cell = PropertyCell::cast(dict->ValueAt(number_)); |
| 59 if (cell->value()->IsTheHole()) return NOT_FOUND; | 58 if (cell->value()->IsTheHole()) return NOT_FOUND; |
| 60 } | 59 } |
| 61 } else { | 60 } else { |
| 62 DescriptorArray* descriptors = map->instance_descriptors(); | 61 DescriptorArray* descriptors = map->instance_descriptors(); |
| 63 number_ = descriptors->SearchWithCache(*name_, map); | 62 number_ = descriptors->SearchWithCache(*name_, map); |
| 64 if (number_ == DescriptorArray::kNotFound) return NOT_FOUND; | 63 if (number_ == DescriptorArray::kNotFound) return NOT_FOUND; |
| 65 property_encoding_ = DESCRIPTOR; | |
| 66 property_details_ = descriptors->GetDetails(number_); | 64 property_details_ = descriptors->GetDetails(number_); |
| 67 } | 65 } |
| 68 has_property_ = true; | 66 has_property_ = true; |
| 69 switch (property_details_.type()) { | 67 switch (property_details_.type()) { |
| 70 case v8::internal::CONSTANT: | 68 case v8::internal::CONSTANT: |
| 71 case v8::internal::FIELD: | 69 case v8::internal::FIELD: |
| 72 case v8::internal::NORMAL: | 70 case v8::internal::NORMAL: |
| 73 return DATA; | 71 return DATA; |
| 74 case v8::internal::CALLBACKS: | 72 case v8::internal::CALLBACKS: |
| 75 return ACCESSOR; | 73 return ACCESSOR; |
| 76 } | 74 } |
| 77 case ACCESSOR: | 75 case ACCESSOR: |
| 78 case DATA: | 76 case DATA: |
| 79 case UNKNOWN: | 77 case UNKNOWN: |
| 80 return NOT_FOUND; | 78 return NOT_FOUND; |
| 81 case JSPROXY: | 79 case JSPROXY: |
| 82 case TRANSITION: | 80 case TRANSITION: |
| 83 UNREACHABLE(); | 81 UNREACHABLE(); |
| 84 } | 82 } |
| 85 UNREACHABLE(); | 83 UNREACHABLE(); |
| 86 return state_; | 84 return state_; |
| 87 } | 85 } |
| 88 } | 86 } |
| 89 } // namespace v8::internal | 87 } // namespace v8::internal |
| 90 | 88 |
| 91 #endif // V8_LOOKUP_INL_H_ | 89 #endif // V8_LOOKUP_INL_H_ |
| OLD | NEW |