| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 #include "vm/version.h" | 46 #include "vm/version.h" |
| 47 #include "vm/json_parser.h" | 47 #include "vm/json_parser.h" |
| 48 | 48 |
| 49 namespace dart { | 49 namespace dart { |
| 50 | 50 |
| 51 #define T (thread()) | 51 #define T (thread()) |
| 52 #define I (isolate()) | 52 #define I (isolate()) |
| 53 #define Z (zone()) | 53 #define Z (zone()) |
| 54 | 54 |
| 55 | 55 |
| 56 DEFINE_FLAG(bool, print_unique_targets, false, "Print unique dynaic targets"); | 56 DEFINE_FLAG(bool, print_unique_targets, false, "Print unique dynamic targets"); |
| 57 DEFINE_FLAG(bool, trace_precompiler, false, "Trace precompiler."); | 57 DEFINE_FLAG(bool, trace_precompiler, false, "Trace precompiler."); |
| 58 DEFINE_FLAG( | 58 DEFINE_FLAG( |
| 59 int, | 59 int, |
| 60 max_speculative_inlining_attempts, | 60 max_speculative_inlining_attempts, |
| 61 1, | 61 1, |
| 62 "Max number of attempts with speculative inlining (precompilation only)"); | 62 "Max number of attempts with speculative inlining (precompilation only)"); |
| 63 DEFINE_FLAG(int, precompiler_rounds, 1, "Number of precompiler iterations"); | 63 DEFINE_FLAG(int, precompiler_rounds, 1, "Number of precompiler iterations"); |
| 64 | 64 |
| 65 DECLARE_FLAG(bool, allocation_sinking); | 65 DECLARE_FLAG(bool, allocation_sinking); |
| 66 DECLARE_FLAG(bool, common_subexpression_elimination); | 66 DECLARE_FLAG(bool, common_subexpression_elimination); |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 *upper_limit = -1; | 267 *upper_limit = -1; |
| 268 intptr_t last_matching_cid = -1; | 268 intptr_t last_matching_cid = -1; |
| 269 | 269 |
| 270 ClassTable* table = thread_->isolate()->class_table(); | 270 ClassTable* table = thread_->isolate()->class_table(); |
| 271 Class& cls = Class::Handle(zone); | 271 Class& cls = Class::Handle(zone); |
| 272 AbstractType& cls_type = AbstractType::Handle(zone); | 272 AbstractType& cls_type = AbstractType::Handle(zone); |
| 273 for (intptr_t cid = kInstanceCid; cid < table->NumCids(); cid++) { | 273 for (intptr_t cid = kInstanceCid; cid < table->NumCids(); cid++) { |
| 274 if (!table->HasValidClassAt(cid)) continue; | 274 if (!table->HasValidClassAt(cid)) continue; |
| 275 if (cid == kVoidCid) continue; | 275 if (cid == kVoidCid) continue; |
| 276 if (cid == kDynamicCid) continue; | 276 if (cid == kDynamicCid) continue; |
| 277 if (cid == kNullCid) continue; // Instance is not at Bottom like Null type. |
| 277 cls = table->At(cid); | 278 cls = table->At(cid); |
| 278 if (cls.is_abstract()) continue; | 279 if (cls.is_abstract()) continue; |
| 279 if (cls.is_patch()) continue; | 280 if (cls.is_patch()) continue; |
| 280 if (cls.IsTopLevel()) continue; | 281 if (cls.IsTopLevel()) continue; |
| 281 | 282 |
| 282 cls_type = cls.RareType(); | 283 cls_type = cls.RareType(); |
| 283 if (cls_type.IsSubtypeOf(type, NULL, NULL, Heap::kOld)) { | 284 if (cls_type.IsSubtypeOf(type, NULL, NULL, Heap::kOld)) { |
| 284 last_matching_cid = cid; | 285 last_matching_cid = cid; |
| 285 if (*lower_limit == -1) { | 286 if (*lower_limit == -1) { |
| 286 // Found beginning of range. | 287 // Found beginning of range. |
| (...skipping 3368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3655 | 3656 |
| 3656 ASSERT(FLAG_precompiled_mode); | 3657 ASSERT(FLAG_precompiled_mode); |
| 3657 const bool optimized = function.IsOptimizable(); // False for natives. | 3658 const bool optimized = function.IsOptimizable(); // False for natives. |
| 3658 DartPrecompilationPipeline pipeline(zone, field_type_map); | 3659 DartPrecompilationPipeline pipeline(zone, field_type_map); |
| 3659 return PrecompileFunctionHelper(precompiler, &pipeline, function, optimized); | 3660 return PrecompileFunctionHelper(precompiler, &pipeline, function, optimized); |
| 3660 } | 3661 } |
| 3661 | 3662 |
| 3662 #endif // DART_PRECOMPILER | 3663 #endif // DART_PRECOMPILER |
| 3663 | 3664 |
| 3664 } // namespace dart | 3665 } // namespace dart |
| OLD | NEW |