X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/14957cd040308e3eeec43d26bae5d76da13fcd85..HEAD:/runtime/RegExpCache.h diff --git a/runtime/RegExpCache.h b/runtime/RegExpCache.h index 4f3ea15..dd46ac6 100644 --- a/runtime/RegExpCache.h +++ b/runtime/RegExpCache.h @@ -28,9 +28,9 @@ #include "RegExp.h" #include "RegExpKey.h" #include "Strong.h" -#include "UString.h" #include "Weak.h" -#include +#include "WeakInlines.h" +#include #include #ifndef RegExpCache_h @@ -39,11 +39,13 @@ namespace JSC { class RegExpCache : private WeakHandleOwner { -friend class RegExp; -typedef HashMap > RegExpCacheMap; + WTF_MAKE_FAST_ALLOCATED; + + friend class RegExp; + typedef HashMap> RegExpCacheMap; public: - RegExpCache(JSGlobalData* globalData); + RegExpCache(VM* vm); void invalidateCode(); private: @@ -52,14 +54,14 @@ private: static const int maxStrongCacheableEntries = 32; - virtual void finalize(Handle, void* context); + virtual void finalize(Handle, void* context) override; - RegExp* lookupOrCreate(const UString& patternString, RegExpFlags); + RegExp* lookupOrCreate(const WTF::String& patternString, RegExpFlags); void addToStrongCache(RegExp*); RegExpCacheMap m_weakCache; // Holds all regular expressions currently live. int m_nextEntryInStrongCache; - WTF::FixedArray, maxStrongCacheableEntries> m_strongCache; // Holds a select few regular expressions that have compiled and executed - JSGlobalData* m_globalData; + std::array, maxStrongCacheableEntries> m_strongCache; // Holds a select few regular expressions that have compiled and executed + VM* m_vm; }; } // namespace JSC