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

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

Issue 1159433003: Use GetProperty for getting elements. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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
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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 IsIntegerIndexedExotic(holder)) { 51 IsIntegerIndexedExotic(holder)) {
52 return INTEGER_INDEXED_EXOTIC; 52 return INTEGER_INDEXED_EXOTIC;
53 } 53 }
54 if (check_interceptor() && HasInterceptor(map) && 54 if (check_interceptor() && HasInterceptor(map) &&
55 !SkipInterceptor(JSObject::cast(holder))) { 55 !SkipInterceptor(JSObject::cast(holder))) {
56 return INTERCEPTOR; 56 return INTERCEPTOR;
57 } 57 }
58 // Fall through. 58 // Fall through.
59 case INTERCEPTOR: 59 case INTERCEPTOR:
60 if (IsElement()) { 60 if (IsElement()) {
61 // TODO(verwaest): Optimize.
61 JSObject* js_object = JSObject::cast(holder); 62 JSObject* js_object = JSObject::cast(holder);
62 ElementsAccessor* accessor = js_object->GetElementsAccessor(); 63 ElementsAccessor* accessor = js_object->GetElementsAccessor();
63 FixedArrayBase* backing_store = js_object->elements(); 64 FixedArrayBase* backing_store = js_object->elements();
64 number_ = accessor->GetIndexForKey(backing_store, index_); 65 number_ = accessor->GetIndexForKey(backing_store, index_);
65 if (number_ == kMaxUInt32) return NOT_FOUND; 66 if (number_ == kMaxUInt32) return NOT_FOUND;
67 if (accessor->GetAttributes(js_object, index_, backing_store) ==
68 ABSENT) {
69 return NOT_FOUND;
70 }
66 property_details_ = accessor->GetDetails(backing_store, number_); 71 property_details_ = accessor->GetDetails(backing_store, number_);
67 } else if (map->is_dictionary_map()) { 72 } else if (map->is_dictionary_map()) {
68 NameDictionary* dict = JSObject::cast(holder)->property_dictionary(); 73 NameDictionary* dict = JSObject::cast(holder)->property_dictionary();
69 int number = dict->FindEntry(name_); 74 int number = dict->FindEntry(name_);
70 if (number == NameDictionary::kNotFound) return NOT_FOUND; 75 if (number == NameDictionary::kNotFound) return NOT_FOUND;
71 number_ = static_cast<uint32_t>(number); 76 number_ = static_cast<uint32_t>(number);
72 if (holder->IsGlobalObject()) { 77 if (holder->IsGlobalObject()) {
73 DCHECK(dict->ValueAt(number_)->IsPropertyCell()); 78 DCHECK(dict->ValueAt(number_)->IsPropertyCell());
74 PropertyCell* cell = PropertyCell::cast(dict->ValueAt(number_)); 79 PropertyCell* cell = PropertyCell::cast(dict->ValueAt(number_));
75 if (cell->value()->IsTheHole()) return NOT_FOUND; 80 if (cell->value()->IsTheHole()) return NOT_FOUND;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 default: 119 default:
115 return NOT_FOUND; 120 return NOT_FOUND;
116 } 121 }
117 UNREACHABLE(); 122 UNREACHABLE();
118 return state_; 123 return state_;
119 } 124 }
120 } 125 }
121 } // namespace v8::internal 126 } // namespace v8::internal
122 127
123 #endif // V8_LOOKUP_INL_H_ 128 #endif // V8_LOOKUP_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698