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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/assembler.cc ('k') | src/code-stub-assembler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 the V8 project authors. All rights reserved. 1 // Copyright 2017 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/builtins/builtins-utils-gen.h" 5 #include "src/builtins/builtins-utils-gen.h"
6 #include "src/builtins/builtins.h" 6 #include "src/builtins/builtins.h"
7 #include "src/code-stub-assembler.h" 7 #include "src/code-stub-assembler.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 Branch(TaggedIsSmi(object), &return_false, &if_objectisnotsmi); 61 Branch(TaggedIsSmi(object), &return_false, &if_objectisnotsmi);
62 BIND(&if_objectisnotsmi); 62 BIND(&if_objectisnotsmi);
63 63
64 Node* map = LoadMap(object); 64 Node* map = LoadMap(object);
65 Node* instance_type = LoadMapInstanceType(map); 65 Node* instance_type = LoadMapInstanceType(map);
66 66
67 { 67 {
68 VARIABLE(var_index, MachineType::PointerRepresentation()); 68 VARIABLE(var_index, MachineType::PointerRepresentation());
69 VARIABLE(var_unique, MachineRepresentation::kTagged); 69 VARIABLE(var_unique, MachineRepresentation::kTagged);
70 70
71 Label keyisindex(this), if_iskeyunique(this); 71 Label if_index(this), if_unique_name(this), if_notunique_name(this);
72 TryToName(key, &keyisindex, &var_index, &if_iskeyunique, &var_unique, 72 TryToName(key, &if_index, &var_index, &if_unique_name, &var_unique,
73 &call_runtime); 73 &call_runtime, &if_notunique_name);
74 74
75 BIND(&if_iskeyunique); 75 BIND(&if_unique_name);
76 TryHasOwnProperty(object, map, instance_type, var_unique.value(), 76 TryHasOwnProperty(object, map, instance_type, var_unique.value(),
77 &return_true, &return_false, &call_runtime); 77 &return_true, &return_false, &call_runtime);
78 78
79 BIND(&keyisindex); 79 BIND(&if_index);
80 // Handle negative keys in the runtime. 80 {
81 GotoIf(IntPtrLessThan(var_index.value(), IntPtrConstant(0)), &call_runtime); 81 // Handle negative keys in the runtime.
82 TryLookupElement(object, map, instance_type, var_index.value(), 82 GotoIf(IntPtrLessThan(var_index.value(), IntPtrConstant(0)),
83 &return_true, &return_false, &return_false, &call_runtime); 83 &call_runtime);
84 TryLookupElement(object, map, instance_type, var_index.value(),
85 &return_true, &return_false, &return_false,
86 &call_runtime);
87 }
88
89 BIND(&if_notunique_name);
90 {
91 // If the string was not found in the string table, then no object can
92 // have a property with that name, so return |false|.
93 TryInternalizeString(key, &if_index, &var_index, &if_unique_name,
94 &var_unique, &return_false, &call_runtime);
95 }
84 } 96 }
85 BIND(&return_true); 97 BIND(&return_true);
86 Return(BooleanConstant(true)); 98 Return(BooleanConstant(true));
87 99
88 BIND(&return_false); 100 BIND(&return_false);
89 Return(BooleanConstant(false)); 101 Return(BooleanConstant(false));
90 102
91 BIND(&call_runtime); 103 BIND(&call_runtime);
92 Return(CallRuntime(Runtime::kObjectHasOwnProperty, context, object, key)); 104 Return(CallRuntime(Runtime::kObjectHasOwnProperty, context, object, key));
93 } 105 }
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 407
396 TF_BUILTIN(GetSuperConstructor, ObjectBuiltinsAssembler) { 408 TF_BUILTIN(GetSuperConstructor, ObjectBuiltinsAssembler) {
397 Node* object = Parameter(Descriptor::kObject); 409 Node* object = Parameter(Descriptor::kObject);
398 Node* context = Parameter(Descriptor::kContext); 410 Node* context = Parameter(Descriptor::kContext);
399 411
400 Return(GetSuperConstructor(object, context)); 412 Return(GetSuperConstructor(object, context));
401 } 413 }
402 414
403 } // namespace internal 415 } // namespace internal
404 } // namespace v8 416 } // namespace v8
OLDNEW
« 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