Commit 79a8caec authored by Andy Wingo's avatar Andy Wingo

AbortOptimization, RetryOptimization preserve first bailout reason

The current logic appears to have been introduced in
https://codereview.chromium.org/596783002.

R=yangguo@chromium.org
BUG=

Review URL: https://codereview.chromium.org/836033005

Cr-Commit-Position: refs/heads/master@{#26043}
parent c36b5ac6
......@@ -301,7 +301,6 @@ namespace internal {
"Unexpected unused properties of string wrapper") \
V(kUnimplemented, "unimplemented") \
V(kUninitializedKSmiConstantRegister, "Uninitialized kSmiConstantRegister") \
V(kUnknown, "Unknown") \
V(kUnsupportedConstCompoundAssignment, \
"Unsupported const compound assignment") \
V(kUnsupportedCountOperationWithConst, \
......
......@@ -185,7 +185,7 @@ void CompilationInfo::Initialize(Isolate* isolate,
DCHECK(strict_mode() == SLOPPY);
SetStrictMode(shared_info_->strict_mode());
}
bailout_reason_ = kUnknown;
bailout_reason_ = kNoReason;
if (!shared_info().is_null() && shared_info()->is_compiled()) {
// We should initialize the CompilationInfo feedback vector from the
......
......@@ -330,12 +330,15 @@ class CompilationInfo {
}
void AbortOptimization(BailoutReason reason) {
if (bailout_reason_ != kNoReason) bailout_reason_ = reason;
DCHECK(reason != kNoReason);
if (bailout_reason_ == kNoReason) bailout_reason_ = reason;
SetFlag(kDisableFutureOptimization);
}
void RetryOptimization(BailoutReason reason) {
if (bailout_reason_ != kNoReason) bailout_reason_ = reason;
DCHECK(reason != kNoReason);
if (GetFlag(kDisableFutureOptimization)) return;
bailout_reason_ = reason;
}
BailoutReason bailout_reason() const { return bailout_reason_; }
......
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