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 1703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1714 field ^= fields.At(j); | 1714 field ^= fields.At(j); |
1715 bool retain = fields_to_retain_.Lookup(&field) != NULL; | 1715 bool retain = fields_to_retain_.Lookup(&field) != NULL; |
1716 if (retain) { | 1716 if (retain) { |
1717 retained_fields.Add(field); | 1717 retained_fields.Add(field); |
1718 type = field.type(); | 1718 type = field.type(); |
1719 AddType(type); | 1719 AddType(type); |
1720 } else { | 1720 } else { |
1721 bool top_level = cls.IsTopLevel(); | 1721 bool top_level = cls.IsTopLevel(); |
1722 if (top_level) { | 1722 if (top_level) { |
1723 name = field.DictionaryName(); | 1723 name = field.DictionaryName(); |
1724 bool removed = lib.RemoveObject(field, name); | 1724 lib.RemoveObject(field, name); |
1725 ASSERT(removed); | |
1726 } | 1725 } |
1727 dropped_field_count_++; | 1726 dropped_field_count_++; |
1728 if (FLAG_trace_precompiler) { | 1727 if (FLAG_trace_precompiler) { |
1729 THR_Print("Dropping field %s\n", | 1728 THR_Print("Dropping field %s\n", |
1730 field.ToCString()); | 1729 field.ToCString()); |
1731 } | 1730 } |
1732 } | 1731 } |
1733 } | 1732 } |
1734 | 1733 |
1735 if (retained_fields.Length() > 0) { | 1734 if (retained_fields.Length() > 0) { |
(...skipping 1604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3340 | 3339 |
3341 ASSERT(FLAG_precompiled_mode); | 3340 ASSERT(FLAG_precompiled_mode); |
3342 const bool optimized = function.IsOptimizable(); // False for natives. | 3341 const bool optimized = function.IsOptimizable(); // False for natives. |
3343 DartPrecompilationPipeline pipeline(zone, field_type_map); | 3342 DartPrecompilationPipeline pipeline(zone, field_type_map); |
3344 return PrecompileFunctionHelper(&pipeline, function, optimized); | 3343 return PrecompileFunctionHelper(&pipeline, function, optimized); |
3345 } | 3344 } |
3346 | 3345 |
3347 #endif // DART_PRECOMPILER | 3346 #endif // DART_PRECOMPILER |
3348 | 3347 |
3349 } // namespace dart | 3348 } // namespace dart |
OLD | NEW |