#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:
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