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

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

Issue 2580413002: Merged: [stubs] Fix negative index lookup in hasOwnProperty (Closed)
Patch Set: fix formatting 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 4bf1adccc0e843eeeca71f45dd8563ace4e3f9e5..abb5c47555690f309673913edbc2fa9f845615d3 100644
--- a/src/builtins/builtins-object.cc
+++ b/src/builtins/builtins-object.cc
@@ -46,6 +46,10 @@ void Builtins::Generate_ObjectHasOwnProperty(CodeStubAssembler* assembler) {
&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