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 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
475 I->object_store()->set_stream_iterator_class(null_class); | 475 I->object_store()->set_stream_iterator_class(null_class); |
476 I->object_store()->set_symbol_class(null_class); | 476 I->object_store()->set_symbol_class(null_class); |
477 I->object_store()->set_compiletime_error_class(null_class); | 477 I->object_store()->set_compiletime_error_class(null_class); |
478 I->object_store()->set_simple_instance_of_function(null_function); | 478 I->object_store()->set_simple_instance_of_function(null_function); |
479 I->object_store()->set_simple_instance_of_true_function(null_function); | 479 I->object_store()->set_simple_instance_of_true_function(null_function); |
480 I->object_store()->set_simple_instance_of_false_function(null_function); | 480 I->object_store()->set_simple_instance_of_false_function(null_function); |
481 I->object_store()->set_async_set_thread_stack_trace(null_function); | 481 I->object_store()->set_async_set_thread_stack_trace(null_function); |
482 I->object_store()->set_async_star_move_next_helper(null_function); | 482 I->object_store()->set_async_star_move_next_helper(null_function); |
483 I->object_store()->set_complete_on_async_return(null_function); | 483 I->object_store()->set_complete_on_async_return(null_function); |
484 I->object_store()->set_async_star_stream_controller(null_class); | 484 I->object_store()->set_async_star_stream_controller(null_class); |
485 DropMetadata(); | |
485 DropLibraryEntries(); | 486 DropLibraryEntries(); |
486 } | 487 } |
487 DropClasses(); | 488 DropClasses(); |
488 DropLibraries(); | 489 DropLibraries(); |
489 | 490 |
490 BindStaticCalls(); | 491 BindStaticCalls(); |
491 SwitchICCalls(); | 492 SwitchICCalls(); |
492 | 493 |
493 ProgramVisitor::Dedup(); | 494 ProgramVisitor::Dedup(); |
494 | 495 |
(...skipping 1466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1961 retain = true; | 1962 retain = true; |
1962 } | 1963 } |
1963 | 1964 |
1964 if (retain) { | 1965 if (retain) { |
1965 AddTypesOf(cls); | 1966 AddTypesOf(cls); |
1966 } | 1967 } |
1967 } | 1968 } |
1968 } | 1969 } |
1969 } | 1970 } |
1970 | 1971 |
1972 void Precompiler::DropMetadata() { | |
1973 Library& lib = Library::Handle(Z); | |
1974 GrowableObjectArray& null_growable_list = GrowableObjectArray::Handle(Z); | |
siva
2017/08/24 21:35:50
const GrowableObjec......
rmacnak
2017/08/24 23:31:53
Done.
| |
1975 Array& dependencies = Array::Handle(Z); | |
1976 Namespace& ns = Namespace::Handle(Z); | |
1977 Field& null_field = Field::Handle(Z); | |
siva
2017/08/24 21:35:50
const Field& null_field
rmacnak
2017/08/24 23:31:53
Done.
| |
1978 | |
1979 for (intptr_t i = 0; i < libraries_.Length(); i++) { | |
1980 lib ^= libraries_.At(i); | |
1981 lib.set_metadata(null_growable_list); | |
1982 | |
1983 dependencies = lib.imports(); | |
1984 for (intptr_t j = 0; j < dependencies.Length(); j++) { | |
1985 ns ^= dependencies.At(j); | |
1986 if (!ns.IsNull()) { | |
1987 ns.set_metadata_field(null_field); | |
1988 } | |
1989 } | |
1990 | |
1991 dependencies = lib.exports(); | |
1992 for (intptr_t j = 0; j < dependencies.Length(); j++) { | |
1993 ns ^= dependencies.At(j); | |
1994 if (!ns.IsNull()) { | |
1995 ns.set_metadata_field(null_field); | |
1996 } | |
1997 } | |
1998 } | |
1999 } | |
2000 | |
1971 void Precompiler::DropLibraryEntries() { | 2001 void Precompiler::DropLibraryEntries() { |
1972 Library& lib = Library::Handle(Z); | 2002 Library& lib = Library::Handle(Z); |
1973 Array& dict = Array::Handle(Z); | 2003 Array& dict = Array::Handle(Z); |
1974 Object& entry = Object::Handle(Z); | 2004 Object& entry = Object::Handle(Z); |
1975 | 2005 |
1976 for (intptr_t i = 0; i < libraries_.Length(); i++) { | 2006 for (intptr_t i = 0; i < libraries_.Length(); i++) { |
1977 lib ^= libraries_.At(i); | 2007 lib ^= libraries_.At(i); |
1978 | 2008 |
1979 dict = lib.dictionary(); | 2009 dict = lib.dictionary(); |
1980 intptr_t dict_size = dict.Length() - 1; | 2010 intptr_t dict_size = dict.Length() - 1; |
(...skipping 1361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3342 | 3372 |
3343 ASSERT(FLAG_precompiled_mode); | 3373 ASSERT(FLAG_precompiled_mode); |
3344 const bool optimized = function.IsOptimizable(); // False for natives. | 3374 const bool optimized = function.IsOptimizable(); // False for natives. |
3345 DartPrecompilationPipeline pipeline(zone, field_type_map); | 3375 DartPrecompilationPipeline pipeline(zone, field_type_map); |
3346 return PrecompileFunctionHelper(precompiler, &pipeline, function, optimized); | 3376 return PrecompileFunctionHelper(precompiler, &pipeline, function, optimized); |
3347 } | 3377 } |
3348 | 3378 |
3349 #endif // DART_PRECOMPILER | 3379 #endif // DART_PRECOMPILER |
3350 | 3380 |
3351 } // namespace dart | 3381 } // namespace dart |
OLD | NEW |