| Index: runtime/vm/compiler.cc
|
| diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc
|
| index 93898adc5c69c5b7c51ea6b17078374d2fa7096a..8ff7de470c0f23cf86e50d76e400e4b2adc10076 100644
|
| --- a/runtime/vm/compiler.cc
|
| +++ b/runtime/vm/compiler.cc
|
| @@ -1316,9 +1316,12 @@ static RawError* CompileFunctionHelper(CompilationPipeline* pipeline,
|
| // We got an error during compilation.
|
| error = thread->sticky_error();
|
| thread->clear_sticky_error();
|
| - // The non-optimizing compiler should not bail out.
|
| - ASSERT(error.IsLanguageError() &&
|
| - LanguageError::Cast(error).kind() != Report::kBailout);
|
| + // The non-optimizing compiler can get an unhandled exception
|
| + // due to OOM or Stack overflow errors, it should not however
|
| + // bail out.
|
| + ASSERT(error.IsUnhandledException() ||
|
| + (error.IsLanguageError() &&
|
| + LanguageError::Cast(error).kind() != Report::kBailout));
|
| return error.raw();
|
| }
|
| }
|
| @@ -1339,11 +1342,13 @@ static RawError* CompileFunctionHelper(CompilationPipeline* pipeline,
|
|
|
| if (FLAG_disassemble && FlowGraphPrinter::ShouldPrint(function)) {
|
| SafepointOperationScope safepoint_scope(thread);
|
| + NoHeapGrowthControlScope no_growth_control;
|
| Disassembler::DisassembleCode(function, optimized);
|
| } else if (FLAG_disassemble_optimized &&
|
| optimized &&
|
| FlowGraphPrinter::ShouldPrint(function)) {
|
| SafepointOperationScope safepoint_scope(thread);
|
| + NoHeapGrowthControlScope no_growth_control;
|
| Disassembler::DisassembleCode(function, true);
|
| }
|
|
|
|
|