| 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" |
| 11 | 11 |
| 12 namespace v8 { | 12 namespace v8 { |
| 13 namespace internal { | 13 namespace internal { |
| 14 | 14 |
| 15 | 15 |
| 16 JSReceiver* LookupIterator::NextHolder(Map* map) { | 16 JSReceiver* LookupIterator::NextHolder(Map* map) { |
| 17 DisallowHeapAllocation no_gc; | 17 DisallowHeapAllocation no_gc; |
| 18 if (map->prototype()->IsNull()) return NULL; | 18 if (!map->prototype()->IsJSReceiver()) return NULL; |
| 19 | 19 |
| 20 JSReceiver* next = JSReceiver::cast(map->prototype()); | 20 JSReceiver* next = JSReceiver::cast(map->prototype()); |
| 21 DCHECK(!next->map()->IsGlobalObjectMap() || | 21 DCHECK(!next->map()->IsGlobalObjectMap() || |
| 22 next->map()->is_hidden_prototype()); | 22 next->map()->is_hidden_prototype()); |
| 23 | 23 |
| 24 if (!check_prototype_chain() && | 24 if (!check_prototype_chain() && |
| 25 !(check_hidden() && next->map()->is_hidden_prototype()) && | 25 !(check_hidden() && next->map()->is_hidden_prototype()) && |
| 26 // Always lookup behind the JSGlobalProxy into the JSGlobalObject, even | 26 // Always lookup behind the JSGlobalProxy into the JSGlobalObject, even |
| 27 // when not checking other hidden prototypes. | 27 // when not checking other hidden prototypes. |
| 28 !map->IsJSGlobalProxyMap()) { | 28 !map->IsJSGlobalProxyMap()) { |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 default: | 132 default: |
| 133 return NOT_FOUND; | 133 return NOT_FOUND; |
| 134 } | 134 } |
| 135 UNREACHABLE(); | 135 UNREACHABLE(); |
| 136 return state_; | 136 return state_; |
| 137 } | 137 } |
| 138 } | 138 } |
| 139 } // namespace v8::internal | 139 } // namespace v8::internal |
| 140 | 140 |
| 141 #endif // V8_LOOKUP_INL_H_ | 141 #endif // V8_LOOKUP_INL_H_ |
| OLD | NEW |