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

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

Issue 2549773002: Internalize strings in-place (Closed)
Patch Set: rebased Created 3 years, 11 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/ast/ast-types.cc ('k') | src/builtins/builtins-string.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 c9a9b7e164db121353e954b040f51172155d1551..5f90ecfb190a2eb54a5a42f75f9f99c3de775475 100644
--- a/src/builtins/builtins-object.cc
+++ b/src/builtins/builtins-object.cc
@@ -39,21 +39,24 @@ TF_BUILTIN(ObjectHasOwnProperty, ObjectBuiltinsAssembler) {
Node* map = LoadMap(object);
Node* instance_type = LoadMapInstanceType(map);
- Variable var_index(this, MachineType::PointerRepresentation());
-
- Label keyisindex(this), if_iskeyunique(this);
- TryToName(key, &keyisindex, &var_index, &if_iskeyunique, &call_runtime);
-
- Bind(&if_iskeyunique);
- TryHasOwnProperty(object, map, instance_type, key, &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, &call_runtime);
-
+ {
+ Variable var_index(this, MachineType::PointerRepresentation());
+ Variable var_unique(this, MachineRepresentation::kTagged);
+
+ Label keyisindex(this), if_iskeyunique(this);
+ TryToName(key, &keyisindex, &var_index, &if_iskeyunique, &var_unique,
+ &call_runtime);
+
+ Bind(&if_iskeyunique);
+ 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, &call_runtime);
+ }
Bind(&return_true);
Return(BooleanConstant(true));
« no previous file with comments | « src/ast/ast-types.cc ('k') | src/builtins/builtins-string.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698