diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2013-09-13 12:51:20 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-19 20:50:05 +0200 |
commit | d441d6f39bb846989d95bcf5caf387b42414718d (patch) | |
tree | e367e64a75991c554930278175d403c072de6bb8 /Source/JavaScriptCore/runtime/RegExpCache.cpp | |
parent | 0060b2994c07842f4c59de64b5e3e430525c4b90 (diff) | |
download | qtwebkit-d441d6f39bb846989d95bcf5caf387b42414718d.tar.gz |
Import Qt5x2 branch of QtWebkit for Qt 5.2
Importing a new snapshot of webkit.
Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
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; |