]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - runtime/WeakRandom.h
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / runtime / WeakRandom.h
index 3cd1016d3bdc29bd8fe20e3e5a75da2514968efb..98b23c70d6a9c60a9e3568d5753fbb97383d9ce0 100644 (file)
 namespace JSC {
 
 class WeakRandom {
+friend class JSGlobalObject; // For access to initializeSeed() during replay.
 public:
     WeakRandom(unsigned seed)
-        : m_low(seed ^ 0x49616E42)
-        , m_high(seed)
     {
+        initializeSeed(seed);
     }
     
     // Returns the seed provided that you've never called get() or getUint32().
@@ -85,6 +85,12 @@ private:
         return m_high;
     }
 
+    void initializeSeed(unsigned seed)
+    {
+        m_low = seed ^ 0x49616E42;
+        m_high = seed;
+    }
+
     unsigned m_low;
     unsigned m_high;
 };