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 1159433003: Use GetProperty for getting elements. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments 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
« no previous file with comments | « src/lookup.cc ('k') | src/objects.h » ('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 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 (holder->IsGlobalObject()) { 72 } else if (holder->IsGlobalObject()) {
68 GlobalDictionary* dict = JSObject::cast(holder)->global_dictionary(); 73 GlobalDictionary* dict = JSObject::cast(holder)->global_dictionary();
69 int number = dict->FindEntry(name_); 74 int number = dict->FindEntry(name_);
70 if (number == GlobalDictionary::kNotFound) return NOT_FOUND; 75 if (number == GlobalDictionary::kNotFound) return NOT_FOUND;
71 number_ = static_cast<uint32_t>(number); 76 number_ = static_cast<uint32_t>(number);
72 DCHECK(dict->ValueAt(number_)->IsPropertyCell()); 77 DCHECK(dict->ValueAt(number_)->IsPropertyCell());
73 PropertyCell* cell = PropertyCell::cast(dict->ValueAt(number_)); 78 PropertyCell* cell = PropertyCell::cast(dict->ValueAt(number_));
74 if (cell->value()->IsTheHole()) return NOT_FOUND; 79 if (cell->value()->IsTheHole()) return NOT_FOUND;
75 property_details_ = dict->DetailsAt(number_); 80 property_details_ = dict->DetailsAt(number_);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 default: 123 default:
119 return NOT_FOUND; 124 return NOT_FOUND;
120 } 125 }
121 UNREACHABLE(); 126 UNREACHABLE();
122 return state_; 127 return state_;
123 } 128 }
124 } 129 }
125 } // namespace v8::internal 130 } // namespace v8::internal
126 131
127 #endif // V8_LOOKUP_INL_H_ 132 #endif // V8_LOOKUP_INL_H_
OLDNEW
« no previous file with comments | « src/lookup.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698