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 #include "src/elements.h" | 10 #include "src/elements.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 property_details_ = PropertyDetails(attributes, v8::internal::DATA, 0, | 67 property_details_ = PropertyDetails(attributes, v8::internal::DATA, 0, |
68 PropertyCellType::kNoCell); | 68 PropertyCellType::kNoCell); |
69 } else { | 69 } else { |
70 JSObject* js_object = JSObject::cast(holder); | 70 JSObject* js_object = JSObject::cast(holder); |
71 if (js_object->elements() == isolate()->heap()->empty_fixed_array()) { | 71 if (js_object->elements() == isolate()->heap()->empty_fixed_array()) { |
72 return NOT_FOUND; | 72 return NOT_FOUND; |
73 } | 73 } |
74 | 74 |
75 ElementsAccessor* accessor = js_object->GetElementsAccessor(); | 75 ElementsAccessor* accessor = js_object->GetElementsAccessor(); |
76 FixedArrayBase* backing_store = js_object->elements(); | 76 FixedArrayBase* backing_store = js_object->elements(); |
77 number_ = accessor->GetIndexForKey(js_object, backing_store, index_); | 77 number_ = |
| 78 accessor->GetEntryForIndex(js_object, backing_store, index_); |
78 if (number_ == kMaxUInt32) return NOT_FOUND; | 79 if (number_ == kMaxUInt32) return NOT_FOUND; |
79 property_details_ = accessor->GetDetails(backing_store, number_); | 80 property_details_ = accessor->GetDetails(backing_store, number_); |
80 } | 81 } |
81 } else if (!map->is_dictionary_map()) { | 82 } else if (!map->is_dictionary_map()) { |
82 DescriptorArray* descriptors = map->instance_descriptors(); | 83 DescriptorArray* descriptors = map->instance_descriptors(); |
83 int number = descriptors->SearchWithCache(*name_, map); | 84 int number = descriptors->SearchWithCache(*name_, map); |
84 if (number == DescriptorArray::kNotFound) return NOT_FOUND; | 85 if (number == DescriptorArray::kNotFound) return NOT_FOUND; |
85 number_ = static_cast<uint32_t>(number); | 86 number_ = static_cast<uint32_t>(number); |
86 property_details_ = descriptors->GetDetails(number_); | 87 property_details_ = descriptors->GetDetails(number_); |
87 } else if (map->IsGlobalObjectMap()) { | 88 } else if (map->IsGlobalObjectMap()) { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 default: | 133 default: |
133 return NOT_FOUND; | 134 return NOT_FOUND; |
134 } | 135 } |
135 UNREACHABLE(); | 136 UNREACHABLE(); |
136 return state_; | 137 return state_; |
137 } | 138 } |
138 } | 139 } |
139 } // namespace v8::internal | 140 } // namespace v8::internal |
140 | 141 |
141 #endif // V8_LOOKUP_INL_H_ | 142 #endif // V8_LOOKUP_INL_H_ |
OLD | NEW |