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

Unified Diff: src/lookup.cc

Issue 1473023004: Inline functions to speedup GetElement (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/lookup.h ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lookup.cc
diff --git a/src/lookup.cc b/src/lookup.cc
index f60563b19e603d0ab78af41a6fe0adc73ea8379e..be0edaa3a27b965c2d46882c8908b39c78d7c112 100644
--- a/src/lookup.cc
+++ b/src/lookup.cc
@@ -92,10 +92,8 @@ void LookupIterator::RestartInternal(InterceptorState interceptor_state) {
// static
-Handle<JSReceiver> LookupIterator::GetRoot(Isolate* isolate,
- Handle<Object> receiver,
- uint32_t index) {
- if (receiver->IsJSReceiver()) return Handle<JSReceiver>::cast(receiver);
+Handle<JSReceiver> LookupIterator::GetRootForNonJSReceiver(
+ Isolate* isolate, Handle<Object> receiver, uint32_t index) {
// Strings are the only objects with properties (only elements) directly on
// the wrapper. Hence we can skip generating the wrapper for all other cases.
if (index != kMaxUInt32 && receiver->IsString() &&
@@ -530,8 +528,6 @@ void LookupIterator::WriteDataValue(Handle<Object> value) {
bool LookupIterator::IsIntegerIndexedExotic(JSReceiver* holder) {
DCHECK(exotic_index_state_ != ExoticIndexState::kNotExotic);
- // Currently typed arrays are the only such objects.
- if (!holder->IsJSTypedArray()) return false;
if (exotic_index_state_ == ExoticIndexState::kExotic) return true;
if (!InternalHolderIsReceiverOrHiddenPrototype()) {
exotic_index_state_ = ExoticIndexState::kNotExotic;
@@ -566,18 +562,6 @@ bool LookupIterator::HasInterceptor(Map* map) const {
}
-Handle<InterceptorInfo> LookupIterator::GetInterceptor() const {
- DCHECK_EQ(INTERCEPTOR, state_);
- return handle(GetInterceptor(JSObject::cast(*holder_)), isolate_);
-}
-
-
-InterceptorInfo* LookupIterator::GetInterceptor(JSObject* holder) const {
- if (IsElement()) return holder->GetIndexedInterceptor();
- return holder->GetNamedInterceptor();
-}
-
-
bool LookupIterator::SkipInterceptor(JSObject* holder) {
auto info = GetInterceptor(holder);
// TODO(dcarney): check for symbol/can_intercept_symbols here as well.
@@ -633,7 +617,7 @@ LookupIterator::State LookupIterator::LookupInHolder(Map* const map,
// Fall through.
case ACCESS_CHECK:
if (exotic_index_state_ != ExoticIndexState::kNotExotic &&
- IsIntegerIndexedExotic(holder)) {
+ holder->IsJSTypedArray() && IsIntegerIndexedExotic(holder)) {
return INTEGER_INDEXED_EXOTIC;
}
if (check_interceptor() && HasInterceptor(map) &&
« no previous file with comments | « src/lookup.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698