diff options
Diffstat (limited to 'Source/JavaScriptCore/runtime/RegExpCache.cpp')
-rw-r--r-- | Source/JavaScriptCore/runtime/RegExpCache.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Source/JavaScriptCore/runtime/RegExpCache.cpp b/Source/JavaScriptCore/runtime/RegExpCache.cpp index 8acafba23..1ab3f5f51 100644 --- a/Source/JavaScriptCore/runtime/RegExpCache.cpp +++ b/Source/JavaScriptCore/runtime/RegExpCache.cpp @@ -1,6 +1,7 @@ /* * Copyright (C) 2010 University of Szeged * Copyright (C) 2010 Renata Hodovan (hodovan@inf.u-szeged.hu) + * Copyright (C) 2012 Apple Inc. All rights reserved. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -26,8 +27,9 @@ */ #include "config.h" - #include "RegExpCache.h" + +#include "Operations.h" #include "RegExpObject.h" #include "StrongInlines.h" @@ -39,18 +41,18 @@ RegExp* RegExpCache::lookupOrCreate(const String& patternString, RegExpFlags fla if (RegExp* regExp = m_weakCache.get(key)) return regExp; - RegExp* regExp = RegExp::createWithoutCaching(*m_globalData, patternString, flags); + RegExp* regExp = RegExp::createWithoutCaching(*m_vm, patternString, flags); #if ENABLE(REGEXP_TRACING) - m_globalData->addRegExpToTrace(regExp); + m_vm->addRegExpToTrace(regExp); #endif weakAdd(m_weakCache, key, PassWeak<RegExp>(regExp, this)); return regExp; } -RegExpCache::RegExpCache(JSGlobalData* globalData) +RegExpCache::RegExpCache(VM* vm) : m_nextEntryInStrongCache(0) - , m_globalData(globalData) + , m_vm(vm) { } @@ -66,7 +68,7 @@ void RegExpCache::addToStrongCache(RegExp* regExp) String pattern = regExp->pattern(); if (pattern.length() > maxStrongCacheablePatternLength) return; - m_strongCache[m_nextEntryInStrongCache].set(*m_globalData, regExp); + m_strongCache[m_nextEntryInStrongCache].set(*m_vm, regExp); m_nextEntryInStrongCache++; if (m_nextEntryInStrongCache == maxStrongCacheableEntries) m_nextEntryInStrongCache = 0; |