Commit ed6e1735 authored by jkummerow's avatar jkummerow Committed by Commit bot

Add fast path for array indices to Runtime_HasOwnProperty

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

Cr-Commit-Position: refs/heads/master@{#25823}
parent c060f4e2
......@@ -815,7 +815,12 @@ RUNTIME_FUNCTION(Runtime_HasOwnProperty) {
// Fast case: either the key is a real named property or it is not
// an array index and there are no interceptors or hidden
// prototypes.
Maybe<bool> maybe = JSObject::HasRealNamedProperty(js_obj, key);
Maybe<bool> maybe;
if (key_is_array_index) {
maybe = JSObject::HasOwnElement(js_obj, index);
} else {
maybe = JSObject::HasRealNamedProperty(js_obj, key);
}
if (!maybe.has_value) return isolate->heap()->exception();
DCHECK(!isolate->has_pending_exception());
if (maybe.value) {
......
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