Ignore:
Timestamp:
Mar 14, 2011, 3:31:29 PM (14 years ago)
Author:
[email protected]
Message:

2011-03-14 Geoffrey Garen <[email protected]>

Reviewed by Oliver Hunt.

Removed more cases of DeprecatedPtr (exception, SmallStrings)
https://bugs.webkit.org/show_bug.cgi?id=56332

  • runtime/Identifier.cpp: (JSC::Identifier::add): (JSC::Identifier::addSlowCase): Use a variable instead of a hard-coded constant, to make this code less brittle.
  • runtime/JSGlobalData.h: Use HeapRoot instead of DeprecatedPtr because this reference is owned and managed directly by the heap.
  • runtime/JSString.cpp: (JSC::JSString::substringFromRope):
  • runtime/JSString.h: (JSC::jsSingleCharacterString): (JSC::jsSingleCharacterSubstring): (JSC::jsString): (JSC::jsStringWithFinalizer): (JSC::jsSubstring): (JSC::jsOwnedString): Use a variable instead of a hard-coded constant, to make this code less brittle.
  • runtime/SmallStrings.cpp: (JSC::SmallStringsStorage::rep): (JSC::SmallStringsStorage::SmallStringsStorage): (JSC::SmallStrings::SmallStrings): (JSC::SmallStrings::markChildren): (JSC::SmallStrings::clear): (JSC::SmallStrings::count): Use a variable instead of a hard-coded constant, to make this code less brittle.
  • runtime/SmallStrings.h: (JSC::SmallStrings::singleCharacterString): Use HeapRoot instead of DeprecatedPtr because these references are owned and managed directly by the heap.


Stop using FixedArray because we only want a very limited set
of classes to be able to use HeapRoot. (Replaced with manual ASSERTs.)

  • runtime/WriteBarrier.h: (JSC::operator==): (JSC::WriteBarrier::WriteBarrier): (JSC::HeapRoot::HeapRoot): (JSC::HeapRoot::operator=): Added HeapRoot, which is allowed to set without write barrier because we assume all HeapRoots are scanned during all GC passes.
File:
1 edited

Legend:

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

    r77151 r81071  
    153153        ASSERT(substringFiberCount == 1);
    154154        UChar c = substringFibers[0].characters()[0];
    155         if (c <= 0xFF)
     155        if (c <= maxSingleCharacterString)
    156156            return globalData->smallStrings.singleCharacterString(globalData, c);
    157157    }
Note: See TracChangeset for help on using the changeset viewer.