]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - runtime/RegExpCache.h
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / runtime / RegExpCache.h
index 4f3ea1536a4eae10d9dcbeb794ecd7510c2a61f6..dd46ac664901741a580a81c3c544b51c9b7f20ba 100644 (file)
@@ -28,9 +28,9 @@
 #include "RegExp.h"
 #include "RegExpKey.h"
 #include "Strong.h"
-#include "UString.h"
 #include "Weak.h"
-#include <wtf/FixedArray.h>
+#include "WeakInlines.h"
+#include <array>
 #include <wtf/HashMap.h>
 
 #ifndef RegExpCache_h
 namespace JSC {
 
 class RegExpCache : private WeakHandleOwner {
-friend class RegExp;
-typedef HashMap<RegExpKey, Weak<RegExp> > RegExpCacheMap;
+    WTF_MAKE_FAST_ALLOCATED;
+
+    friend class RegExp;
+    typedef HashMap<RegExpKey, Weak<RegExp>> 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<Unknown>, void* context);
+    virtual void finalize(Handle<Unknown>, 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<Strong<RegExp>, maxStrongCacheableEntries> m_strongCache; // Holds a select few regular expressions that have compiled and executed
-    JSGlobalData* m_globalData;
+    std::array<Strong<RegExp>, maxStrongCacheableEntries> m_strongCache; // Holds a select few regular expressions that have compiled and executed
+    VM* m_vm;
 };
 
 } // namespace JSC