Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1144)

Unified Diff: runtime/vm/compiler.cc

Issue 2341523002: VM: Better handling of OOM errors in the background compiler (Closed)
Patch Set: lint Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/exceptions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/compiler.cc
diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc
index aa927375ae9320507950f584756c7d9c12469773..314454544d3137d0ce9ca3db671e16179e63cc9f 100644
--- a/runtime/vm/compiler.cc
+++ b/runtime/vm/compiler.cc
@@ -1284,8 +1284,9 @@ static RawError* CompileFunctionHelper(CompilationPipeline* pipeline,
// We got an error during compilation.
error = thread->sticky_error();
thread->clear_sticky_error();
- if (error.IsLanguageError() &&
- LanguageError::Cast(error).kind() == Report::kBailout) {
+ if ((error.IsLanguageError() &&
+ LanguageError::Cast(error).kind() == Report::kBailout) ||
+ error.IsUnhandledException()) {
if (FLAG_trace_compiler) {
THR_Print("--> disabling optimizations for '%s'\n",
function.ToFullyQualifiedCString());
@@ -1360,9 +1361,6 @@ static RawError* CompileFunctionHelper(CompilationPipeline* pipeline,
}
return Error::null();
}
- // Unoptimized compilation or precompilation may encounter compile-time
- // errors, but regular optimized compilation should not.
- ASSERT(!optimized);
// Do not attempt to optimize functions that can cause errors.
function.set_is_optimizable(false);
return error.raw();
@@ -1862,15 +1860,9 @@ void BackgroundCompiler::Run() {
while (running_ && !function.IsNull() && !isolate_->IsTopLevelParsing()) {
// Check that we have aggregated and cleared the stats.
ASSERT(thread->compiler_stats()->IsCleared());
- const Error& error = Error::Handle(zone,
- Compiler::CompileOptimizedFunction(thread,
- function,
- Compiler::kNoOSRDeoptId));
- // TODO(srdjan): We do not expect errors while compiling optimized
- // code, any errors should have been caught when compiling
- // unoptimized code. Any issues while optimizing are flagged by
- // making the result invalid.
- ASSERT(error.IsNull());
+ Compiler::CompileOptimizedFunction(thread,
+ function,
+ Compiler::kNoOSRDeoptId);
#ifndef PRODUCT
Isolate* isolate = thread->isolate();
isolate->aggregate_compiler_stats()->Add(*thread->compiler_stats());
« no previous file with comments | « no previous file | runtime/vm/exceptions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698