| 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 1983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1994 Array& constants = Array::Handle(Z); | 1994 Array& constants = Array::Handle(Z); |
| 1995 String& name = String::Handle(Z); | 1995 String& name = String::Handle(Z); |
| 1996 | 1996 |
| 1997 #if defined(DEBUG) | 1997 #if defined(DEBUG) |
| 1998 // We are about to remove classes from the class table. For this to be safe, | 1998 // We are about to remove classes from the class table. For this to be safe, |
| 1999 // there must be no instances of these classes on the heap, not even | 1999 // there must be no instances of these classes on the heap, not even |
| 2000 // corpses because the class table entry may be used to find the size of | 2000 // corpses because the class table entry may be used to find the size of |
| 2001 // corpses. Request a full GC and wait for the sweeper tasks to finish before | 2001 // corpses. Request a full GC and wait for the sweeper tasks to finish before |
| 2002 // we continue. | 2002 // we continue. |
| 2003 I->heap()->CollectAllGarbage(); | 2003 I->heap()->CollectAllGarbage(); |
| 2004 I->heap()->WaitForSweeperTasks(); | 2004 I->heap()->WaitForSweeperTasks(T); |
| 2005 #endif | 2005 #endif |
| 2006 | 2006 |
| 2007 ClassTable* class_table = I->class_table(); | 2007 ClassTable* class_table = I->class_table(); |
| 2008 intptr_t num_cids = class_table->NumCids(); | 2008 intptr_t num_cids = class_table->NumCids(); |
| 2009 | 2009 |
| 2010 for (intptr_t cid = kNumPredefinedCids; cid < num_cids; cid++) { | 2010 for (intptr_t cid = kNumPredefinedCids; cid < num_cids; cid++) { |
| 2011 if (!class_table->IsValidIndex(cid)) continue; | 2011 if (!class_table->IsValidIndex(cid)) continue; |
| 2012 if (!class_table->HasValidClassAt(cid)) continue; | 2012 if (!class_table->HasValidClassAt(cid)) continue; |
| 2013 | 2013 |
| 2014 cls = class_table->At(cid); | 2014 cls = class_table->At(cid); |
| (...skipping 1640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3655 | 3655 |
| 3656 ASSERT(FLAG_precompiled_mode); | 3656 ASSERT(FLAG_precompiled_mode); |
| 3657 const bool optimized = function.IsOptimizable(); // False for natives. | 3657 const bool optimized = function.IsOptimizable(); // False for natives. |
| 3658 DartPrecompilationPipeline pipeline(zone, field_type_map); | 3658 DartPrecompilationPipeline pipeline(zone, field_type_map); |
| 3659 return PrecompileFunctionHelper(precompiler, &pipeline, function, optimized); | 3659 return PrecompileFunctionHelper(precompiler, &pipeline, function, optimized); |
| 3660 } | 3660 } |
| 3661 | 3661 |
| 3662 #endif // DART_PRECOMPILER | 3662 #endif // DART_PRECOMPILER |
| 3663 | 3663 |
| 3664 } // namespace dart | 3664 } // namespace dart |
| OLD | NEW |