OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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.h" | 5 #include "src/builtins/builtins-utils.h" |
6 #include "src/builtins/builtins.h" | 6 #include "src/builtins/builtins.h" |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stub-assembler.h" | 8 #include "src/code-stub-assembler.h" |
9 #include "src/property-descriptor.h" | 9 #include "src/property-descriptor.h" |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 Label call_runtime(this), return_true(this), return_false(this); | 32 Label call_runtime(this), return_true(this), return_false(this); |
33 | 33 |
34 // Smi receivers do not have own properties. | 34 // Smi receivers do not have own properties. |
35 Label if_objectisnotsmi(this); | 35 Label if_objectisnotsmi(this); |
36 Branch(TaggedIsSmi(object), &return_false, &if_objectisnotsmi); | 36 Branch(TaggedIsSmi(object), &return_false, &if_objectisnotsmi); |
37 Bind(&if_objectisnotsmi); | 37 Bind(&if_objectisnotsmi); |
38 | 38 |
39 Node* map = LoadMap(object); | 39 Node* map = LoadMap(object); |
40 Node* instance_type = LoadMapInstanceType(map); | 40 Node* instance_type = LoadMapInstanceType(map); |
41 | 41 |
42 { | 42 Variable var_index(this, MachineType::PointerRepresentation()); |
43 Variable var_index(this, MachineType::PointerRepresentation()); | |
44 Variable var_unique(this, MachineRepresentation::kTagged); | |
45 | 43 |
46 Label keyisindex(this), if_iskeyunique(this); | 44 Label keyisindex(this), if_iskeyunique(this); |
47 TryToName(key, &keyisindex, &var_index, &if_iskeyunique, &var_unique, | 45 TryToName(key, &keyisindex, &var_index, &if_iskeyunique, &call_runtime); |
48 &call_runtime); | |
49 | 46 |
50 Bind(&if_iskeyunique); | 47 Bind(&if_iskeyunique); |
51 TryHasOwnProperty(object, map, instance_type, var_unique.value(), | 48 TryHasOwnProperty(object, map, instance_type, key, &return_true, |
52 &return_true, &return_false, &call_runtime); | 49 &return_false, &call_runtime); |
53 | 50 |
54 Bind(&keyisindex); | 51 Bind(&keyisindex); |
55 // Handle negative keys in the runtime. | 52 // Handle negative keys in the runtime. |
56 GotoIf(IntPtrLessThan(var_index.value(), IntPtrConstant(0)), &call_runtime); | 53 GotoIf(IntPtrLessThan(var_index.value(), IntPtrConstant(0)), &call_runtime); |
57 TryLookupElement(object, map, instance_type, var_index.value(), | 54 TryLookupElement(object, map, instance_type, var_index.value(), &return_true, |
58 &return_true, &return_false, &call_runtime); | 55 &return_false, &call_runtime); |
59 } | 56 |
60 Bind(&return_true); | 57 Bind(&return_true); |
61 Return(BooleanConstant(true)); | 58 Return(BooleanConstant(true)); |
62 | 59 |
63 Bind(&return_false); | 60 Bind(&return_false); |
64 Return(BooleanConstant(false)); | 61 Return(BooleanConstant(false)); |
65 | 62 |
66 Bind(&call_runtime); | 63 Bind(&call_runtime); |
67 Return(CallRuntime(Runtime::kObjectHasOwnProperty, context, object, key)); | 64 Return(CallRuntime(Runtime::kObjectHasOwnProperty, context, object, key)); |
68 } | 65 } |
69 | 66 |
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
936 typedef TypeofDescriptor Descriptor; | 933 typedef TypeofDescriptor Descriptor; |
937 | 934 |
938 Node* object = Parameter(Descriptor::kObject); | 935 Node* object = Parameter(Descriptor::kObject); |
939 Node* context = Parameter(Descriptor::kContext); | 936 Node* context = Parameter(Descriptor::kContext); |
940 | 937 |
941 Return(GetSuperConstructor(object, context)); | 938 Return(GetSuperConstructor(object, context)); |
942 } | 939 } |
943 | 940 |
944 } // namespace internal | 941 } // namespace internal |
945 } // namespace v8 | 942 } // namespace v8 |
OLD | NEW |