| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/compiler.h" | 5 #include "vm/compiler.h" |
| 6 | 6 |
| 7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
| 8 | 8 |
| 9 #include "vm/ast_printer.h" | 9 #include "vm/ast_printer.h" |
| 10 #include "vm/block_scheduler.h" | 10 #include "vm/block_scheduler.h" |
| (...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 636 function.AttachCode(code); | 636 function.AttachCode(code); |
| 637 } | 637 } |
| 638 if (parsed_function()->HasDeferredPrefixes()) { | 638 if (parsed_function()->HasDeferredPrefixes()) { |
| 639 ASSERT(!FLAG_load_deferred_eagerly); | 639 ASSERT(!FLAG_load_deferred_eagerly); |
| 640 ZoneGrowableArray<const LibraryPrefix*>* prefixes = | 640 ZoneGrowableArray<const LibraryPrefix*>* prefixes = |
| 641 parsed_function()->deferred_prefixes(); | 641 parsed_function()->deferred_prefixes(); |
| 642 for (intptr_t i = 0; i < prefixes->length(); i++) { | 642 for (intptr_t i = 0; i < prefixes->length(); i++) { |
| 643 (*prefixes)[i]->RegisterDependentCode(code); | 643 (*prefixes)[i]->RegisterDependentCode(code); |
| 644 } | 644 } |
| 645 } | 645 } |
| 646 | |
| 647 if (FLAG_disassemble && FlowGraphPrinter::ShouldPrint(function)) { | |
| 648 Disassembler::DisassembleCode(function, optimized()); | |
| 649 } else if (FLAG_disassemble_optimized && | |
| 650 optimized() && | |
| 651 FlowGraphPrinter::ShouldPrint(function)) { | |
| 652 Disassembler::DisassembleCode(function, true); | |
| 653 } | |
| 654 } | 646 } |
| 655 | 647 |
| 656 | 648 |
| 657 void CompileParsedFunctionHelper::CheckIfBackgroundCompilerIsBeingStopped() { | 649 void CompileParsedFunctionHelper::CheckIfBackgroundCompilerIsBeingStopped() { |
| 658 ASSERT(Compiler::IsBackgroundCompilation()); | 650 ASSERT(Compiler::IsBackgroundCompilation()); |
| 659 if (!isolate()->background_compiler()->is_running()) { | 651 if (!isolate()->background_compiler()->is_running()) { |
| 660 // The background compiler is being stopped. | 652 // The background compiler is being stopped. |
| 661 Compiler::AbortBackgroundCompilation(Thread::kNoDeoptId, | 653 Compiler::AbortBackgroundCompilation(Thread::kNoDeoptId, |
| 662 "Background compilation is being stopped"); | 654 "Background compilation is being stopped"); |
| 663 } | 655 } |
| (...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1316 function.ToFullyQualifiedCString(), | 1308 function.ToFullyQualifiedCString(), |
| 1317 Code::Handle(function.CurrentCode()).EntryPoint(), | 1309 Code::Handle(function.CurrentCode()).EntryPoint(), |
| 1318 Code::Handle(function.CurrentCode()).Size(), | 1310 Code::Handle(function.CurrentCode()).Size(), |
| 1319 per_compile_timer.TotalElapsedTime()); | 1311 per_compile_timer.TotalElapsedTime()); |
| 1320 } | 1312 } |
| 1321 | 1313 |
| 1322 if (FLAG_support_debugger) { | 1314 if (FLAG_support_debugger) { |
| 1323 isolate->debugger()->NotifyCompilation(function); | 1315 isolate->debugger()->NotifyCompilation(function); |
| 1324 } | 1316 } |
| 1325 | 1317 |
| 1318 if (FLAG_disassemble && FlowGraphPrinter::ShouldPrint(function)) { |
| 1319 SafepointOperationScope safepoint_scope(thread); |
| 1320 Disassembler::DisassembleCode(function, optimized); |
| 1321 } else if (FLAG_disassemble_optimized && |
| 1322 optimized && |
| 1323 FlowGraphPrinter::ShouldPrint(function)) { |
| 1324 SafepointOperationScope safepoint_scope(thread); |
| 1325 Disassembler::DisassembleCode(function, true); |
| 1326 } |
| 1327 |
| 1326 DEBUG_ONLY(CheckInliningIntervals(function)); | 1328 DEBUG_ONLY(CheckInliningIntervals(function)); |
| 1327 return Error::null(); | 1329 return Error::null(); |
| 1328 } else { | 1330 } else { |
| 1329 Thread* const thread = Thread::Current(); | 1331 Thread* const thread = Thread::Current(); |
| 1330 StackZone stack_zone(thread); | 1332 StackZone stack_zone(thread); |
| 1331 Error& error = Error::Handle(); | 1333 Error& error = Error::Handle(); |
| 1332 // We got an error during compilation or it is a bailout from background | 1334 // We got an error during compilation or it is a bailout from background |
| 1333 // compilation (e.g., during parsing with EnsureIsFinalized). | 1335 // compilation (e.g., during parsing with EnsureIsFinalized). |
| 1334 error = thread->sticky_error(); | 1336 error = thread->sticky_error(); |
| 1335 thread->clear_sticky_error(); | 1337 thread->clear_sticky_error(); |
| (...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2161 | 2163 |
| 2162 | 2164 |
| 2163 bool BackgroundCompiler::IsDisabled() { | 2165 bool BackgroundCompiler::IsDisabled() { |
| 2164 UNREACHABLE(); | 2166 UNREACHABLE(); |
| 2165 return true; | 2167 return true; |
| 2166 } | 2168 } |
| 2167 | 2169 |
| 2168 #endif // DART_PRECOMPILED_RUNTIME | 2170 #endif // DART_PRECOMPILED_RUNTIME |
| 2169 | 2171 |
| 2170 } // namespace dart | 2172 } // namespace dart |
| OLD | NEW |