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

Unified Diff: src/lookup.cc

Issue 1144883002: Start adding support for elements to the LookupIterator (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/lookup.h ('k') | src/lookup-inl.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 85745ce3e573321ac29feebd0a8b14c9a02b9341..8eb5571e51e8dec93eae765b6bc79da9dd877097 100644
--- a/src/lookup.cc
+++ b/src/lookup.cc
@@ -145,7 +145,7 @@ void LookupIterator::PrepareTransitionToDataProperty(
DCHECK(state_ != LookupIterator::ACCESSOR ||
(GetAccessors()->IsAccessorInfo() &&
AccessorInfo::cast(*GetAccessors())->is_special_data_property()));
- DCHECK_NE(LookupIterator::INTEGER_INDEXED_EXOTIC, state_);
+ DCHECK_NE(INTEGER_INDEXED_EXOTIC, state_);
DCHECK(state_ == NOT_FOUND || !HolderIsReceiverOrHiddenPrototype());
// Can only be called when the receiver is a JSObject. JSProxy has to be
// handled via a trap. Adding properties to primitive values is not
@@ -355,10 +355,10 @@ void LookupIterator::WriteDataValue(Handle<Object> value) {
bool LookupIterator::IsIntegerIndexedExotic(JSReceiver* holder) {
- DCHECK(exotic_index_state_ != ExoticIndexState::kNoIndex);
+ DCHECK(ExoticIndexState::kNotExotic != exotic_index_state_);
// Currently typed arrays are the only such objects.
if (!holder->IsJSTypedArray()) return false;
- if (exotic_index_state_ == ExoticIndexState::kIndex) return true;
+ if (exotic_index_state_ == ExoticIndexState::kExotic) return true;
DCHECK(exotic_index_state_ == ExoticIndexState::kUninitialized);
bool result = false;
// Compute and cache result.
@@ -369,7 +369,7 @@ bool LookupIterator::IsIntegerIndexedExotic(JSReceiver* holder) {
}
}
exotic_index_state_ =
- result ? ExoticIndexState::kIndex : ExoticIndexState::kNoIndex;
+ result ? ExoticIndexState::kExotic : ExoticIndexState::kNotExotic;
return result;
}
@@ -380,6 +380,12 @@ void LookupIterator::InternalizeName() {
}
+bool LookupIterator::HasInterceptor(Map* map) const {
+ if (IsElement()) return map->has_indexed_interceptor();
+ return map->has_named_interceptor();
+}
+
+
bool LookupIterator::SkipInterceptor(JSObject* holder) {
auto info = holder->GetNamedInterceptor();
// TODO(dcarney): check for symbol/can_intercept_symbols here as well.
« no previous file with comments | « src/lookup.h ('k') | src/lookup-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698