Reviewers: mvstanton,

Description:
Version 3.29.88.9 (merged r24361)

Fix data race when concurrent compilation is aborted due to dependency change.

BUG=chromium:419189
LOG=N
[email protected]

Please review this at https://codereview.chromium.org/639693006/

Base URL: https://v8.googlecode.com/svn/branches/3.29

Affected files (+20, -11 lines):
  M src/compiler.h
  M src/compiler.cc
  M src/version.cc


Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 4331770644a3cfd5ca468dafff3f156d8c1d3639..7cd76ff2f697f72fff006564fdfd25b6d2c7e01b 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -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);
 }

Index: src/compiler.h
diff --git a/src/compiler.h b/src/compiler.h
index 9617afc9f3c8729a5e375f8a99f2b9bc677012d3..8c4177197eb3ee8168e1d679198197b554a4ed74 100644
--- a/src/compiler.h
+++ b/src/compiler.h
@@ -84,8 +84,7 @@ class CompilationInfo {
     kContextSpecializing = 1 << 16,
     kInliningEnabled = 1 << 17,
     kTypingEnabled = 1 << 18,
-    kDisableFutureOptimization = 1 << 19,
-    kAbortedDueToDependency = 1 << 20
+    kDisableFutureOptimization = 1 << 19
   };

   CompilationInfo(Handle<JSFunction> closure, Zone* zone);
@@ -366,12 +365,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) {
@@ -510,6 +509,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);
 };

Index: src/version.cc
diff --git a/src/version.cc b/src/version.cc
index 18f3345bd7d85922ae844801b760fc2b84ead4ac..376a08bd12d6df55f221baece4d7e31d42dcb333 100644
--- a/src/version.cc
+++ b/src/version.cc
@@ -35,7 +35,7 @@
 #define MAJOR_VERSION     3
 #define MINOR_VERSION     29
 #define BUILD_NUMBER      88
-#define PATCH_LEVEL       8
+#define PATCH_LEVEL       9
 // Use 1 for candidates and 0 otherwise.
 // (Boolean macro values are not supported by all preprocessors.)
 #define IS_CANDIDATE_VERSION 0


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to