Ignore:
Timestamp:
May 25, 2011, 6:01:16 PM (14 years ago)
Author:
[email protected]
Message:

2011-05-25 Oliver Hunt <[email protected]>

Reviewed by Geoffrey Garen.

Make RegExp GC allocated
https://bugs.webkit.org/show_bug.cgi?id=61490

Make RegExp GC allocated. Basically mechanical change to replace
most use of [Pass]RefPtr<RegExp> with RegExp* or WriteBarrier<RegExp>
where actual ownership happens.

Made the RegExpCache use Strong<> references currently to avoid any
changes in behaviour.

  • JavaScriptCore.exp:
  • bytecode/CodeBlock.cpp: (JSC::CodeBlock::visitAggregate):
  • bytecode/CodeBlock.h: (JSC::CodeBlock::addRegExp):
  • bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::addRegExp): (JSC::BytecodeGenerator::emitNewRegExp):
  • bytecompiler/BytecodeGenerator.h:
  • runtime/JSCell.h:
  • runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::clearBuiltinStructures): (JSC::JSGlobalData::addRegExpToTrace):
  • runtime/JSGlobalData.h:
  • runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::reset):
  • runtime/RegExp.cpp: (JSC::RegExp::RegExp): (JSC::RegExp::create): (JSC::RegExp::invalidateCode):
  • runtime/RegExp.h: (JSC::RegExp::createStructure):
  • runtime/RegExpCache.cpp: (JSC::RegExpCache::lookupOrCreate): (JSC::RegExpCache::create):
  • runtime/RegExpCache.h:
  • runtime/RegExpConstructor.cpp: (JSC::constructRegExp):
  • runtime/RegExpObject.cpp: (JSC::RegExpObject::RegExpObject): (JSC::RegExpObject::visitChildren):
  • runtime/RegExpObject.h: (JSC::RegExpObject::setRegExp): (JSC::RegExpObject::RegExpObjectData::RegExpObjectData):
  • runtime/RegExpPrototype.cpp: (JSC::RegExpPrototype::RegExpPrototype): (JSC::regExpProtoFuncCompile):
  • runtime/RegExpPrototype.h:
  • runtime/StringPrototype.cpp: (JSC::stringProtoFuncMatch): (JSC::stringProtoFuncSearch):

2011-05-25 Oliver Hunt <[email protected]>

Reviewed by Geoffrey Garen.

Make RegExp GC allocated
https://bugs.webkit.org/show_bug.cgi?id=61490

RegExp is GC'd so we don't need the RefPtr shenanigans anymore.

  • bindings/js/SerializedScriptValue.cpp: (WebCore::CloneDeserializer::readTerminal):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/RegExpObject.cpp

    r87327 r87343  
    6262*/
    6363
    64 RegExpObject::RegExpObject(JSGlobalObject* globalObject, Structure* structure, NonNullPassRefPtr<RegExp> regExp)
     64RegExpObject::RegExpObject(JSGlobalObject* globalObject, Structure* structure, RegExp* regExp)
    6565    : JSObjectWithGlobalObject(globalObject, structure)
    66     , d(adoptPtr(new RegExpObjectData(regExp)))
     66    , d(adoptPtr(new RegExpObjectData(globalObject->globalData(), this, regExp)))
    6767{
    6868    ASSERT(inherits(&s_info));
     
    7979    ASSERT(structure()->typeInfo().overridesVisitChildren());
    8080    Base::visitChildren(visitor);
     81    if (d->regExp)
     82        visitor.append(&d->regExp);
    8183    if (UNLIKELY(!d->lastIndex.get().isInt32()))
    8284        visitor.append(&d->lastIndex);
Note: See TracChangeset for help on using the changeset viewer.