Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Side by Side Diff: src/lookup-inl.h

Issue 1220813005: Minor performance improvements to the LookupIterator (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update tests Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/lookup.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « src/lookup.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698