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

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

Issue 2811333002: [builtins] HasOwnProperty: handle non-internalized string keys (Closed)
Patch Set: rebased (noop) Created 3 years, 8 months 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 | « src/assembler.cc ('k') | src/code-stub-assembler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/builtins-object-gen.cc
diff --git a/src/builtins/builtins-object-gen.cc b/src/builtins/builtins-object-gen.cc
index be83f5d1efa264544387e817a666a0bf3214e869..b919d18f1b42c2ac519cf20290270dec0f379959 100644
--- a/src/builtins/builtins-object-gen.cc
+++ b/src/builtins/builtins-object-gen.cc
@@ -68,19 +68,31 @@ TF_BUILTIN(ObjectHasOwnProperty, ObjectBuiltinsAssembler) {
VARIABLE(var_index, MachineType::PointerRepresentation());
VARIABLE(var_unique, MachineRepresentation::kTagged);
- Label keyisindex(this), if_iskeyunique(this);
- TryToName(key, &keyisindex, &var_index, &if_iskeyunique, &var_unique,
- &call_runtime);
+ Label if_index(this), if_unique_name(this), if_notunique_name(this);
+ TryToName(key, &if_index, &var_index, &if_unique_name, &var_unique,
+ &call_runtime, &if_notunique_name);
- BIND(&if_iskeyunique);
+ BIND(&if_unique_name);
TryHasOwnProperty(object, map, instance_type, var_unique.value(),
&return_true, &return_false, &call_runtime);
- BIND(&keyisindex);
- // Handle negative keys in the runtime.
- GotoIf(IntPtrLessThan(var_index.value(), IntPtrConstant(0)), &call_runtime);
- TryLookupElement(object, map, instance_type, var_index.value(),
- &return_true, &return_false, &return_false, &call_runtime);
+ BIND(&if_index);
+ {
+ // Handle negative keys in the runtime.
+ GotoIf(IntPtrLessThan(var_index.value(), IntPtrConstant(0)),
+ &call_runtime);
+ TryLookupElement(object, map, instance_type, var_index.value(),
+ &return_true, &return_false, &return_false,
+ &call_runtime);
+ }
+
+ BIND(&if_notunique_name);
+ {
+ // If the string was not found in the string table, then no object can
+ // have a property with that name, so return |false|.
+ TryInternalizeString(key, &if_index, &var_index, &if_unique_name,
+ &var_unique, &return_false, &call_runtime);
+ }
}
BIND(&return_true);
Return(BooleanConstant(true));
« no previous file with comments | « src/assembler.cc ('k') | src/code-stub-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698