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

Unified Diff: src/lookup-inl.h

Issue 962613002: add interceptors which do not mask existing properties (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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.cc ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lookup-inl.h
diff --git a/src/lookup-inl.h b/src/lookup-inl.h
index 03fbac02c5f3e09a3dbf88e959224d1250fed377..ae09b545d9095dea90b9c44efea0b51af428aeee 100644
--- a/src/lookup-inl.h
+++ b/src/lookup-inl.h
@@ -31,10 +31,13 @@ JSReceiver* LookupIterator::NextHolder(Map* map) {
}
-LookupIterator::State LookupIterator::LookupInHolder(Map* map,
- JSReceiver* holder) {
+LookupIterator::State LookupIterator::LookupInHolder(Map* const map,
+ JSReceiver* const holder) {
STATIC_ASSERT(INTERCEPTOR == BEFORE_PROPERTY);
DisallowHeapAllocation no_gc;
+ if (interceptor_state_ == InterceptorState::kProcessNonMasking) {
+ return LookupNonMaskingInterceptorInHolder(map, holder);
+ }
switch (state_) {
case NOT_FOUND:
if (map->IsJSProxyMap()) return JSPROXY;
@@ -48,7 +51,8 @@ LookupIterator::State LookupIterator::LookupInHolder(Map* map,
IsIntegerIndexedExotic(holder)) {
return INTEGER_INDEXED_EXOTIC;
}
- if (check_interceptor() && map->has_named_interceptor()) {
+ if (check_interceptor() && map->has_named_interceptor() &&
+ !SkipInterceptor(JSObject::cast(holder))) {
return INTERCEPTOR;
}
// Fall through.
@@ -86,6 +90,23 @@ LookupIterator::State LookupIterator::LookupInHolder(Map* map,
UNREACHABLE();
return state_;
}
+
+
+LookupIterator::State LookupIterator::LookupNonMaskingInterceptorInHolder(
+ Map* const map, JSReceiver* const holder) {
+ switch (state_) {
+ case NOT_FOUND:
+ if (check_interceptor() && map->has_named_interceptor() &&
+ !SkipInterceptor(JSObject::cast(holder))) {
+ return INTERCEPTOR;
+ }
+ // Fall through.
+ default:
+ return NOT_FOUND;
+ }
+ UNREACHABLE();
+ return state_;
+}
}
} // namespace v8::internal
« no previous file with comments | « src/lookup.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698