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 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1096 ASSERT(value.raw() != Object::transition_sentinel().raw()); | 1096 ASSERT(value.raw() != Object::transition_sentinel().raw()); |
1097 | 1097 |
1098 const bool is_initialized = value.raw() != Object::sentinel().raw(); | 1098 const bool is_initialized = value.raw() != Object::sentinel().raw(); |
1099 if (is_initialized && !reset_fields_) return; | 1099 if (is_initialized && !reset_fields_) return; |
1100 | 1100 |
1101 if (!field.HasPrecompiledInitializer() || | 1101 if (!field.HasPrecompiledInitializer() || |
1102 !Function::Handle(Z, field.PrecompiledInitializer()).HasCode()) { | 1102 !Function::Handle(Z, field.PrecompiledInitializer()).HasCode()) { |
1103 if (FLAG_trace_precompiler) { | 1103 if (FLAG_trace_precompiler) { |
1104 THR_Print("Precompiling initializer for %s\n", field.ToCString()); | 1104 THR_Print("Precompiling initializer for %s\n", field.ToCString()); |
1105 } | 1105 } |
1106 ASSERT(Dart::snapshot_kind() != Snapshot::kAppNoJIT); | 1106 ASSERT(Dart::snapshot_kind() != Snapshot::kAppAOT); |
1107 const Function& initializer = Function::Handle( | 1107 const Function& initializer = Function::Handle( |
1108 Z, CompileStaticInitializer(field, /* compute_type = */ true)); | 1108 Z, CompileStaticInitializer(field, /* compute_type = */ true)); |
1109 ASSERT(!initializer.IsNull()); | 1109 ASSERT(!initializer.IsNull()); |
1110 field.SetPrecompiledInitializer(initializer); | 1110 field.SetPrecompiledInitializer(initializer); |
1111 AddCalleesOf(initializer); | 1111 AddCalleesOf(initializer); |
1112 } | 1112 } |
1113 } | 1113 } |
1114 } | 1114 } |
1115 } | 1115 } |
1116 | 1116 |
(...skipping 2182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3299 | 3299 |
3300 ASSERT(FLAG_precompiled_mode); | 3300 ASSERT(FLAG_precompiled_mode); |
3301 const bool optimized = function.IsOptimizable(); // False for natives. | 3301 const bool optimized = function.IsOptimizable(); // False for natives. |
3302 DartPrecompilationPipeline pipeline(zone, field_type_map); | 3302 DartPrecompilationPipeline pipeline(zone, field_type_map); |
3303 return PrecompileFunctionHelper(precompiler, &pipeline, function, optimized); | 3303 return PrecompileFunctionHelper(precompiler, &pipeline, function, optimized); |
3304 } | 3304 } |
3305 | 3305 |
3306 #endif // DART_PRECOMPILER | 3306 #endif // DART_PRECOMPILER |
3307 | 3307 |
3308 } // namespace dart | 3308 } // namespace dart |
OLD | NEW |