Commit a1cd3cc8 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[compiler] Remove deprecated CompilationJob status.

The status FAILED and BAILED_OUT only distinguishes between whether an
exception is pending or not. Such a distinction is obsolete by now as
all callers check for pending exceptions directly. Also it is impossible
for any concurrent part of the job to actually set a pending exception,
hence even the assertion that the concurrent part does not return FAILED
is obsolete.

R=bmeurer@chromium.org

Review-Url: https://codereview.chromium.org/1926693003
Cr-Commit-Position: refs/heads/master@{#35834}
parent 306c412c
...@@ -568,9 +568,11 @@ class CompilationInfo { ...@@ -568,9 +568,11 @@ class CompilationInfo {
// 2) OptimizeGraph: Runs concurrently. No heap allocation or handle derefs. // 2) OptimizeGraph: Runs concurrently. No heap allocation or handle derefs.
// 3) GenerateCode: Runs on main thread. No dependency changes. // 3) GenerateCode: Runs on main thread. No dependency changes.
// //
// Each of the three phases can either fail, bail-out to full code generator or // Each of the three phases can either fail or succeed. Apart from their return
// succeed. Apart from their return value, the status of the phase last run can // value, the status of the phase last run can be checked using {last_status()}
// be checked using {last_status()} as well. // as well. When failing we distinguish between the following levels:
// a) AbortOptimization: Persistent failure, disable future optimization.
// b) RetryOptimzation: Transient failure, try again next time.
// TODO(mstarzinger): Make CompilationInfo base embedded. // TODO(mstarzinger): Make CompilationInfo base embedded.
class CompilationJob { class CompilationJob {
public: public:
...@@ -578,9 +580,7 @@ class CompilationJob { ...@@ -578,9 +580,7 @@ class CompilationJob {
: info_(info), compiler_name_(compiler_name), last_status_(SUCCEEDED) {} : info_(info), compiler_name_(compiler_name), last_status_(SUCCEEDED) {}
virtual ~CompilationJob() {} virtual ~CompilationJob() {}
enum Status { enum Status { FAILED, SUCCEEDED };
FAILED, BAILED_OUT, SUCCEEDED
};
MUST_USE_RESULT Status CreateGraph(); MUST_USE_RESULT Status CreateGraph();
MUST_USE_RESULT Status OptimizeGraph(); MUST_USE_RESULT Status OptimizeGraph();
...@@ -592,12 +592,12 @@ class CompilationJob { ...@@ -592,12 +592,12 @@ class CompilationJob {
Status RetryOptimization(BailoutReason reason) { Status RetryOptimization(BailoutReason reason) {
info_->RetryOptimization(reason); info_->RetryOptimization(reason);
return SetLastStatus(BAILED_OUT); return SetLastStatus(FAILED);
} }
Status AbortOptimization(BailoutReason reason) { Status AbortOptimization(BailoutReason reason) {
info_->AbortOptimization(reason); info_->AbortOptimization(reason);
return SetLastStatus(BAILED_OUT); return SetLastStatus(FAILED);
} }
void RecordOptimizationStats(); void RecordOptimizationStats();
......
...@@ -561,7 +561,7 @@ PipelineCompilationJob::Status PipelineCompilationJob::GenerateCodeImpl() { ...@@ -561,7 +561,7 @@ PipelineCompilationJob::Status PipelineCompilationJob::GenerateCodeImpl() {
if (info()->bailout_reason() == kNoReason) { if (info()->bailout_reason() == kNoReason) {
return AbortOptimization(kCodeGenerationFailed); return AbortOptimization(kCodeGenerationFailed);
} }
return BAILED_OUT; return FAILED;
} }
info()->dependencies()->Commit(code); info()->dependencies()->Commit(code);
info()->SetCode(code); info()->SetCode(code);
......
...@@ -185,7 +185,7 @@ HCompilationJob::Status HCompilationJob::CreateGraphImpl() { ...@@ -185,7 +185,7 @@ HCompilationJob::Status HCompilationJob::CreateGraphImpl() {
return FAILED; return FAILED;
} }
if (graph_ == NULL) return BAILED_OUT; if (graph_ == NULL) return FAILED;
if (info()->dependencies()->HasAborted()) { if (info()->dependencies()->HasAborted()) {
// Dependency has changed during graph creation. Let's try again later. // Dependency has changed during graph creation. Let's try again later.
...@@ -206,7 +206,7 @@ HCompilationJob::Status HCompilationJob::OptimizeGraphImpl() { ...@@ -206,7 +206,7 @@ HCompilationJob::Status HCompilationJob::OptimizeGraphImpl() {
info()->AbortOptimization(bailout_reason); info()->AbortOptimization(bailout_reason);
} }
return BAILED_OUT; return FAILED;
} }
HCompilationJob::Status HCompilationJob::GenerateCodeImpl() { HCompilationJob::Status HCompilationJob::GenerateCodeImpl() {
...@@ -223,7 +223,7 @@ HCompilationJob::Status HCompilationJob::GenerateCodeImpl() { ...@@ -223,7 +223,7 @@ HCompilationJob::Status HCompilationJob::GenerateCodeImpl() {
if (info()->bailout_reason() == kNoReason) { if (info()->bailout_reason() == kNoReason) {
return AbortOptimization(kCodeGenerationFailed); return AbortOptimization(kCodeGenerationFailed);
} }
return BAILED_OUT; return FAILED;
} }
RegisterWeakObjectsInOptimizedCode(optimized_code); RegisterWeakObjectsInOptimizedCode(optimized_code);
info()->SetCode(optimized_code); info()->SetCode(optimized_code);
......
...@@ -107,8 +107,7 @@ void OptimizingCompileDispatcher::CompileNext(CompilationJob* job) { ...@@ -107,8 +107,7 @@ void OptimizingCompileDispatcher::CompileNext(CompilationJob* job) {
// The function may have already been optimized by OSR. Simply continue. // The function may have already been optimized by OSR. Simply continue.
CompilationJob::Status status = job->OptimizeGraph(); CompilationJob::Status status = job->OptimizeGraph();
USE(status); // Prevent an unused-variable error in release mode. USE(status); // Prevent an unused-variable error.
DCHECK(status != CompilationJob::FAILED);
// The function may have already been optimized by OSR. Simply continue. // The function may have already been optimized by OSR. Simply continue.
// Use a mutex to make sure that functions marked for install // Use a mutex to make sure that functions marked for install
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment