Index: src/runtime/runtime-object.cc |
diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc |
index 3d02572a0e0cae4c6a8ef8defcc932bf035d36eb..4f55dafbc0f52cc77baeedae2b6a5669a5328fff 100644 |
--- a/src/runtime/runtime-object.cc |
+++ b/src/runtime/runtime-object.cc |
@@ -157,22 +157,7 @@ RUNTIME_FUNCTION(Runtime_GetPrototype) { |
HandleScope scope(isolate); |
DCHECK(args.length() == 1); |
CONVERT_ARG_HANDLE_CHECKED(Object, obj, 0); |
- // We don't expect access checks to be needed on JSProxy objects. |
- DCHECK(!obj->IsAccessCheckNeeded() || obj->IsJSObject()); |
- PrototypeIterator iter(isolate, obj, PrototypeIterator::START_AT_RECEIVER); |
- Handle<Context> context(isolate->context()); |
- do { |
- if (PrototypeIterator::GetCurrent(iter)->IsAccessCheckNeeded() && |
- !isolate->MayAccess(context, |
- PrototypeIterator::GetCurrent<JSObject>(iter))) { |
- return isolate->heap()->null_value(); |
- } |
- iter.AdvanceIgnoringProxies(); |
- if (PrototypeIterator::GetCurrent(iter)->IsJSProxy()) { |
- return *PrototypeIterator::GetCurrent(iter); |
- } |
- } while (!iter.IsAtEnd(PrototypeIterator::END_AT_NON_HIDDEN)); |
- return *PrototypeIterator::GetCurrent(iter); |
+ return *Object::GetPrototype(isolate, obj); |
} |
@@ -202,14 +187,12 @@ RUNTIME_FUNCTION(Runtime_SetPrototype) { |
return isolate->heap()->undefined_value(); |
} |
if (obj->map()->is_observed()) { |
- Handle<Object> old_value = |
- Object::GetPrototypeSkipHiddenPrototypes(isolate, obj); |
+ Handle<Object> old_value = Object::GetPrototypeWithAccess(isolate, obj); |
Handle<Object> result; |
ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
isolate, result, JSObject::SetPrototype(obj, prototype, true)); |
- Handle<Object> new_value = |
- Object::GetPrototypeSkipHiddenPrototypes(isolate, obj); |
+ Handle<Object> new_value = Object::GetPrototypeWithAccess(isolate, obj); |
if (!new_value->SameValue(*old_value)) { |
RETURN_FAILURE_ON_EXCEPTION( |
isolate, JSObject::EnqueueChangeRecord( |