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 1298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1309 function.ToFullyQualifiedCString()); | 1309 function.ToFullyQualifiedCString()); |
1310 } | 1310 } |
1311 function.SetIsOptimizable(false); | 1311 function.SetIsOptimizable(false); |
1312 return Error::null(); | 1312 return Error::null(); |
1313 } else { | 1313 } else { |
1314 // Encountered error. | 1314 // Encountered error. |
1315 Error& error = Error::Handle(); | 1315 Error& error = Error::Handle(); |
1316 // We got an error during compilation. | 1316 // We got an error during compilation. |
1317 error = thread->sticky_error(); | 1317 error = thread->sticky_error(); |
1318 thread->clear_sticky_error(); | 1318 thread->clear_sticky_error(); |
1319 // The non-optimizing compiler should not bail out. | 1319 // The non-optimizing compiler can get an unhandled exception |
1320 ASSERT(error.IsLanguageError() && | 1320 // due to OOM or Stack overflow errors, it should not however |
1321 LanguageError::Cast(error).kind() != Report::kBailout); | 1321 // bail out. |
| 1322 ASSERT(error.IsUnhandledException() || |
| 1323 (error.IsLanguageError() && |
| 1324 LanguageError::Cast(error).kind() != Report::kBailout)); |
1322 return error.raw(); | 1325 return error.raw(); |
1323 } | 1326 } |
1324 } | 1327 } |
1325 | 1328 |
1326 per_compile_timer.Stop(); | 1329 per_compile_timer.Stop(); |
1327 | 1330 |
1328 if (trace_compiler && success) { | 1331 if (trace_compiler && success) { |
1329 THR_Print("--> '%s' entry: %#" Px " size: %" Pd " time: %" Pd64 " us\n", | 1332 THR_Print("--> '%s' entry: %#" Px " size: %" Pd " time: %" Pd64 " us\n", |
1330 function.ToFullyQualifiedCString(), | 1333 function.ToFullyQualifiedCString(), |
1331 Code::Handle(function.CurrentCode()).PayloadStart(), | 1334 Code::Handle(function.CurrentCode()).PayloadStart(), |
1332 Code::Handle(function.CurrentCode()).Size(), | 1335 Code::Handle(function.CurrentCode()).Size(), |
1333 per_compile_timer.TotalElapsedTime()); | 1336 per_compile_timer.TotalElapsedTime()); |
1334 } | 1337 } |
1335 | 1338 |
1336 if (FLAG_support_debugger) { | 1339 if (FLAG_support_debugger) { |
1337 isolate->debugger()->NotifyCompilation(function); | 1340 isolate->debugger()->NotifyCompilation(function); |
1338 } | 1341 } |
1339 | 1342 |
1340 if (FLAG_disassemble && FlowGraphPrinter::ShouldPrint(function)) { | 1343 if (FLAG_disassemble && FlowGraphPrinter::ShouldPrint(function)) { |
1341 SafepointOperationScope safepoint_scope(thread); | 1344 SafepointOperationScope safepoint_scope(thread); |
| 1345 NoHeapGrowthControlScope no_growth_control; |
1342 Disassembler::DisassembleCode(function, optimized); | 1346 Disassembler::DisassembleCode(function, optimized); |
1343 } else if (FLAG_disassemble_optimized && | 1347 } else if (FLAG_disassemble_optimized && |
1344 optimized && | 1348 optimized && |
1345 FlowGraphPrinter::ShouldPrint(function)) { | 1349 FlowGraphPrinter::ShouldPrint(function)) { |
1346 SafepointOperationScope safepoint_scope(thread); | 1350 SafepointOperationScope safepoint_scope(thread); |
| 1351 NoHeapGrowthControlScope no_growth_control; |
1347 Disassembler::DisassembleCode(function, true); | 1352 Disassembler::DisassembleCode(function, true); |
1348 } | 1353 } |
1349 | 1354 |
1350 DEBUG_ONLY(CheckInliningIntervals(function)); | 1355 DEBUG_ONLY(CheckInliningIntervals(function)); |
1351 return Error::null(); | 1356 return Error::null(); |
1352 } else { | 1357 } else { |
1353 Thread* const thread = Thread::Current(); | 1358 Thread* const thread = Thread::Current(); |
1354 StackZone stack_zone(thread); | 1359 StackZone stack_zone(thread); |
1355 Error& error = Error::Handle(); | 1360 Error& error = Error::Handle(); |
1356 // We got an error during compilation or it is a bailout from background | 1361 // We got an error during compilation or it is a bailout from background |
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2174 | 2179 |
2175 | 2180 |
2176 bool BackgroundCompiler::IsDisabled() { | 2181 bool BackgroundCompiler::IsDisabled() { |
2177 UNREACHABLE(); | 2182 UNREACHABLE(); |
2178 return true; | 2183 return true; |
2179 } | 2184 } |
2180 | 2185 |
2181 #endif // DART_PRECOMPILED_RUNTIME | 2186 #endif // DART_PRECOMPILED_RUNTIME |
2182 | 2187 |
2183 } // namespace dart | 2188 } // namespace dart |
OLD | NEW |