Changeset 52762 in webkit for trunk/JavaScriptCore/runtime


Ignore:
Timestamp:
Jan 4, 2010, 2:49:27 PM (15 years ago)
Author:
[email protected]
Message:

Rubber stamped by Geoff Garen.

Add an 'isIdentifier' to UStringImpl, use this where appropriate
(where previously 'identifierTable' was being tested).

  • API/JSClassRef.cpp:

(OpaqueJSClass::~OpaqueJSClass):
(OpaqueJSClassContextData::OpaqueJSClassContextData):

  • runtime/Identifier.cpp:

(JSC::Identifier::addSlowCase):

  • runtime/Identifier.h:

(JSC::Identifier::add):

  • runtime/PropertyNameArray.cpp:

(JSC::PropertyNameArray::add):

  • runtime/UStringImpl.h:

(JSC::UStringImpl::isIdentifier):

Location:
trunk/JavaScriptCore/runtime
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/Identifier.cpp

    r52346 r52762  
    213213PassRefPtr<UString::Rep> Identifier::addSlowCase(JSGlobalData* globalData, UString::Rep* r)
    214214{
    215     ASSERT(!r->identifierTable());
     215    ASSERT(!r->isIdentifier());
    216216    if (r->size() == 1) {
    217217        UChar c = r->data()[0];
    218218        if (c <= 0xFF)
    219219            r = globalData->smallStrings.singleCharacterStringRep(c);
    220             if (r->identifierTable()) {
     220            if (r->isIdentifier()) {
    221221#ifndef NDEBUG
    222222                checkSameIdentifierTable(globalData, r);
  • trunk/JavaScriptCore/runtime/Identifier.h

    r47847 r52762  
    9393        static PassRefPtr<UString::Rep> add(ExecState* exec, UString::Rep* r)
    9494        {
    95             if (r->identifierTable()) {
     95            if (r->isIdentifier()) {
    9696#ifndef NDEBUG
    9797                checkSameIdentifierTable(exec, r);
     
    103103        static PassRefPtr<UString::Rep> add(JSGlobalData* globalData, UString::Rep* r)
    104104        {
    105             if (r->identifierTable()) {
     105            if (r->isIdentifier()) {
    106106#ifndef NDEBUG
    107107                checkSameIdentifierTable(globalData, r);
  • trunk/JavaScriptCore/runtime/PropertyNameArray.cpp

    r49734 r52762  
    3131void PropertyNameArray::add(UString::Rep* identifier)
    3232{
    33     ASSERT(identifier == &UString::Rep::null() || identifier == &UString::Rep::empty() || identifier->identifierTable());
     33    ASSERT(identifier == &UString::Rep::null() || identifier == &UString::Rep::empty() || identifier->isIdentifier());
    3434
    3535    size_t size = m_data->propertyNameVector().size();
  • trunk/JavaScriptCore/runtime/UStringImpl.h

    r52758 r52762  
    138138    unsigned computedHash() const { ASSERT(m_hash); return m_hash; } // fast path for Identifiers
    139139    void setHash(unsigned hash) { ASSERT(hash == computeHash(data(), m_length)); m_hash = hash; } // fast path for Identifiers
     140    bool isIdentifier() const { return m_identifierTable; }
    140141    IdentifierTable* identifierTable() const { return m_identifierTable; }
    141142    void setIdentifierTable(IdentifierTable* table) { ASSERT(!isStatic()); m_identifierTable = table; }
Note: See TracChangeset for help on using the changeset viewer.