Revision: 20859
Author:   [email protected]
Date:     Thu Apr 17 20:06:50 2014 UTC
Log:      MIPS: Serializer enable/disable flags need thread safety.

Port r20855 (ac70e129)

BUG=
[email protected]

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

Modified:
 /branches/bleeding_edge/src/mips/assembler-mips.cc
 /branches/bleeding_edge/src/mips/assembler-mips.h

=======================================
--- /branches/bleeding_edge/src/mips/assembler-mips.cc Thu Apr 17 14:45:06 2014 UTC +++ /branches/bleeding_edge/src/mips/assembler-mips.cc Thu Apr 17 20:06:50 2014 UTC
@@ -46,6 +46,7 @@
 #ifdef DEBUG
 bool CpuFeatures::initialized_ = false;
 #endif
+bool CpuFeatures::hint_creating_snapshot_ = false;
 unsigned CpuFeatures::supported_ = 0;
 unsigned CpuFeatures::found_by_runtime_probing_only_ = 0;
 unsigned CpuFeatures::cross_compile_ = 0;
@@ -100,9 +101,25 @@
   };
   return names[index];
 }
+
+
+void CpuFeatures::SetHintCreatingSnapshot() {
+  hint_creating_snapshot_ = true;
+}
+
+
+void CpuFeatures::ProbeWithoutIsolate() {
+  Probe(hint_creating_snapshot_);
+}


 void CpuFeatures::Probe() {
+  // The Serializer can only be queried after isolate initialization.
+  Probe(Serializer::enabled());
+}
+
+
+void CpuFeatures::Probe(bool serializer_enabled) {
   unsigned standard_features = (OS::CpuFeaturesImpliedByPlatform() |
                                 CpuFeaturesImpliedByCompiler());
   ASSERT(supported_ == 0 ||
@@ -116,7 +133,7 @@
   // snapshot.
   supported_ |= standard_features;

-  if (Serializer::enabled()) {
+  if (serializer_enabled) {
     // No probing for features if we might serialize (generate snapshot).
     return;
   }
@@ -2080,11 +2097,6 @@
   if (!RelocInfo::IsNone(rinfo.rmode())) {
     // Don't record external references unless the heap will be serialized.
     if (rmode == RelocInfo::EXTERNAL_REFERENCE) {
-#ifdef DEBUG
-      if (!Serializer::enabled()) {
-        Serializer::TooLateToEnableNow();
-      }
-#endif
       if (!Serializer::enabled() && !emit_debug_code()) {
         return;
       }
=======================================
--- /branches/bleeding_edge/src/mips/assembler-mips.h Wed Apr 16 11:38:56 2014 UTC +++ /branches/bleeding_edge/src/mips/assembler-mips.h Thu Apr 17 20:06:50 2014 UTC
@@ -427,6 +427,11 @@
   // is enabled (snapshots must be portable).
   static void Probe();

+  // A special case for printing target and features, which we want to do
+  // before initializing the isolate
+  static void SetHintCreatingSnapshot();
+  static void ProbeWithoutIsolate();
+
   // Check whether a feature is supported by the target CPU.
   static bool IsSupported(CpuFeature f) {
     ASSERT(initialized_);
@@ -455,6 +460,9 @@
   }

  private:
+  static void Probe(bool serializer_enabled);
+  static bool hint_creating_snapshot_;
+
   static bool Check(CpuFeature f, unsigned set) {
     return (set & flag2set(f)) != 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