OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include <set> | 5 #include <set> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "vm/kernel_to_il.h" | 8 #include "vm/kernel_to_il.h" |
9 | 9 |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 2196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2207 // directly to the `new List<T>()` factory constructor. | 2207 // directly to the `new List<T>()` factory constructor. |
2208 instructions += LoadInstantiatorTypeArguments(); | 2208 instructions += LoadInstantiatorTypeArguments(); |
2209 } else { | 2209 } else { |
2210 // Otherwise we need to resolve [TypeParameterType]s in the type | 2210 // Otherwise we need to resolve [TypeParameterType]s in the type |
2211 // expression based on the current instantiator type argument vector. | 2211 // expression based on the current instantiator type argument vector. |
2212 if (!type_arguments.IsInstantiated(kCurrentClass)) { | 2212 if (!type_arguments.IsInstantiated(kCurrentClass)) { |
2213 instructions += LoadInstantiatorTypeArguments(); | 2213 instructions += LoadInstantiatorTypeArguments(); |
2214 } else { | 2214 } else { |
2215 instructions += NullConstant(); | 2215 instructions += NullConstant(); |
2216 } | 2216 } |
2217 if (!type_arguments.IsInstantiated(kCurrentFunction)) { | 2217 if (!type_arguments.IsInstantiated(kFunctions)) { |
2218 instructions += LoadFunctionTypeArguments(); | 2218 instructions += LoadFunctionTypeArguments(); |
2219 } else { | 2219 } else { |
2220 instructions += NullConstant(); | 2220 instructions += NullConstant(); |
2221 } | 2221 } |
2222 instructions += InstantiateTypeArguments(type_arguments); | 2222 instructions += InstantiateTypeArguments(type_arguments); |
2223 } | 2223 } |
2224 } | 2224 } |
2225 return instructions; | 2225 return instructions; |
2226 } | 2226 } |
2227 | 2227 |
(...skipping 1604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3832 Fragment instructions; | 3832 Fragment instructions; |
3833 Value* value = Pop(); | 3833 Value* value = Pop(); |
3834 | 3834 |
3835 if (!dst_type.IsInstantiated(kCurrentClass)) { | 3835 if (!dst_type.IsInstantiated(kCurrentClass)) { |
3836 instructions += LoadInstantiatorTypeArguments(); | 3836 instructions += LoadInstantiatorTypeArguments(); |
3837 } else { | 3837 } else { |
3838 instructions += NullConstant(); | 3838 instructions += NullConstant(); |
3839 } | 3839 } |
3840 Value* instantiator_type_args = Pop(); | 3840 Value* instantiator_type_args = Pop(); |
3841 | 3841 |
3842 if (!dst_type.IsInstantiated(kCurrentFunction)) { | 3842 if (!dst_type.IsInstantiated(kFunctions)) { |
3843 instructions += LoadFunctionTypeArguments(); | 3843 instructions += LoadFunctionTypeArguments(); |
3844 } else { | 3844 } else { |
3845 instructions += NullConstant(); | 3845 instructions += NullConstant(); |
3846 } | 3846 } |
3847 Value* function_type_args = Pop(); | 3847 Value* function_type_args = Pop(); |
3848 | 3848 |
3849 AssertAssignableInstr* instr = new (Z) AssertAssignableInstr( | 3849 AssertAssignableInstr* instr = new (Z) AssertAssignableInstr( |
3850 TokenPosition::kNoSource, value, instantiator_type_args, | 3850 TokenPosition::kNoSource, value, instantiator_type_args, |
3851 function_type_args, dst_type, dst_name, H.thread()->GetNextDeoptId()); | 3851 function_type_args, dst_type, dst_name, H.thread()->GetNextDeoptId()); |
3852 Push(instr); | 3852 Push(instr); |
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4681 | 4681 |
4682 Fragment instructions; | 4682 Fragment instructions; |
4683 if (type.IsInstantiated()) { | 4683 if (type.IsInstantiated()) { |
4684 instructions += Constant(type); | 4684 instructions += Constant(type); |
4685 } else { | 4685 } else { |
4686 if (!type.IsInstantiated(kCurrentClass)) { | 4686 if (!type.IsInstantiated(kCurrentClass)) { |
4687 instructions += LoadInstantiatorTypeArguments(); | 4687 instructions += LoadInstantiatorTypeArguments(); |
4688 } else { | 4688 } else { |
4689 instructions += NullConstant(); | 4689 instructions += NullConstant(); |
4690 } | 4690 } |
4691 if (!type.IsInstantiated(kCurrentFunction)) { | 4691 if (!type.IsInstantiated(kFunctions)) { |
4692 instructions += LoadFunctionTypeArguments(); | 4692 instructions += LoadFunctionTypeArguments(); |
4693 } else { | 4693 } else { |
4694 instructions += NullConstant(); | 4694 instructions += NullConstant(); |
4695 } | 4695 } |
4696 instructions += InstantiateType(type); | 4696 instructions += InstantiateType(type); |
4697 } | 4697 } |
4698 fragment_ = instructions; | 4698 fragment_ = instructions; |
4699 } | 4699 } |
4700 | 4700 |
4701 | 4701 |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5118 return; | 5118 return; |
5119 } | 5119 } |
5120 | 5120 |
5121 if (!type.IsInstantiated(kCurrentClass)) { | 5121 if (!type.IsInstantiated(kCurrentClass)) { |
5122 instructions += LoadInstantiatorTypeArguments(); | 5122 instructions += LoadInstantiatorTypeArguments(); |
5123 } else { | 5123 } else { |
5124 instructions += NullConstant(); | 5124 instructions += NullConstant(); |
5125 } | 5125 } |
5126 instructions += PushArgument(); // Instantiator type arguments. | 5126 instructions += PushArgument(); // Instantiator type arguments. |
5127 | 5127 |
5128 if (!type.IsInstantiated(kCurrentFunction)) { | 5128 if (!type.IsInstantiated(kFunctions)) { |
5129 instructions += LoadFunctionTypeArguments(); | 5129 instructions += LoadFunctionTypeArguments(); |
5130 } else { | 5130 } else { |
5131 instructions += NullConstant(); | 5131 instructions += NullConstant(); |
5132 } | 5132 } |
5133 instructions += PushArgument(); // Function type arguments. | 5133 instructions += PushArgument(); // Function type arguments. |
5134 | 5134 |
5135 instructions += Constant(type); | 5135 instructions += Constant(type); |
5136 instructions += PushArgument(); // Type. | 5136 instructions += PushArgument(); // Type. |
5137 | 5137 |
5138 instructions += | 5138 instructions += |
(...skipping 27 matching lines...) Expand all Loading... |
5166 } else { | 5166 } else { |
5167 instructions += PushArgument(); | 5167 instructions += PushArgument(); |
5168 | 5168 |
5169 if (!type.IsInstantiated(kCurrentClass)) { | 5169 if (!type.IsInstantiated(kCurrentClass)) { |
5170 instructions += LoadInstantiatorTypeArguments(); | 5170 instructions += LoadInstantiatorTypeArguments(); |
5171 } else { | 5171 } else { |
5172 instructions += NullConstant(); | 5172 instructions += NullConstant(); |
5173 } | 5173 } |
5174 instructions += PushArgument(); // Instantiator type arguments. | 5174 instructions += PushArgument(); // Instantiator type arguments. |
5175 | 5175 |
5176 if (!type.IsInstantiated(kCurrentFunction)) { | 5176 if (!type.IsInstantiated(kFunctions)) { |
5177 instructions += LoadFunctionTypeArguments(); | 5177 instructions += LoadFunctionTypeArguments(); |
5178 } else { | 5178 } else { |
5179 instructions += NullConstant(); | 5179 instructions += NullConstant(); |
5180 } | 5180 } |
5181 instructions += PushArgument(); // Function type arguments. | 5181 instructions += PushArgument(); // Function type arguments. |
5182 | 5182 |
5183 instructions += Constant(type); | 5183 instructions += Constant(type); |
5184 instructions += PushArgument(); // Type. | 5184 instructions += PushArgument(); // Type. |
5185 | 5185 |
5186 instructions += InstanceCall( | 5186 instructions += InstanceCall( |
(...skipping 1369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6556 thread->clear_sticky_error(); | 6556 thread->clear_sticky_error(); |
6557 return error.raw(); | 6557 return error.raw(); |
6558 } | 6558 } |
6559 } | 6559 } |
6560 | 6560 |
6561 | 6561 |
6562 } // namespace kernel | 6562 } // namespace kernel |
6563 } // namespace dart | 6563 } // namespace dart |
6564 | 6564 |
6565 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 6565 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
OLD | NEW |