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

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 50f4b0fcc9ddad89849b64fa71183077f8f97480..18bcbc50c5de7c2729fd771247980dcdc1e37764 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;
@@ -44,7 +47,8 @@ LookupIterator::State LookupIterator::LookupInHolder(Map* map,
}
// Fall through.
case ACCESS_CHECK:
- if (check_interceptor() && map->has_named_interceptor()) {
+ if (check_interceptor() && map->has_named_interceptor() &&
+ !SkipInterceptor(JSObject::cast(holder))) {
return INTERCEPTOR;
}
// Fall through.
@@ -82,6 +86,29 @@ 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 (map->is_access_check_needed() &&
+ !isolate_->IsInternallyUsedPropertyName(name_)) {
Toon Verwaest 2015/03/11 14:09:35 You don't need these, given that you had to have a
+ return ACCESS_CHECK;
+ }
+ // Fall through.
+ case ACCESS_CHECK:
+ 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