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

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

Issue 437513002: Inline LookupInHolder and NextHolder (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Don't recreate a handle for the map if it didn't change Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « src/lookup.cc ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef V8_LOOKUP_INL_H_
6 #define V8_LOOKUP_INL_H_
7
8 #include "src/lookup.h"
9
10 namespace v8 {
11 namespace internal {
12
13
14 JSReceiver* LookupIterator::NextHolder(Map* map) {
15 DisallowHeapAllocation no_gc;
16 if (map->prototype()->IsNull()) return NULL;
17
18 JSReceiver* next = JSReceiver::cast(map->prototype());
19 ASSERT(!next->map()->IsGlobalObjectMap() ||
20 next->map()->is_hidden_prototype());
21
22 if (!check_derived() &&
23 !(check_hidden() && next->map()->is_hidden_prototype())) {
24 return NULL;
25 }
26
27 return next;
28 }
29
30
31 LookupIterator::State LookupIterator::LookupInHolder(Map* map) {
32 DisallowHeapAllocation no_gc;
33 switch (state_) {
34 case NOT_FOUND:
35 if (map->IsJSProxyMap()) {
36 return JSPROXY;
37 }
38 if (check_access_check() && map->is_access_check_needed()) {
39 return ACCESS_CHECK;
40 }
41 // Fall through.
42 case ACCESS_CHECK:
43 if (check_interceptor() && map->has_named_interceptor()) {
44 return INTERCEPTOR;
45 }
46 // Fall through.
47 case INTERCEPTOR:
48 if (map->is_dictionary_map()) {
49 property_encoding_ = DICTIONARY;
50 } else {
51 DescriptorArray* descriptors = map->instance_descriptors();
52 number_ = descriptors->SearchWithCache(*name_, map);
53 if (number_ == DescriptorArray::kNotFound) return NOT_FOUND;
54 property_encoding_ = DESCRIPTOR;
55 }
56 return PROPERTY;
57 case PROPERTY:
58 return NOT_FOUND;
59 case JSPROXY:
60 UNREACHABLE();
61 }
62 UNREACHABLE();
63 return state_;
64 }
65 }
66 } // namespace v8::internal
67
68 #endif // V8_LOOKUP_INL_H_
OLDNEW
« no previous file with comments | « src/lookup.cc ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698