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

Unified Diff: src/runtime/runtime-object.cc

Issue 803833004: Add fast path for array indices to Runtime_HasOwnProperty (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-object.cc
diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc
index 617644c49efbf5199a24ad66ca7fc2ed1ce34b77..d8d7a05fcf07ddd011b119e6657f982220b6170f 100644
--- a/src/runtime/runtime-object.cc
+++ b/src/runtime/runtime-object.cc
@@ -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) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698