| 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 1331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1342 Code::Handle(function.CurrentCode()).PayloadStart(), | 1342 Code::Handle(function.CurrentCode()).PayloadStart(), |
| 1343 Code::Handle(function.CurrentCode()).Size(), | 1343 Code::Handle(function.CurrentCode()).Size(), |
| 1344 per_compile_timer.TotalElapsedTime()); | 1344 per_compile_timer.TotalElapsedTime()); |
| 1345 } | 1345 } |
| 1346 | 1346 |
| 1347 if (FLAG_support_debugger) { | 1347 if (FLAG_support_debugger) { |
| 1348 isolate->debugger()->NotifyCompilation(function); | 1348 isolate->debugger()->NotifyCompilation(function); |
| 1349 } | 1349 } |
| 1350 | 1350 |
| 1351 if (FLAG_disassemble && FlowGraphPrinter::ShouldPrint(function)) { | 1351 if (FLAG_disassemble && FlowGraphPrinter::ShouldPrint(function)) { |
| 1352 Disassembler::DisassembleCode(function, optimized); | 1352 Disassembler::DisassembleCode(function, result, optimized); |
| 1353 } else if (FLAG_disassemble_optimized && optimized && | 1353 } else if (FLAG_disassemble_optimized && optimized && |
| 1354 FlowGraphPrinter::ShouldPrint(function)) { | 1354 FlowGraphPrinter::ShouldPrint(function)) { |
| 1355 Disassembler::DisassembleCode(function, true); | 1355 Disassembler::DisassembleCode(function, result, true); |
| 1356 } | 1356 } |
| 1357 | 1357 |
| 1358 return result.raw(); | 1358 return result.raw(); |
| 1359 } else { | 1359 } else { |
| 1360 Thread* const thread = Thread::Current(); | 1360 Thread* const thread = Thread::Current(); |
| 1361 StackZone stack_zone(thread); | 1361 StackZone stack_zone(thread); |
| 1362 Error& error = Error::Handle(); | 1362 Error& error = Error::Handle(); |
| 1363 // We got an error during compilation or it is a bailout from background | 1363 // We got an error during compilation or it is a bailout from background |
| 1364 // compilation (e.g., during parsing with EnsureIsFinalized). | 1364 // compilation (e.g., during parsing with EnsureIsFinalized). |
| 1365 error = thread->sticky_error(); | 1365 error = thread->sticky_error(); |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1552 | 1552 |
| 1553 // This is only used from unit tests. | 1553 // This is only used from unit tests. |
| 1554 RawError* Compiler::CompileParsedFunction(ParsedFunction* parsed_function) { | 1554 RawError* Compiler::CompileParsedFunction(ParsedFunction* parsed_function) { |
| 1555 LongJumpScope jump; | 1555 LongJumpScope jump; |
| 1556 if (setjmp(*jump.Set()) == 0) { | 1556 if (setjmp(*jump.Set()) == 0) { |
| 1557 // Non-optimized code generator. | 1557 // Non-optimized code generator. |
| 1558 DartCompilationPipeline pipeline; | 1558 DartCompilationPipeline pipeline; |
| 1559 CompileParsedFunctionHelper helper(parsed_function, false, kNoOSRDeoptId); | 1559 CompileParsedFunctionHelper helper(parsed_function, false, kNoOSRDeoptId); |
| 1560 helper.Compile(&pipeline); | 1560 helper.Compile(&pipeline); |
| 1561 if (FLAG_disassemble) { | 1561 if (FLAG_disassemble) { |
| 1562 Disassembler::DisassembleCode(parsed_function->function(), false); | 1562 Code& code = Code::Handle(parsed_function->function().CurrentCode()); |
| 1563 Disassembler::DisassembleCode(parsed_function->function(), code, false); |
| 1563 } | 1564 } |
| 1564 return Error::null(); | 1565 return Error::null(); |
| 1565 } else { | 1566 } else { |
| 1566 Error& error = Error::Handle(); | 1567 Error& error = Error::Handle(); |
| 1567 Thread* thread = Thread::Current(); | 1568 Thread* thread = Thread::Current(); |
| 1568 // We got an error during compilation. | 1569 // We got an error during compilation. |
| 1569 error = thread->sticky_error(); | 1570 error = thread->sticky_error(); |
| 1570 thread->clear_sticky_error(); | 1571 thread->clear_sticky_error(); |
| 1571 return error.raw(); | 1572 return error.raw(); |
| 1572 } | 1573 } |
| (...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2313 | 2314 |
| 2314 | 2315 |
| 2315 bool BackgroundCompiler::IsDisabled() { | 2316 bool BackgroundCompiler::IsDisabled() { |
| 2316 UNREACHABLE(); | 2317 UNREACHABLE(); |
| 2317 return true; | 2318 return true; |
| 2318 } | 2319 } |
| 2319 | 2320 |
| 2320 #endif // DART_PRECOMPILED_RUNTIME | 2321 #endif // DART_PRECOMPILED_RUNTIME |
| 2321 | 2322 |
| 2322 } // namespace dart | 2323 } // namespace dart |
| OLD | NEW |