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

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

Issue 570293002: Simplify the LookupIterator (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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') | src/objects.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 namespace v8 { 10 namespace v8 {
(...skipping 29 matching lines...) Expand all
40 if (map->IsJSProxyMap()) return JSPROXY; 40 if (map->IsJSProxyMap()) return JSPROXY;
41 if (map->is_access_check_needed()) return ACCESS_CHECK; 41 if (map->is_access_check_needed()) return ACCESS_CHECK;
42 // Fall through. 42 // Fall through.
43 case ACCESS_CHECK: 43 case ACCESS_CHECK:
44 if (check_interceptor() && map->has_named_interceptor()) { 44 if (check_interceptor() && map->has_named_interceptor()) {
45 return INTERCEPTOR; 45 return INTERCEPTOR;
46 } 46 }
47 // Fall through. 47 // Fall through.
48 case INTERCEPTOR: 48 case INTERCEPTOR:
49 if (map->is_dictionary_map()) { 49 if (map->is_dictionary_map()) {
50 if (holder == NULL) return UNKNOWN;
51 NameDictionary* dict = JSObject::cast(holder)->property_dictionary(); 50 NameDictionary* dict = JSObject::cast(holder)->property_dictionary();
52 number_ = dict->FindEntry(name_); 51 number_ = dict->FindEntry(name_);
53 if (number_ == NameDictionary::kNotFound) return NOT_FOUND; 52 if (number_ == NameDictionary::kNotFound) return NOT_FOUND;
54 property_details_ = dict->DetailsAt(number_); 53 property_details_ = dict->DetailsAt(number_);
55 if (holder->IsGlobalObject()) { 54 if (holder->IsGlobalObject()) {
56 if (property_details_.IsDeleted()) return NOT_FOUND; 55 if (property_details_.IsDeleted()) return NOT_FOUND;
57 PropertyCell* cell = PropertyCell::cast(dict->ValueAt(number_)); 56 PropertyCell* cell = PropertyCell::cast(dict->ValueAt(number_));
58 if (cell->value()->IsTheHole()) return NOT_FOUND; 57 if (cell->value()->IsTheHole()) return NOT_FOUND;
59 } 58 }
60 } else { 59 } else {
61 DescriptorArray* descriptors = map->instance_descriptors(); 60 DescriptorArray* descriptors = map->instance_descriptors();
62 number_ = descriptors->SearchWithCache(*name_, map); 61 number_ = descriptors->SearchWithCache(*name_, map);
63 if (number_ == DescriptorArray::kNotFound) return NOT_FOUND; 62 if (number_ == DescriptorArray::kNotFound) return NOT_FOUND;
64 property_details_ = descriptors->GetDetails(number_); 63 property_details_ = descriptors->GetDetails(number_);
65 } 64 }
66 has_property_ = true; 65 has_property_ = true;
67 switch (property_details_.type()) { 66 switch (property_details_.type()) {
68 case v8::internal::CONSTANT: 67 case v8::internal::CONSTANT:
69 case v8::internal::FIELD: 68 case v8::internal::FIELD:
70 case v8::internal::NORMAL: 69 case v8::internal::NORMAL:
71 return DATA; 70 return DATA;
72 case v8::internal::CALLBACKS: 71 case v8::internal::CALLBACKS:
73 return ACCESSOR; 72 return ACCESSOR;
74 } 73 }
75 case ACCESSOR: 74 case ACCESSOR:
76 case DATA: 75 case DATA:
77 case UNKNOWN:
78 return NOT_FOUND; 76 return NOT_FOUND;
79 case JSPROXY: 77 case JSPROXY:
80 case TRANSITION: 78 case TRANSITION:
81 UNREACHABLE(); 79 UNREACHABLE();
82 } 80 }
83 UNREACHABLE(); 81 UNREACHABLE();
84 return state_; 82 return state_;
85 } 83 }
86 } 84 }
87 } // namespace v8::internal 85 } // namespace v8::internal
88 86
89 #endif // V8_LOOKUP_INL_H_ 87 #endif // V8_LOOKUP_INL_H_
OLDNEW
« no previous file with comments | « src/lookup.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698