Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Side by Side Diff: runtime/vm/precompiler.cc

Issue 2601903003: Add assert in the precompiler tree shaker to ensure that no redirecting (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 984 matching lines...) Expand 10 before | Expand all | Expand 10 after
995 AddType(type); 995 AddType(type);
996 996
997 if (cls.IsTypedefClass()) { 997 if (cls.IsTypedefClass()) {
998 AddTypesOf(Function::Handle(Z, cls.signature_function())); 998 AddTypesOf(Function::Handle(Z, cls.signature_function()));
999 } 999 }
1000 } 1000 }
1001 1001
1002 1002
1003 void Precompiler::AddTypesOf(const Function& function) { 1003 void Precompiler::AddTypesOf(const Function& function) {
1004 if (function.IsNull()) return; 1004 if (function.IsNull()) return;
1005 // We don't expect to see a reference to a redicting factory.
1006 ASSERT(!function.IsRedirectingFactory());
1005 if (functions_to_retain_.Lookup(&function) != NULL) return; 1007 if (functions_to_retain_.Lookup(&function) != NULL) return;
1006 functions_to_retain_.Insert(&Function::ZoneHandle(Z, function.raw())); 1008 functions_to_retain_.Insert(&Function::ZoneHandle(Z, function.raw()));
1007 1009
1008 AbstractType& type = AbstractType::Handle(Z); 1010 AbstractType& type = AbstractType::Handle(Z);
1009 type = function.result_type(); 1011 type = function.result_type();
1010 AddType(type); 1012 AddType(type);
1011 for (intptr_t i = 0; i < function.NumParameters(); i++) { 1013 for (intptr_t i = 0; i < function.NumParameters(); i++) {
1012 type = function.ParameterTypeAt(i); 1014 type = function.ParameterTypeAt(i);
1013 AddType(type); 1015 AddType(type);
1014 } 1016 }
(...skipping 2640 matching lines...) Expand 10 before | Expand all | Expand 10 after
3655 3657
3656 ASSERT(FLAG_precompiled_mode); 3658 ASSERT(FLAG_precompiled_mode);
3657 const bool optimized = function.IsOptimizable(); // False for natives. 3659 const bool optimized = function.IsOptimizable(); // False for natives.
3658 DartPrecompilationPipeline pipeline(zone, field_type_map); 3660 DartPrecompilationPipeline pipeline(zone, field_type_map);
3659 return PrecompileFunctionHelper(precompiler, &pipeline, function, optimized); 3661 return PrecompileFunctionHelper(precompiler, &pipeline, function, optimized);
3660 } 3662 }
3661 3663
3662 #endif // DART_PRECOMPILER 3664 #endif // DART_PRECOMPILER
3663 3665
3664 } // namespace dart 3666 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698