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 {
// 2) OptimizeGraph: Runs concurrently. No heap allocation or handle derefs.
// 3) GenerateCode: Runs on main thread. No dependency changes.
//
// Each of the three phases can either fail, bail-out to full code generator or
// succeed. Apart from their return value, the status of the phase last run can
// be checked using {last_status()} as well.
// Each of the three phases can either fail or succeed. Apart from their return
// value, the status of the phase last run can be checked using {last_status()}
// 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.
class CompilationJob {
public:
......@@ -578,9 +580,7 @@ class CompilationJob {
: info_(info), compiler_name_(compiler_name), last_status_(SUCCEEDED) {}
virtual ~CompilationJob() {}
enum Status {
FAILED, BAILED_OUT, SUCCEEDED
};
enum Status { FAILED, SUCCEEDED };
MUST_USE_RESULT Status CreateGraph();
MUST_USE_RESULT Status OptimizeGraph();
......@@ -592,12 +592,12 @@ class CompilationJob {
Status RetryOptimization(BailoutReason reason) {
info_->RetryOptimization(reason);
return SetLastStatus(BAILED_OUT);
return SetLastStatus(FAILED);
}
Status AbortOptimization(BailoutReason reason) {
info_->AbortOptimization(reason);
return SetLastStatus(BAILED_OUT);
return SetLastStatus(FAILED);
}
void RecordOptimizationStats();
......
......@@ -561,7 +561,7 @@ PipelineCompilationJob::Status PipelineCompilationJob::GenerateCodeImpl() {
if (info()->bailout_reason() == kNoReason) {
return AbortOptimization(kCodeGenerationFailed);
}
return BAILED_OUT;
return FAILED;
}
info()->dependencies()->Commit(code);
info()->SetCode(code);
......
......@@ -185,7 +185,7 @@ HCompilationJob::Status HCompilationJob::CreateGraphImpl() {
return FAILED;
}
if (graph_ == NULL) return BAILED_OUT;
if (graph_ == NULL) return FAILED;
if (info()->dependencies()->HasAborted()) {
// Dependency has changed during graph creation. Let's try again later.
......@@ -206,7 +206,7 @@ HCompilationJob::Status HCompilationJob::OptimizeGraphImpl() {
info()->AbortOptimization(bailout_reason);
}
return BAILED_OUT;
return FAILED;
}
HCompilationJob::Status HCompilationJob::GenerateCodeImpl() {
......@@ -223,7 +223,7 @@ HCompilationJob::Status HCompilationJob::GenerateCodeImpl() {
if (info()->bailout_reason() == kNoReason) {
return AbortOptimization(kCodeGenerationFailed);
}
return BAILED_OUT;
return FAILED;
}
RegisterWeakObjectsInOptimizedCode(optimized_code);
info()->SetCode(optimized_code);
......
......@@ -107,8 +107,7 @@ void OptimizingCompileDispatcher::CompileNext(CompilationJob* job) {
// The function may have already been optimized by OSR. Simply continue.
CompilationJob::Status status = job->OptimizeGraph();
USE(status); // Prevent an unused-variable error in release mode.
DCHECK(status != CompilationJob::FAILED);
USE(status); // Prevent an unused-variable error.
// The function may have already been optimized by OSR. Simply continue.
// 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