Index: src/runtime/runtime-object.cc |
diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc |
index 3b302d160964044fb7e85e1d578e87db11e34496..fc97d6b9a0723bc79093eb0cb7be3316406a147d 100644 |
--- a/src/runtime/runtime-object.cc |
+++ b/src/runtime/runtime-object.cc |
@@ -242,8 +242,10 @@ MaybeHandle<Object> Runtime::DefineObjectProperty(Handle<JSObject> js_object, |
} |
-MaybeHandle<Object> Runtime::GetPrototype(Isolate* isolate, |
- Handle<Object> obj) { |
+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); |
@@ -255,26 +257,15 @@ MaybeHandle<Object> Runtime::GetPrototype(Isolate* isolate, |
isolate->ReportFailedAccessCheck( |
Handle<JSObject>::cast(PrototypeIterator::GetCurrent(iter)), |
v8::ACCESS_GET); |
- RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, Object); |
- return isolate->factory()->undefined_value(); |
+ RETURN_FAILURE_IF_SCHEDULED_EXCEPTION(isolate); |
+ return isolate->heap()->undefined_value(); |
} |
iter.AdvanceIgnoringProxies(); |
if (PrototypeIterator::GetCurrent(iter)->IsJSProxy()) { |
- return PrototypeIterator::GetCurrent(iter); |
+ return *PrototypeIterator::GetCurrent(iter); |
} |
} while (!iter.IsAtEnd(PrototypeIterator::END_AT_NON_HIDDEN)); |
- return PrototypeIterator::GetCurrent(iter); |
-} |
- |
- |
-RUNTIME_FUNCTION(Runtime_GetPrototype) { |
- HandleScope scope(isolate); |
- DCHECK(args.length() == 1); |
- CONVERT_ARG_HANDLE_CHECKED(Object, obj, 0); |
- Handle<Object> result; |
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, |
- Runtime::GetPrototype(isolate, obj)); |
- return *result; |
+ return *PrototypeIterator::GetCurrent(iter); |
} |