Commit 26496111 authored by verwaest's avatar verwaest Committed by Commit bot

[runtime] Speed up Object::ToObject with JSReceiver argument.

This avoids having to read the context and call through from the inlined
path in the JSReceiver case.

BUG=

Review URL: https://codereview.chromium.org/1698463002

Cr-Commit-Position: refs/heads/master@{#33949}
parent c67262d4
......@@ -1143,8 +1143,8 @@ bool Object::FitsRepresentation(Representation representation) {
// static
MaybeHandle<JSReceiver> Object::ToObject(Isolate* isolate,
Handle<Object> object) {
return ToObject(
isolate, object, handle(isolate->context()->native_context(), isolate));
if (object->IsJSReceiver()) return Handle<JSReceiver>::cast(object);
return ToObject(isolate, object, isolate->native_context());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment