Fix data race when concurrent compilation is aborted due to dependency change.
R=marja@chromium.org BUG=chromium:419189 LOG=N Review URL: https://codereview.chromium.org/616263003 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24361 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
b8288c7535
commit
67f43055d2
@ -52,7 +52,8 @@ CompilationInfo::CompilationInfo(Handle<Script> script, Zone* zone)
|
||||
parameter_count_(0),
|
||||
optimization_id_(-1),
|
||||
ast_value_factory_(NULL),
|
||||
ast_value_factory_owned_(false) {
|
||||
ast_value_factory_owned_(false),
|
||||
aborted_due_to_dependency_change_(false) {
|
||||
Initialize(script->GetIsolate(), BASE, zone);
|
||||
}
|
||||
|
||||
@ -65,7 +66,8 @@ CompilationInfo::CompilationInfo(Isolate* isolate, Zone* zone)
|
||||
parameter_count_(0),
|
||||
optimization_id_(-1),
|
||||
ast_value_factory_(NULL),
|
||||
ast_value_factory_owned_(false) {
|
||||
ast_value_factory_owned_(false),
|
||||
aborted_due_to_dependency_change_(false) {
|
||||
Initialize(isolate, STUB, zone);
|
||||
}
|
||||
|
||||
@ -80,7 +82,8 @@ CompilationInfo::CompilationInfo(Handle<SharedFunctionInfo> shared_info,
|
||||
parameter_count_(0),
|
||||
optimization_id_(-1),
|
||||
ast_value_factory_(NULL),
|
||||
ast_value_factory_owned_(false) {
|
||||
ast_value_factory_owned_(false),
|
||||
aborted_due_to_dependency_change_(false) {
|
||||
Initialize(script_->GetIsolate(), BASE, zone);
|
||||
}
|
||||
|
||||
@ -96,7 +99,8 @@ CompilationInfo::CompilationInfo(Handle<JSFunction> closure, Zone* zone)
|
||||
parameter_count_(0),
|
||||
optimization_id_(-1),
|
||||
ast_value_factory_(NULL),
|
||||
ast_value_factory_owned_(false) {
|
||||
ast_value_factory_owned_(false),
|
||||
aborted_due_to_dependency_change_(false) {
|
||||
Initialize(script_->GetIsolate(), BASE, zone);
|
||||
}
|
||||
|
||||
@ -109,7 +113,8 @@ CompilationInfo::CompilationInfo(HydrogenCodeStub* stub, Isolate* isolate,
|
||||
parameter_count_(0),
|
||||
optimization_id_(-1),
|
||||
ast_value_factory_(NULL),
|
||||
ast_value_factory_owned_(false) {
|
||||
ast_value_factory_owned_(false),
|
||||
aborted_due_to_dependency_change_(false) {
|
||||
Initialize(isolate, STUB, zone);
|
||||
code_stub_ = stub;
|
||||
}
|
||||
@ -126,7 +131,8 @@ CompilationInfo::CompilationInfo(
|
||||
parameter_count_(0),
|
||||
optimization_id_(-1),
|
||||
ast_value_factory_(NULL),
|
||||
ast_value_factory_owned_(false) {
|
||||
ast_value_factory_owned_(false),
|
||||
aborted_due_to_dependency_change_(false) {
|
||||
Initialize(isolate, BASE, zone);
|
||||
}
|
||||
|
||||
|
@ -85,8 +85,7 @@ class CompilationInfo {
|
||||
kInliningEnabled = 1 << 17,
|
||||
kTypingEnabled = 1 << 18,
|
||||
kDisableFutureOptimization = 1 << 19,
|
||||
kAbortedDueToDependency = 1 << 20,
|
||||
kToplevel = 1 << 21
|
||||
kToplevel = 1 << 20
|
||||
};
|
||||
|
||||
CompilationInfo(Handle<JSFunction> closure, Zone* zone);
|
||||
@ -371,12 +370,12 @@ class CompilationInfo {
|
||||
|
||||
void AbortDueToDependencyChange() {
|
||||
DCHECK(!OptimizingCompilerThread::IsOptimizerThread(isolate()));
|
||||
SetFlag(kAbortedDueToDependency);
|
||||
aborted_due_to_dependency_change_ = true;
|
||||
}
|
||||
|
||||
bool HasAbortedDueToDependencyChange() const {
|
||||
DCHECK(!OptimizingCompilerThread::IsOptimizerThread(isolate()));
|
||||
return GetFlag(kAbortedDueToDependency);
|
||||
return aborted_due_to_dependency_change_;
|
||||
}
|
||||
|
||||
bool HasSameOsrEntry(Handle<JSFunction> function, BailoutId osr_ast_id) {
|
||||
@ -515,6 +514,10 @@ class CompilationInfo {
|
||||
bool ast_value_factory_owned_;
|
||||
AstNode::IdGen ast_node_id_gen_;
|
||||
|
||||
// This flag is used by the main thread to track whether this compilation
|
||||
// should be abandoned due to dependency change.
|
||||
bool aborted_due_to_dependency_change_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CompilationInfo);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user