- static const unsigned maxCacheablePatternLength = 256;
- static const int maxCacheableEntries = 256;
-
- typedef HashMap<RegExpKey, RefPtr<RegExp> > RegExpCacheMap;
- RegExpKey patternKeyArray[maxCacheableEntries];
- RegExpCacheMap m_cacheMap;
- JSGlobalData* m_globalData;
- int m_nextKeyToEvict;
- bool m_isFull;
+
+ static const unsigned maxStrongCacheablePatternLength = 256;
+
+ static const int maxStrongCacheableEntries = 32;
+
+ virtual void finalize(Handle<Unknown>, void* context) override;
+
+ RegExp* lookupOrCreate(const WTF::String& patternString, RegExpFlags);
+ void addToStrongCache(RegExp*);
+ RegExpCacheMap m_weakCache; // Holds all regular expressions currently live.
+ int m_nextEntryInStrongCache;
+ std::array<Strong<RegExp>, maxStrongCacheableEntries> m_strongCache; // Holds a select few regular expressions that have compiled and executed
+ VM* m_vm;