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

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

Issue 2568943002: [stubs] Fix negative index lookup in hasOwnProperty (Closed)
Patch Set: add test Created 4 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 | src/code-stub-assembler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/builtins-object.cc
diff --git a/src/builtins/builtins-object.cc b/src/builtins/builtins-object.cc
index 85254d5dcd7527489d9f95424ff7865175013b6b..eba065e5b345484dc91e912248efc52b92df2b34 100644
--- a/src/builtins/builtins-object.cc
+++ b/src/builtins/builtins-object.cc
@@ -48,6 +48,10 @@ void Builtins::Generate_ObjectHasOwnProperty(
&return_false, &call_runtime);
assembler.Bind(&keyisindex);
+ // Handle negative keys in the runtime.
+ assembler.GotoIf(
+ assembler.IntPtrLessThan(var_index.value(), assembler.IntPtrConstant(0)),
+ &call_runtime);
assembler.TryLookupElement(object, map, instance_type, var_index.value(),
&return_true, &return_false, &call_runtime);
« no previous file with comments | « no previous file | src/code-stub-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698