| Index: src/compiler.h
|
| diff --git a/src/compiler.h b/src/compiler.h
|
| index ea93f408c653127fe2c3cd58bf49140df3efdf6b..d13aa17686caee1660ef9b377b6fcd1f5e380583 100644
|
| --- a/src/compiler.h
|
| +++ b/src/compiler.h
|
| @@ -7,6 +7,7 @@
|
|
|
| #include "src/allocation.h"
|
| #include "src/ast.h"
|
| +#include "src/bailout-reason.h"
|
| #include "src/zone.h"
|
|
|
| namespace v8 {
|
| @@ -82,7 +83,9 @@ class CompilationInfo {
|
| kSerializing = 1 << 15,
|
| kContextSpecializing = 1 << 16,
|
| kInliningEnabled = 1 << 17,
|
| - kTypingEnabled = 1 << 18
|
| + kTypingEnabled = 1 << 18,
|
| + kDisableFutureOptimization = 1 << 19,
|
| + kAbortedDueToDependency = 1 << 20
|
| };
|
|
|
| CompilationInfo(Handle<JSFunction> closure, Zone* zone);
|
| @@ -319,8 +322,18 @@ class CompilationInfo {
|
| SaveHandle(&unoptimized_code_);
|
| }
|
|
|
| + void AbortOptimization(BailoutReason reason) {
|
| + DCHECK_EQ(OPTIMIZE, mode_);
|
| + if (bailout_reason_ != kNoReason) bailout_reason_ = reason;
|
| + SetFlag(kDisableFutureOptimization);
|
| + }
|
| +
|
| + void RetryOptimization(BailoutReason reason) {
|
| + DCHECK_EQ(OPTIMIZE, mode_);
|
| + if (bailout_reason_ != kNoReason) bailout_reason_ = reason;
|
| + }
|
| +
|
| BailoutReason bailout_reason() const { return bailout_reason_; }
|
| - void set_bailout_reason(BailoutReason reason) { bailout_reason_ = reason; }
|
|
|
| int prologue_offset() const {
|
| DCHECK_NE(Code::kPrologueOffsetNotSet, prologue_offset_);
|
| @@ -355,12 +368,12 @@ class CompilationInfo {
|
|
|
| void AbortDueToDependencyChange() {
|
| DCHECK(!OptimizingCompilerThread::IsOptimizerThread(isolate()));
|
| - abort_due_to_dependency_ = true;
|
| + SetFlag(kAbortedDueToDependency);
|
| }
|
|
|
| - bool HasAbortedDueToDependencyChange() {
|
| + bool HasAbortedDueToDependencyChange() const {
|
| DCHECK(!OptimizingCompilerThread::IsOptimizerThread(isolate()));
|
| - return abort_due_to_dependency_;
|
| + return GetFlag(kAbortedDueToDependency);
|
| }
|
|
|
| bool HasSameOsrEntry(Handle<JSFunction> function, BailoutId osr_ast_id) {
|
| @@ -462,9 +475,6 @@ class CompilationInfo {
|
| // data. Keep track which code we patched.
|
| Handle<Code> unoptimized_code_;
|
|
|
| - // Flag whether compilation needs to be aborted due to dependency change.
|
| - bool abort_due_to_dependency_;
|
| -
|
| // The zone from which the compilation pipeline working on this
|
| // CompilationInfo allocates.
|
| Zone* zone_;
|
| @@ -588,18 +598,13 @@ class OptimizedCompileJob: public ZoneObject {
|
| CompilationInfo* info() const { return info_; }
|
| Isolate* isolate() const { return info()->isolate(); }
|
|
|
| - MUST_USE_RESULT Status AbortOptimization(
|
| - BailoutReason reason = kNoReason) {
|
| - if (reason != kNoReason) info_->set_bailout_reason(reason);
|
| + Status RetryOptimization(BailoutReason reason) {
|
| + info_->RetryOptimization(reason);
|
| return SetLastStatus(BAILED_OUT);
|
| }
|
|
|
| - MUST_USE_RESULT Status AbortAndDisableOptimization(
|
| - BailoutReason reason = kNoReason) {
|
| - if (reason != kNoReason) info_->set_bailout_reason(reason);
|
| - // Reference to shared function info does not change between phases.
|
| - AllowDeferredHandleDereference allow_handle_dereference;
|
| - info_->shared_info()->DisableOptimization(info_->bailout_reason());
|
| + Status AbortOptimization(BailoutReason reason) {
|
| + info_->AbortOptimization(reason);
|
| return SetLastStatus(BAILED_OUT);
|
| }
|
|
|
|
|