| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 case INTERCEPTOR: | 59 case INTERCEPTOR: |
| 60 if (IsElement()) { | 60 if (IsElement()) { |
| 61 // TODO(verwaest): Optimize. | 61 // TODO(verwaest): Optimize. |
| 62 if (holder->IsStringObjectWithCharacterAt(index_)) { | 62 if (holder->IsStringObjectWithCharacterAt(index_)) { |
| 63 PropertyAttributes attributes = | 63 PropertyAttributes attributes = |
| 64 static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE); | 64 static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE); |
| 65 property_details_ = PropertyDetails(attributes, v8::internal::DATA, 0, | 65 property_details_ = PropertyDetails(attributes, v8::internal::DATA, 0, |
| 66 PropertyCellType::kNoCell); | 66 PropertyCellType::kNoCell); |
| 67 } else { | 67 } else { |
| 68 JSObject* js_object = JSObject::cast(holder); | 68 JSObject* js_object = JSObject::cast(holder); |
| 69 if (js_object->elements() == isolate()->heap()->empty_fixed_array()) { |
| 70 return NOT_FOUND; |
| 71 } |
| 72 |
| 69 ElementsAccessor* accessor = js_object->GetElementsAccessor(); | 73 ElementsAccessor* accessor = js_object->GetElementsAccessor(); |
| 70 FixedArrayBase* backing_store = js_object->elements(); | 74 FixedArrayBase* backing_store = js_object->elements(); |
| 71 number_ = accessor->GetIndexForKey(backing_store, index_); | 75 number_ = accessor->GetIndexForKey(backing_store, index_); |
| 72 if (number_ == kMaxUInt32) return NOT_FOUND; | 76 if (number_ == kMaxUInt32) return NOT_FOUND; |
| 73 if (accessor->GetAttributes(js_object, index_, backing_store) == | 77 if (accessor->GetAttributes(js_object, index_, backing_store) == |
| 74 ABSENT) { | 78 ABSENT) { |
| 75 return NOT_FOUND; | 79 return NOT_FOUND; |
| 76 } | 80 } |
| 77 property_details_ = accessor->GetDetails(backing_store, number_); | 81 property_details_ = accessor->GetDetails(backing_store, number_); |
| 78 } | 82 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 default: | 134 default: |
| 131 return NOT_FOUND; | 135 return NOT_FOUND; |
| 132 } | 136 } |
| 133 UNREACHABLE(); | 137 UNREACHABLE(); |
| 134 return state_; | 138 return state_; |
| 135 } | 139 } |
| 136 } | 140 } |
| 137 } // namespace v8::internal | 141 } // namespace v8::internal |
| 138 | 142 |
| 139 #endif // V8_LOOKUP_INL_H_ | 143 #endif // V8_LOOKUP_INL_H_ |
| OLD | NEW |