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

Side by Side Diff: src/objects-inl.h

Issue 1521953002: [proxies] fix access issue when having proxies on the prototype-chain of global objects. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: better comment Created 5 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Review notes: 5 // Review notes:
6 // 6 //
7 // - The use of macros in these inline functions may seem superfluous 7 // - The use of macros in these inline functions may seem superfluous
8 // but it is absolutely needed to make sure gcc generates optimal 8 // but it is absolutely needed to make sure gcc generates optimal
9 // code. gcc is not happy when attempting to inline too deep. 9 // code. gcc is not happy when attempting to inline too deep.
10 // 10 //
(...skipping 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after
1180 MAYBE_RETURN_NULL( 1180 MAYBE_RETURN_NULL(
1181 SetProperty(&it, value, language_mode, MAY_BE_STORE_FROM_KEYED)); 1181 SetProperty(&it, value, language_mode, MAY_BE_STORE_FROM_KEYED));
1182 return value; 1182 return value;
1183 } 1183 }
1184 1184
1185 1185
1186 MaybeHandle<Object> Object::GetPrototype(Isolate* isolate, 1186 MaybeHandle<Object> Object::GetPrototype(Isolate* isolate,
1187 Handle<Object> receiver) { 1187 Handle<Object> receiver) {
1188 // We don't expect access checks to be needed on JSProxy objects. 1188 // We don't expect access checks to be needed on JSProxy objects.
1189 DCHECK(!receiver->IsAccessCheckNeeded() || receiver->IsJSObject()); 1189 DCHECK(!receiver->IsAccessCheckNeeded() || receiver->IsJSObject());
1190 Handle<Context> context(isolate->context());
1191 if (receiver->IsAccessCheckNeeded() &&
1192 !isolate->MayAccess(context, Handle<JSObject>::cast(receiver))) {
1193 return isolate->factory()->null_value();
1194 }
1195 PrototypeIterator iter(isolate, receiver, 1190 PrototypeIterator iter(isolate, receiver,
1196 PrototypeIterator::START_AT_RECEIVER); 1191 PrototypeIterator::START_AT_RECEIVER);
1197 do { 1192 do {
1193 if (!iter.HasAccess()) return isolate->factory()->null_value();
1198 if (!iter.AdvanceFollowingProxies()) return MaybeHandle<Object>(); 1194 if (!iter.AdvanceFollowingProxies()) return MaybeHandle<Object>();
1199 } while (!iter.IsAtEnd(PrototypeIterator::END_AT_NON_HIDDEN)); 1195 } while (!iter.IsAtEnd(PrototypeIterator::END_AT_NON_HIDDEN));
1200 return PrototypeIterator::GetCurrent(iter); 1196 return PrototypeIterator::GetCurrent(iter);
1201 } 1197 }
1202 1198
1203 1199
1204 MaybeHandle<Object> Object::GetProperty(Isolate* isolate, Handle<Object> object, 1200 MaybeHandle<Object> Object::GetProperty(Isolate* isolate, Handle<Object> object,
1205 const char* name, 1201 const char* name,
1206 LanguageMode language_mode) { 1202 LanguageMode language_mode) {
1207 Handle<String> str = isolate->factory()->InternalizeUtf8String(name); 1203 Handle<String> str = isolate->factory()->InternalizeUtf8String(name);
(...skipping 6679 matching lines...) Expand 10 before | Expand all | Expand 10 after
7887 #undef WRITE_INT64_FIELD 7883 #undef WRITE_INT64_FIELD
7888 #undef READ_BYTE_FIELD 7884 #undef READ_BYTE_FIELD
7889 #undef WRITE_BYTE_FIELD 7885 #undef WRITE_BYTE_FIELD
7890 #undef NOBARRIER_READ_BYTE_FIELD 7886 #undef NOBARRIER_READ_BYTE_FIELD
7891 #undef NOBARRIER_WRITE_BYTE_FIELD 7887 #undef NOBARRIER_WRITE_BYTE_FIELD
7892 7888
7893 } // namespace internal 7889 } // namespace internal
7894 } // namespace v8 7890 } // namespace v8
7895 7891
7896 #endif // V8_OBJECTS_INL_H_ 7892 #endif // V8_OBJECTS_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698