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 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1188 | 1188 |
1189 if (field.has_initializer()) { | 1189 if (field.has_initializer()) { |
1190 // Should not be in the middle of initialization while precompiling. | 1190 // Should not be in the middle of initialization while precompiling. |
1191 ASSERT(value.raw() != Object::transition_sentinel().raw()); | 1191 ASSERT(value.raw() != Object::transition_sentinel().raw()); |
1192 | 1192 |
1193 if (!field.HasPrecompiledInitializer() || | 1193 if (!field.HasPrecompiledInitializer() || |
1194 !Function::Handle(Z, field.PrecompiledInitializer()).HasCode()) { | 1194 !Function::Handle(Z, field.PrecompiledInitializer()).HasCode()) { |
1195 if (FLAG_trace_precompiler) { | 1195 if (FLAG_trace_precompiler) { |
1196 THR_Print("Precompiling initializer for %s\n", field.ToCString()); | 1196 THR_Print("Precompiling initializer for %s\n", field.ToCString()); |
1197 } | 1197 } |
1198 ASSERT(Dart::snapshot_kind() != Snapshot::kAppAOT); | 1198 ASSERT(Dart::vm_snapshot_kind() != Snapshot::kAppAOT); |
1199 const Function& initializer = Function::Handle( | 1199 const Function& initializer = Function::Handle( |
1200 Z, CompileStaticInitializer(field, /* compute_type = */ true)); | 1200 Z, CompileStaticInitializer(field, /* compute_type = */ true)); |
1201 ASSERT(!initializer.IsNull()); | 1201 ASSERT(!initializer.IsNull()); |
1202 field.SetPrecompiledInitializer(initializer); | 1202 field.SetPrecompiledInitializer(initializer); |
1203 AddCalleesOf(initializer); | 1203 AddCalleesOf(initializer); |
1204 } | 1204 } |
1205 } | 1205 } |
1206 } | 1206 } |
1207 } | 1207 } |
1208 | 1208 |
(...skipping 2554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3763 | 3763 |
3764 ASSERT(FLAG_precompiled_mode); | 3764 ASSERT(FLAG_precompiled_mode); |
3765 const bool optimized = function.IsOptimizable(); // False for natives. | 3765 const bool optimized = function.IsOptimizable(); // False for natives. |
3766 DartPrecompilationPipeline pipeline(zone, field_type_map); | 3766 DartPrecompilationPipeline pipeline(zone, field_type_map); |
3767 return PrecompileFunctionHelper(precompiler, &pipeline, function, optimized); | 3767 return PrecompileFunctionHelper(precompiler, &pipeline, function, optimized); |
3768 } | 3768 } |
3769 | 3769 |
3770 #endif // DART_PRECOMPILER | 3770 #endif // DART_PRECOMPILER |
3771 | 3771 |
3772 } // namespace dart | 3772 } // namespace dart |
OLD | NEW |