| 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 Variable var_index(this, MachineType::PointerRepresentation()); | 42 { |
| 43 Variable var_index(this, MachineType::PointerRepresentation()); |
| 44 Variable var_unique(this, MachineRepresentation::kTagged); |
| 43 | 45 |
| 44 Label keyisindex(this), if_iskeyunique(this); | 46 Label keyisindex(this), if_iskeyunique(this); |
| 45 TryToName(key, &keyisindex, &var_index, &if_iskeyunique, &call_runtime); | 47 TryToName(key, &keyisindex, &var_index, &if_iskeyunique, &var_unique, |
| 48 &call_runtime); |
| 46 | 49 |
| 47 Bind(&if_iskeyunique); | 50 Bind(&if_iskeyunique); |
| 48 TryHasOwnProperty(object, map, instance_type, key, &return_true, | 51 TryHasOwnProperty(object, map, instance_type, var_unique.value(), |
| 49 &return_false, &call_runtime); | 52 &return_true, &return_false, &call_runtime); |
| 50 | 53 |
| 51 Bind(&keyisindex); | 54 Bind(&keyisindex); |
| 52 // Handle negative keys in the runtime. | 55 // Handle negative keys in the runtime. |
| 53 GotoIf(IntPtrLessThan(var_index.value(), IntPtrConstant(0)), &call_runtime); | 56 GotoIf(IntPtrLessThan(var_index.value(), IntPtrConstant(0)), &call_runtime); |
| 54 TryLookupElement(object, map, instance_type, var_index.value(), &return_true, | 57 TryLookupElement(object, map, instance_type, var_index.value(), |
| 55 &return_false, &call_runtime); | 58 &return_true, &return_false, &call_runtime); |
| 56 | 59 } |
| 57 Bind(&return_true); | 60 Bind(&return_true); |
| 58 Return(BooleanConstant(true)); | 61 Return(BooleanConstant(true)); |
| 59 | 62 |
| 60 Bind(&return_false); | 63 Bind(&return_false); |
| 61 Return(BooleanConstant(false)); | 64 Return(BooleanConstant(false)); |
| 62 | 65 |
| 63 Bind(&call_runtime); | 66 Bind(&call_runtime); |
| 64 Return(CallRuntime(Runtime::kObjectHasOwnProperty, context, object, key)); | 67 Return(CallRuntime(Runtime::kObjectHasOwnProperty, context, object, key)); |
| 65 } | 68 } |
| 66 | 69 |
| (...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 932 typedef TypeofDescriptor Descriptor; | 935 typedef TypeofDescriptor Descriptor; |
| 933 | 936 |
| 934 Node* object = Parameter(Descriptor::kObject); | 937 Node* object = Parameter(Descriptor::kObject); |
| 935 Node* context = Parameter(Descriptor::kContext); | 938 Node* context = Parameter(Descriptor::kContext); |
| 936 | 939 |
| 937 Return(GetSuperConstructor(object, context)); | 940 Return(GetSuperConstructor(object, context)); |
| 938 } | 941 } |
| 939 | 942 |
| 940 } // namespace internal | 943 } // namespace internal |
| 941 } // namespace v8 | 944 } // namespace v8 |
| OLD | NEW |