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

Unified Diff: src/compiler.h

Issue 596783002: Refactor bailout reasons and disable optimization in more cases. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: remove bogus assertion Created 6 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 | « src/code-stubs-hydrogen.cc ('k') | src/compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.h
diff --git a/src/compiler.h b/src/compiler.h
index ea93f408c653127fe2c3cd58bf49140df3efdf6b..9617afc9f3c8729a5e375f8a99f2b9bc677012d3 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,16 @@ class CompilationInfo {
SaveHandle(&unoptimized_code_);
}
+ void AbortOptimization(BailoutReason reason) {
+ if (bailout_reason_ != kNoReason) bailout_reason_ = reason;
+ SetFlag(kDisableFutureOptimization);
+ }
+
+ void RetryOptimization(BailoutReason reason) {
+ 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 +366,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 +473,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 +596,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);
}
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698