Changeset 54510 in webkit for trunk/JavaScriptCore/runtime


Ignore:
Timestamp:
Feb 8, 2010, 2:26:59 PM (15 years ago)
Author:
[email protected]
Message:

Use an empty identifier instead of a null identifier for parse
tokens without an identifier.

Reviewed by Sam Weinig.

This helps encapsulate the null UStringImpl within UString.

  • parser/Grammar.y:
  • parser/NodeConstructors.h:

(JSC::ContinueNode::ContinueNode):
(JSC::BreakNode::BreakNode):
(JSC::ForInNode::ForInNode):

  • runtime/CommonIdentifiers.cpp:

(JSC::CommonIdentifiers::CommonIdentifiers):

  • runtime/CommonIdentifiers.h:
  • runtime/FunctionPrototype.cpp:

(JSC::FunctionPrototype::FunctionPrototype):

Location:
trunk/JavaScriptCore/runtime
Files:
5 edited

Legend:

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

    r44813 r54510  
    2929
    3030CommonIdentifiers::CommonIdentifiers(JSGlobalData* globalData)
    31     : nullIdentifier(globalData, nullCString)
    32     , emptyIdentifier(globalData, "")
     31    : emptyIdentifier(globalData, "")
    3332    , underscoreProto(globalData, "__proto__")
    3433    , thisIdentifier(globalData, "this")
  • trunk/JavaScriptCore/runtime/CommonIdentifiers.h

    r53170 r54510  
    9191
    9292    public:
    93         const Identifier nullIdentifier;
    9493        const Identifier emptyIdentifier;
    9594        const Identifier underscoreProto;
  • trunk/JavaScriptCore/runtime/FunctionPrototype.cpp

    r52028 r54510  
    3939
    4040FunctionPrototype::FunctionPrototype(ExecState* exec, NonNullPassRefPtr<Structure> structure)
    41     : InternalFunction(&exec->globalData(), structure, exec->propertyNames().nullIdentifier)
     41    : InternalFunction(&exec->globalData(), structure, exec->propertyNames().emptyIdentifier)
    4242{
    4343    putDirectWithoutTransition(exec->propertyNames().length, jsNumber(exec, 0), DontDelete | ReadOnly | DontEnum);
  • trunk/JavaScriptCore/runtime/Identifier.cpp

    r54464 r54510  
    124124PassRefPtr<UString::Rep> Identifier::add(JSGlobalData* globalData, const char* c)
    125125{
    126     if (!c) {
    127         UString::Rep* rep = UString::null().rep();
    128         rep->hash();
    129         return rep;
    130     }
     126    ASSERT(c);
     127
    131128    if (!c[0]) {
    132129        UString::Rep::empty().hash();
  • trunk/JavaScriptCore/runtime/PropertyNameArray.cpp

    r54464 r54510  
    3131void PropertyNameArray::add(UString::Rep* identifier)
    3232{
    33     ASSERT(identifier == UString::null().rep() || identifier == &UString::Rep::empty() || identifier->isIdentifier());
     33    ASSERT(identifier == &UString::Rep::empty() || identifier->isIdentifier());
    3434
    3535    size_t size = m_data->propertyNameVector().size();
Note: See TracChangeset for help on using the changeset viewer.