Changeset 292714 in webkit for trunk/Source/JavaScriptCore/assembler/AbstractMacroAssembler.h
- Timestamp:
- Apr 11, 2022, 1:10:44 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/assembler/AbstractMacroAssembler.h
r292540 r292714 75 75 return Success; 76 76 } 77 78 protected: 79 uint32_t random() 80 { 81 if (!m_randomSource) 82 initializeRandom(); 83 return m_randomSource->getUint32(); 84 } 85 86 private: 87 JS_EXPORT_PRIVATE void initializeRandom(); 88 89 std::optional<WeakRandom> m_randomSource; 77 90 }; 78 91 … … 1008 1021 protected: 1009 1022 AbstractMacroAssembler() 1010 : m_randomSource(0) 1011 , m_assembler() 1023 : m_assembler() 1012 1024 { 1013 1025 invalidateAllTempRegisters(); 1014 1026 } 1015 1027 1016 uint32_t random()1017 {1018 if (!m_randomSourceIsInitialized) {1019 m_randomSourceIsInitialized = true;1020 m_randomSource.setSeed(cryptographicallyRandomNumber());1021 }1022 return m_randomSource.getUint32();1023 }1024 1025 bool m_randomSourceIsInitialized { false };1026 WeakRandom m_randomSource;1027 1028 public: 1028 1029 AssemblerType m_assembler;
Note:
See TracChangeset
for help on using the changeset viewer.