summaryrefslogtreecommitdiff
path: root/deps/v8/src/lookup.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/lookup.h')
-rw-r--r--deps/v8/src/lookup.h33
1 files changed, 24 insertions, 9 deletions
diff --git a/deps/v8/src/lookup.h b/deps/v8/src/lookup.h
index 5396619852..7d689560b8 100644
--- a/deps/v8/src/lookup.h
+++ b/deps/v8/src/lookup.h
@@ -203,10 +203,13 @@ class LookupIterator final BASE_EMBEDDED {
DCHECK(IsFound());
return Handle<T>::cast(holder_);
}
- static Handle<JSReceiver> GetRoot(Isolate* isolate, Handle<Object> receiver,
- uint32_t index = kMaxUInt32);
+
bool HolderIsReceiverOrHiddenPrototype() const;
+ bool check_prototype_chain() const {
+ return (configuration_ & kPrototypeChain) != 0;
+ }
+
/* ACCESS_CHECK */
bool HasAccess() const;
@@ -245,7 +248,10 @@ class LookupIterator final BASE_EMBEDDED {
int GetConstantIndex() const;
Handle<PropertyCell> GetPropertyCell() const;
Handle<Object> GetAccessors() const;
- Handle<InterceptorInfo> GetInterceptor() const;
+ inline Handle<InterceptorInfo> GetInterceptor() const {
+ DCHECK_EQ(INTERCEPTOR, state_);
+ return handle(GetInterceptor(JSObject::cast(*holder_)), isolate_);
+ }
Handle<Object> GetDataValue() const;
void WriteDataValue(Handle<Object> value);
void InternalizeName();
@@ -269,18 +275,18 @@ class LookupIterator final BASE_EMBEDDED {
State LookupNonMaskingInterceptorInHolder(Map* map, JSReceiver* holder);
Handle<Object> FetchValue() const;
void ReloadPropertyInformation();
- bool SkipInterceptor(JSObject* holder);
+ inline bool SkipInterceptor(JSObject* holder);
bool HasInterceptor(Map* map) const;
bool InternalHolderIsReceiverOrHiddenPrototype() const;
- InterceptorInfo* GetInterceptor(JSObject* holder) const;
+ inline InterceptorInfo* GetInterceptor(JSObject* holder) const {
+ if (IsElement()) return holder->GetIndexedInterceptor();
+ return holder->GetNamedInterceptor();
+ }
bool check_hidden() const { return (configuration_ & kHidden) != 0; }
bool check_interceptor() const {
return (configuration_ & kInterceptor) != 0;
}
- bool check_prototype_chain() const {
- return (configuration_ & kPrototypeChain) != 0;
- }
int descriptor_number() const {
DCHECK(has_property_);
DCHECK(!holder_map_->is_dictionary_map());
@@ -302,8 +308,17 @@ class LookupIterator final BASE_EMBEDDED {
}
}
+ static Handle<JSReceiver> GetRootForNonJSReceiver(
+ Isolate* isolate, Handle<Object> receiver, uint32_t index = kMaxUInt32);
+ inline static Handle<JSReceiver> GetRoot(Isolate* isolate,
+ Handle<Object> receiver,
+ uint32_t index = kMaxUInt32) {
+ if (receiver->IsJSReceiver()) return Handle<JSReceiver>::cast(receiver);
+ return GetRootForNonJSReceiver(isolate, receiver, index);
+ }
+
enum class ExoticIndexState { kUninitialized, kNotExotic, kExotic };
- bool IsIntegerIndexedExotic(JSReceiver* holder);
+ inline bool IsIntegerIndexedExotic(JSReceiver* holder);
// If configuration_ becomes mutable, update
// HolderIsReceiverOrHiddenPrototype.