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

Unified Diff: src/ic/accessor-assembler.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/globals.h ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/accessor-assembler.cc
diff --git a/src/ic/accessor-assembler.cc b/src/ic/accessor-assembler.cc
index eb3971c54fcbc85bc806454c265055228534d248..c048c7ec818f7774eaf14965ce71b13af487ba64 100644
--- a/src/ic/accessor-assembler.cc
+++ b/src/ic/accessor-assembler.cc
@@ -2090,15 +2090,15 @@ void AccessorAssembler::KeyedLoadICGeneric(const LoadICParameters* p) {
VARIABLE(var_index, MachineType::PointerRepresentation());
VARIABLE(var_unique, MachineRepresentation::kTagged);
var_unique.Bind(p->name); // Dummy initialization.
- Label if_index(this), if_unique_name(this), slow(this);
+ Label if_index(this), if_unique_name(this), if_notunique(this), slow(this);
Node* receiver = p->receiver;
GotoIf(TaggedIsSmi(receiver), &slow);
Node* receiver_map = LoadMap(receiver);
Node* instance_type = LoadMapInstanceType(receiver_map);
- TryToName(p->name, &if_index, &var_index, &if_unique_name, &var_unique,
- &slow);
+ TryToName(p->name, &if_index, &var_index, &if_unique_name, &var_unique, &slow,
+ &if_notunique);
BIND(&if_index);
{
@@ -2112,6 +2112,22 @@ void AccessorAssembler::KeyedLoadICGeneric(const LoadICParameters* p) {
var_unique.value(), p, &slow);
}
+ BIND(&if_notunique);
+ {
+ if (FLAG_internalize_on_the_fly) {
+ Label not_in_string_table(this);
+ TryInternalizeString(p->name, &if_index, &var_index, &if_unique_name,
+ &var_unique, &not_in_string_table, &slow);
+
+ BIND(&not_in_string_table);
+ // If the string was not found in the string table, then no object can
+ // have a property with that name.
+ Return(UndefinedConstant());
+ } else {
+ Goto(&slow);
+ }
+ }
+
BIND(&slow);
{
Comment("KeyedLoadGeneric_slow");
« no previous file with comments | « src/globals.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698