- // We need to do a second lookup to add the RegExp as
- // allocating it may have caused a gc cycle, which in
- // turn may have removed items from the cache.
- m_weakCache.add(key, Weak<RegExp>(*m_globalData, regExp, this));
+
+ weakAdd(m_weakCache, key, Weak<RegExp>(regExp, this));