OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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/precompiler.h" | 5 #include "vm/precompiler.h" |
6 | 6 |
7 #include "vm/aot_optimizer.h" | 7 #include "vm/aot_optimizer.h" |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/ast_printer.h" | 9 #include "vm/ast_printer.h" |
10 #include "vm/branch_optimizer.h" | 10 #include "vm/branch_optimizer.h" |
(...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1101 void Precompiler::AddConstObject(const Instance& instance) { | 1101 void Precompiler::AddConstObject(const Instance& instance) { |
1102 const Class& cls = Class::Handle(Z, instance.clazz()); | 1102 const Class& cls = Class::Handle(Z, instance.clazz()); |
1103 AddInstantiatedClass(cls); | 1103 AddInstantiatedClass(cls); |
1104 | 1104 |
1105 if (instance.IsClosure()) { | 1105 if (instance.IsClosure()) { |
1106 // An implicit static closure. | 1106 // An implicit static closure. |
1107 const Function& func = | 1107 const Function& func = |
1108 Function::Handle(Z, Closure::Cast(instance).function()); | 1108 Function::Handle(Z, Closure::Cast(instance).function()); |
1109 ASSERT(func.is_static()); | 1109 ASSERT(func.is_static()); |
1110 AddFunction(func); | 1110 AddFunction(func); |
1111 AddTypeArguments( | 1111 AddTypeArguments(TypeArguments::Handle( |
1112 TypeArguments::Handle(Z, Closure::Cast(instance).instantiator())); | 1112 Z, Closure::Cast(instance).instantiator_type_arguments())); |
| 1113 AddTypeArguments(TypeArguments::Handle( |
| 1114 Z, Closure::Cast(instance).function_type_arguments())); |
1113 return; | 1115 return; |
1114 } | 1116 } |
1115 | 1117 |
1116 // Can't ask immediate objects if they're canoncial. | 1118 // Can't ask immediate objects if they're canoncial. |
1117 if (instance.IsSmi()) return; | 1119 if (instance.IsSmi()) return; |
1118 | 1120 |
1119 // Some Instances in the ObjectPool aren't const objects, such as | 1121 // Some Instances in the ObjectPool aren't const objects, such as |
1120 // argument descriptors. | 1122 // argument descriptors. |
1121 if (!instance.IsCanonical()) return; | 1123 if (!instance.IsCanonical()) return; |
1122 | 1124 |
(...skipping 2203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3326 | 3328 |
3327 ASSERT(FLAG_precompiled_mode); | 3329 ASSERT(FLAG_precompiled_mode); |
3328 const bool optimized = function.IsOptimizable(); // False for natives. | 3330 const bool optimized = function.IsOptimizable(); // False for natives. |
3329 DartPrecompilationPipeline pipeline(zone, field_type_map); | 3331 DartPrecompilationPipeline pipeline(zone, field_type_map); |
3330 return PrecompileFunctionHelper(precompiler, &pipeline, function, optimized); | 3332 return PrecompileFunctionHelper(precompiler, &pipeline, function, optimized); |
3331 } | 3333 } |
3332 | 3334 |
3333 #endif // DART_PRECOMPILER | 3335 #endif // DART_PRECOMPILER |
3334 | 3336 |
3335 } // namespace dart | 3337 } // namespace dart |
OLD | NEW |