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

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

Issue 1182603002: Reland of Remove GetAttributes from the mix to avoid another virtual dispatch. (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 | « src/elements.cc ('k') | 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
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()) { 69 if (js_object->elements() == isolate()->heap()->empty_fixed_array()) {
70 return NOT_FOUND; 70 return NOT_FOUND;
71 } 71 }
72 72
73 ElementsAccessor* accessor = js_object->GetElementsAccessor(); 73 ElementsAccessor* accessor = js_object->GetElementsAccessor();
74 FixedArrayBase* backing_store = js_object->elements(); 74 FixedArrayBase* backing_store = js_object->elements();
75 number_ = accessor->GetIndexForKey(backing_store, index_); 75 number_ = accessor->GetIndexForKey(js_object, backing_store, index_);
76 if (number_ == kMaxUInt32) return NOT_FOUND; 76 if (number_ == kMaxUInt32) return NOT_FOUND;
77 if (accessor->GetAttributes(js_object, index_, backing_store) ==
78 ABSENT) {
79 return NOT_FOUND;
80 }
81 property_details_ = accessor->GetDetails(backing_store, number_); 77 property_details_ = accessor->GetDetails(backing_store, number_);
82 } 78 }
83 } else if (holder->IsGlobalObject()) { 79 } else if (holder->IsGlobalObject()) {
84 GlobalDictionary* dict = JSObject::cast(holder)->global_dictionary(); 80 GlobalDictionary* dict = JSObject::cast(holder)->global_dictionary();
85 int number = dict->FindEntry(name_); 81 int number = dict->FindEntry(name_);
86 if (number == GlobalDictionary::kNotFound) return NOT_FOUND; 82 if (number == GlobalDictionary::kNotFound) return NOT_FOUND;
87 number_ = static_cast<uint32_t>(number); 83 number_ = static_cast<uint32_t>(number);
88 DCHECK(dict->ValueAt(number_)->IsPropertyCell()); 84 DCHECK(dict->ValueAt(number_)->IsPropertyCell());
89 PropertyCell* cell = PropertyCell::cast(dict->ValueAt(number_)); 85 PropertyCell* cell = PropertyCell::cast(dict->ValueAt(number_));
90 if (cell->value()->IsTheHole()) return NOT_FOUND; 86 if (cell->value()->IsTheHole()) return NOT_FOUND;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 default: 130 default:
135 return NOT_FOUND; 131 return NOT_FOUND;
136 } 132 }
137 UNREACHABLE(); 133 UNREACHABLE();
138 return state_; 134 return state_;
139 } 135 }
140 } 136 }
141 } // namespace v8::internal 137 } // namespace v8::internal
142 138
143 #endif // V8_LOOKUP_INL_H_ 139 #endif // V8_LOOKUP_INL_H_
OLDNEW
« no previous file with comments | « src/elements.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698