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 30 matching lines...) Expand all Loading... |
41 | 41 |
42 Label keyisindex(&assembler), if_iskeyunique(&assembler); | 42 Label keyisindex(&assembler), if_iskeyunique(&assembler); |
43 assembler.TryToName(key, &keyisindex, &var_index, &if_iskeyunique, | 43 assembler.TryToName(key, &keyisindex, &var_index, &if_iskeyunique, |
44 &call_runtime); | 44 &call_runtime); |
45 | 45 |
46 assembler.Bind(&if_iskeyunique); | 46 assembler.Bind(&if_iskeyunique); |
47 assembler.TryHasOwnProperty(object, map, instance_type, key, &return_true, | 47 assembler.TryHasOwnProperty(object, map, instance_type, key, &return_true, |
48 &return_false, &call_runtime); | 48 &return_false, &call_runtime); |
49 | 49 |
50 assembler.Bind(&keyisindex); | 50 assembler.Bind(&keyisindex); |
| 51 // Handle negative keys in the runtime. |
| 52 assembler.GotoIf( |
| 53 assembler.IntPtrLessThan(var_index.value(), assembler.IntPtrConstant(0)), |
| 54 &call_runtime); |
51 assembler.TryLookupElement(object, map, instance_type, var_index.value(), | 55 assembler.TryLookupElement(object, map, instance_type, var_index.value(), |
52 &return_true, &return_false, &call_runtime); | 56 &return_true, &return_false, &call_runtime); |
53 | 57 |
54 assembler.Bind(&return_true); | 58 assembler.Bind(&return_true); |
55 assembler.Return(assembler.BooleanConstant(true)); | 59 assembler.Return(assembler.BooleanConstant(true)); |
56 | 60 |
57 assembler.Bind(&return_false); | 61 assembler.Bind(&return_false); |
58 assembler.Return(assembler.BooleanConstant(false)); | 62 assembler.Return(assembler.BooleanConstant(false)); |
59 | 63 |
60 assembler.Bind(&call_runtime); | 64 assembler.Bind(&call_runtime); |
(...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1069 | 1073 |
1070 Node* constructor = assembler.Parameter(Descriptor::kLeft); | 1074 Node* constructor = assembler.Parameter(Descriptor::kLeft); |
1071 Node* object = assembler.Parameter(Descriptor::kRight); | 1075 Node* object = assembler.Parameter(Descriptor::kRight); |
1072 Node* context = assembler.Parameter(Descriptor::kContext); | 1076 Node* context = assembler.Parameter(Descriptor::kContext); |
1073 | 1077 |
1074 assembler.Return(assembler.OrdinaryHasInstance(context, constructor, object)); | 1078 assembler.Return(assembler.OrdinaryHasInstance(context, constructor, object)); |
1075 } | 1079 } |
1076 | 1080 |
1077 } // namespace internal | 1081 } // namespace internal |
1078 } // namespace v8 | 1082 } // namespace v8 |
OLD | NEW |