Revision: 20322
Author:   [email protected]
Date:     Fri Mar 28 08:49:58 2014 UTC
Log:      Fix TSAN issue wrt assertions in the optimizing compiler thread.

[email protected]

Review URL: https://codereview.chromium.org/212603013
http://code.google.com/p/v8/source/detail?r=20322

Modified:
 /branches/bleeding_edge/src/handles-inl.h
 /branches/bleeding_edge/src/hydrogen-environment-liveness.cc
 /branches/bleeding_edge/src/hydrogen-environment-liveness.h

=======================================
--- /branches/bleeding_edge/src/handles-inl.h   Fri Mar  7 10:14:03 2014 UTC
+++ /branches/bleeding_edge/src/handles-inl.h   Fri Mar 28 08:49:58 2014 UTC
@@ -52,14 +52,15 @@


 template <typename T>
-inline bool Handle<T>::is_identical_to(const Handle<T> other) const {
+inline bool Handle<T>::is_identical_to(const Handle<T> o) const {
   ASSERT(location_ == NULL || !(*location_)->IsFailure());
-  if (location_ == other.location_) return true;
-  if (location_ == NULL || other.location_ == NULL) return false;
   // Dereferencing deferred handles to check object equality is safe.
-  SLOW_ASSERT(IsDereferenceAllowed(NO_DEFERRED_CHECK) &&
-              other.IsDereferenceAllowed(NO_DEFERRED_CHECK));
-  return *location_ == *other.location_;
+  SLOW_ASSERT(
+      (location_ == NULL || IsDereferenceAllowed(NO_DEFERRED_CHECK)) &&
+      (o.location_ == NULL || o.IsDereferenceAllowed(NO_DEFERRED_CHECK)));
+  if (location_ == o.location_) return true;
+  if (location_ == NULL || o.location_ == NULL) return false;
+  return *location_ == *o.location_;
 }


=======================================
--- /branches/bleeding_edge/src/hydrogen-environment-liveness.cc Fri Nov 29 10:02:32 2013 UTC +++ /branches/bleeding_edge/src/hydrogen-environment-liveness.cc Fri Mar 28 08:49:58 2014 UTC
@@ -84,8 +84,8 @@
       }
       HSimulate* simulate = first_simulate_.at(successor_id);
       if (simulate == NULL) continue;
-      ASSERT(simulate->closure().is_identical_to(
-                 block->last_environment()->closure()));
+      ASSERT(VerifyClosures(simulate->closure(),
+          block->last_environment()->closure()));
       ZapEnvironmentSlot(i, simulate);
     }
   }
@@ -97,7 +97,7 @@
   if (!marker->CheckFlag(HValue::kEndsLiveRange)) return;
   HSimulate* simulate = marker->next_simulate();
   if (simulate != NULL) {
-    ASSERT(simulate->closure().is_identical_to(marker->closure()));
+    ASSERT(VerifyClosures(simulate->closure(), marker->closure()));
     ZapEnvironmentSlot(marker->index(), simulate);
   }
 }
@@ -240,5 +240,15 @@
     markers_[i]->DeleteAndReplaceWith(NULL);
   }
 }
+
+
+#ifdef DEBUG
+bool HEnvironmentLivenessAnalysisPhase::VerifyClosures(
+    Handle<JSFunction> a, Handle<JSFunction> b) {
+  Heap::RelocationLock for_heap_access(isolate()->heap());
+  AllowHandleDereference for_verification;
+  return a.is_identical_to(b);
+}
+#endif

 } }  // namespace v8::internal
=======================================
--- /branches/bleeding_edge/src/hydrogen-environment-liveness.h Thu Jun 27 13:15:10 2013 UTC +++ /branches/bleeding_edge/src/hydrogen-environment-liveness.h Fri Mar 28 08:49:58 2014 UTC
@@ -55,6 +55,9 @@
   void ZapEnvironmentSlotsForInstruction(HEnvironmentMarker* marker);
   void UpdateLivenessAtBlockEnd(HBasicBlock* block, BitVector* live);
   void UpdateLivenessAtInstruction(HInstruction* instr, BitVector* live);
+#ifdef DEBUG
+  bool VerifyClosures(Handle<JSFunction> a, Handle<JSFunction> b);
+#endif

   int block_count_;

--
--
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