Ignore:
Timestamp:
May 25, 2011, 6:12:46 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 James Robinson <[email protected]>

Reviewed by Geoffrey Garen

CachedResource overhead size calculation ignores the actual size of the URL
https://bugs.webkit.org/show_bug.cgi?id=61481

CachedResource::overheadSize is used to determine the size of an entry in the memory cache to know when to evict
it. When the resource is a large data: URL, for example representing image or audio data, the URL size itself
can be significant.

This patch uses an estimate of actual number of bytes used by the URL that is valid for ASCII urls and close for
other types of strings instead of a fixed number.

  • loader/cache/CachedResource.cpp: (WebCore::CachedResource::overheadSize):
File:
1 edited

Legend:

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

    r87345 r87346  
    2626
    2727namespace JSC {
    28 
     28   
    2929    class RegExpObject : public JSObjectWithGlobalObject {
    3030    public:
    3131        typedef JSObjectWithGlobalObject Base;
    3232
    33         RegExpObject(JSGlobalObject*, Structure*, NonNullPassRefPtr<RegExp>);
     33        RegExpObject(JSGlobalObject*, Structure*, RegExp*);
    3434        virtual ~RegExpObject();
    3535
    36         void setRegExp(PassRefPtr<RegExp> r) { d->regExp = r; }
     36        void setRegExp(JSGlobalData& globalData, RegExp* r) { d->regExp.set(globalData, this, r); }
    3737        RegExp* regExp() const { return d->regExp.get(); }
    3838
     
    7575            WTF_MAKE_FAST_ALLOCATED;
    7676        public:
    77             RegExpObjectData(NonNullPassRefPtr<RegExp> regExp)
    78                 : regExp(regExp)
     77            RegExpObjectData(JSGlobalData& globalData, RegExpObject* owner, RegExp* regExp)
     78                : regExp(globalData, owner, regExp)
    7979            {
    8080                lastIndex.setWithoutWriteBarrier(jsNumber(0));
    8181            }
    8282
    83             RefPtr<RegExp> regExp;
     83            WriteBarrier<RegExp> regExp;
    8484            WriteBarrier<Unknown> lastIndex;
    8585        };
Note: See TracChangeset for help on using the changeset viewer.