| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 "vm/intermediate_language.h" | 5 #include "vm/intermediate_language.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/bootstrap.h" | 8 #include "vm/bootstrap.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/constant_propagator.h" | 10 #include "vm/constant_propagator.h" |
| (...skipping 2055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2066 } | 2066 } |
| 2067 | 2067 |
| 2068 // For uninstantiated target types: If the instantiator type arguments | 2068 // For uninstantiated target types: If the instantiator type arguments |
| 2069 // are constant, instantiate the target type here. | 2069 // are constant, instantiate the target type here. |
| 2070 if (dst_type().IsInstantiated()) return this; | 2070 if (dst_type().IsInstantiated()) return this; |
| 2071 | 2071 |
| 2072 // TODO(regis): Only try to instantiate here if function_type_args is constant | 2072 // TODO(regis): Only try to instantiate here if function_type_args is constant |
| 2073 // or null and dst_type does not refer to parent function type parameters. | 2073 // or null and dst_type does not refer to parent function type parameters. |
| 2074 ConstantInstr* constant_type_args = | 2074 ConstantInstr* constant_type_args = |
| 2075 instantiator_type_arguments()->definition()->AsConstant(); | 2075 instantiator_type_arguments()->definition()->AsConstant(); |
| 2076 if (constant_type_args != NULL && !constant_type_args->value().IsNull() && | 2076 if (constant_type_args != NULL) { |
| 2077 constant_type_args->value().IsTypeArguments()) { | 2077 ASSERT(constant_type_args->value().IsNull() || |
| 2078 const TypeArguments& instantiator_type_args = | 2078 constant_type_args->value().IsTypeArguments()); |
| 2079 TypeArguments::Cast(constant_type_args->value()); | 2079 TypeArguments& instantiator_type_args = TypeArguments::Handle(); |
| 2080 instantiator_type_args ^= constant_type_args->value().raw(); |
| 2080 Error& bound_error = Error::Handle(); | 2081 Error& bound_error = Error::Handle(); |
| 2081 AbstractType& new_dst_type = | 2082 AbstractType& new_dst_type = |
| 2082 AbstractType::Handle(dst_type().InstantiateFrom( | 2083 AbstractType::Handle(dst_type().InstantiateFrom( |
| 2083 instantiator_type_args, /* function_type_args, */ | 2084 instantiator_type_args, /* function_type_args, */ |
| 2084 &bound_error, NULL, NULL, Heap::kOld)); | 2085 &bound_error, NULL, NULL, Heap::kOld)); |
| 2085 if (new_dst_type.IsMalformedOrMalbounded() || !bound_error.IsNull()) { | 2086 if (new_dst_type.IsMalformedOrMalbounded() || !bound_error.IsNull()) { |
| 2086 return this; | 2087 return this; |
| 2087 } | 2088 } |
| 2088 if (new_dst_type.IsTypeRef()) { | 2089 if (new_dst_type.IsTypeRef()) { |
| 2089 new_dst_type = TypeRef::Cast(new_dst_type).type(); | 2090 new_dst_type = TypeRef::Cast(new_dst_type).type(); |
| (...skipping 1895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3985 set_native_c_function(native_function); | 3986 set_native_c_function(native_function); |
| 3986 function().SetIsNativeAutoSetupScope(auto_setup_scope); | 3987 function().SetIsNativeAutoSetupScope(auto_setup_scope); |
| 3987 Dart_NativeEntryResolver resolver = library.native_entry_resolver(); | 3988 Dart_NativeEntryResolver resolver = library.native_entry_resolver(); |
| 3988 bool is_bootstrap_native = Bootstrap::IsBootstapResolver(resolver); | 3989 bool is_bootstrap_native = Bootstrap::IsBootstapResolver(resolver); |
| 3989 set_is_bootstrap_native(is_bootstrap_native); | 3990 set_is_bootstrap_native(is_bootstrap_native); |
| 3990 } | 3991 } |
| 3991 | 3992 |
| 3992 #undef __ | 3993 #undef __ |
| 3993 | 3994 |
| 3994 } // namespace dart | 3995 } // namespace dart |
| OLD | NEW |