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

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

Issue 1492863002: [proxies] Make Object.prototype.isPrototypeOf work with proxies. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address 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
« no previous file with comments | « src/objects.cc ('k') | src/prototype.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after
1190 1190
1191 MaybeHandle<Object> Object::GetPrototype(Isolate* isolate, 1191 MaybeHandle<Object> Object::GetPrototype(Isolate* isolate,
1192 Handle<Object> receiver) { 1192 Handle<Object> receiver) {
1193 // We don't expect access checks to be needed on JSProxy objects. 1193 // We don't expect access checks to be needed on JSProxy objects.
1194 DCHECK(!receiver->IsAccessCheckNeeded() || receiver->IsJSObject()); 1194 DCHECK(!receiver->IsAccessCheckNeeded() || receiver->IsJSObject());
1195 Handle<Context> context(isolate->context()); 1195 Handle<Context> context(isolate->context());
1196 if (receiver->IsAccessCheckNeeded() && 1196 if (receiver->IsAccessCheckNeeded() &&
1197 !isolate->MayAccess(context, Handle<JSObject>::cast(receiver))) { 1197 !isolate->MayAccess(context, Handle<JSObject>::cast(receiver))) {
1198 return isolate->factory()->null_value(); 1198 return isolate->factory()->null_value();
1199 } 1199 }
1200 if (receiver->IsJSProxy()) {
1201 return JSProxy::GetPrototype(Handle<JSProxy>::cast(receiver));
1202 }
1203 PrototypeIterator iter(isolate, receiver, 1200 PrototypeIterator iter(isolate, receiver,
1204 PrototypeIterator::START_AT_RECEIVER); 1201 PrototypeIterator::START_AT_RECEIVER);
1205 do { 1202 do {
1206 iter.AdvanceIgnoringProxies(); 1203 if (!iter.AdvanceFollowingProxies()) return MaybeHandle<Object>();
1207 if (PrototypeIterator::GetCurrent(iter)->IsJSProxy()) {
1208 return PrototypeIterator::GetCurrent(iter);
1209 }
1210 } while (!iter.IsAtEnd(PrototypeIterator::END_AT_NON_HIDDEN)); 1204 } while (!iter.IsAtEnd(PrototypeIterator::END_AT_NON_HIDDEN));
1211 return PrototypeIterator::GetCurrent(iter); 1205 return PrototypeIterator::GetCurrent(iter);
1212 } 1206 }
1213 1207
1214 1208
1215 MaybeHandle<Object> Object::GetProperty(Isolate* isolate, Handle<Object> object, 1209 MaybeHandle<Object> Object::GetProperty(Isolate* isolate, Handle<Object> object,
1216 const char* name, 1210 const char* name,
1217 LanguageMode language_mode) { 1211 LanguageMode language_mode) {
1218 Handle<String> str = isolate->factory()->InternalizeUtf8String(name); 1212 Handle<String> str = isolate->factory()->InternalizeUtf8String(name);
1219 return GetProperty(object, str, language_mode); 1213 return GetProperty(object, str, language_mode);
(...skipping 6636 matching lines...) Expand 10 before | Expand all | Expand 10 after
7856 #undef WRITE_INT64_FIELD 7850 #undef WRITE_INT64_FIELD
7857 #undef READ_BYTE_FIELD 7851 #undef READ_BYTE_FIELD
7858 #undef WRITE_BYTE_FIELD 7852 #undef WRITE_BYTE_FIELD
7859 #undef NOBARRIER_READ_BYTE_FIELD 7853 #undef NOBARRIER_READ_BYTE_FIELD
7860 #undef NOBARRIER_WRITE_BYTE_FIELD 7854 #undef NOBARRIER_WRITE_BYTE_FIELD
7861 7855
7862 } // namespace internal 7856 } // namespace internal
7863 } // namespace v8 7857 } // namespace v8
7864 7858
7865 #endif // V8_OBJECTS_INL_H_ 7859 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/prototype.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698