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

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

Issue 1163033004: Micro-optimize not-found for elements on objects with empty_fixed_array backing store (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
« no previous file with comments | « no previous file | no next file » | 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 case INTERCEPTOR: 59 case INTERCEPTOR:
60 if (IsElement()) { 60 if (IsElement()) {
61 // TODO(verwaest): Optimize. 61 // TODO(verwaest): Optimize.
62 if (holder->IsStringObjectWithCharacterAt(index_)) { 62 if (holder->IsStringObjectWithCharacterAt(index_)) {
63 PropertyAttributes attributes = 63 PropertyAttributes attributes =
64 static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE); 64 static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE);
65 property_details_ = PropertyDetails(attributes, v8::internal::DATA, 0, 65 property_details_ = PropertyDetails(attributes, v8::internal::DATA, 0,
66 PropertyCellType::kNoCell); 66 PropertyCellType::kNoCell);
67 } else { 67 } else {
68 JSObject* js_object = JSObject::cast(holder); 68 JSObject* js_object = JSObject::cast(holder);
69 if (js_object->elements() == isolate()->heap()->empty_fixed_array()) {
70 return NOT_FOUND;
71 }
72
69 ElementsAccessor* accessor = js_object->GetElementsAccessor(); 73 ElementsAccessor* accessor = js_object->GetElementsAccessor();
70 FixedArrayBase* backing_store = js_object->elements(); 74 FixedArrayBase* backing_store = js_object->elements();
71 number_ = accessor->GetIndexForKey(backing_store, index_); 75 number_ = accessor->GetIndexForKey(backing_store, index_);
72 if (number_ == kMaxUInt32) return NOT_FOUND; 76 if (number_ == kMaxUInt32) return NOT_FOUND;
73 if (accessor->GetAttributes(js_object, index_, backing_store) == 77 if (accessor->GetAttributes(js_object, index_, backing_store) ==
74 ABSENT) { 78 ABSENT) {
75 return NOT_FOUND; 79 return NOT_FOUND;
76 } 80 }
77 property_details_ = accessor->GetDetails(backing_store, number_); 81 property_details_ = accessor->GetDetails(backing_store, number_);
78 } 82 }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 default: 134 default:
131 return NOT_FOUND; 135 return NOT_FOUND;
132 } 136 }
133 UNREACHABLE(); 137 UNREACHABLE();
134 return state_; 138 return state_;
135 } 139 }
136 } 140 }
137 } // namespace v8::internal 141 } // namespace v8::internal
138 142
139 #endif // V8_LOOKUP_INL_H_ 143 #endif // V8_LOOKUP_INL_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698