Changeset 36660 in webkit for trunk/JavaScriptCore/kjs/lexer.cpp


Ignore:
Timestamp:
Sep 18, 2008, 11:32:12 PM (17 years ago)
Author:
Darin Adler
Message:

2008-09-18 Darin Adler <Darin Adler>

Reviewed by Maciej Stachowiak.

  • kjs/grammar.y: Get rid of string from the union, and use ident for STRING as well as for IDENT.
  • kjs/lexer.cpp: (JSC::Lexer::lex): Use makeIdentifier instead of makeUString for String.
  • kjs/lexer.h: Remove makeUString.
  • kjs/nodes.h: Changed StringNode to hold an Identifier instead of UString.
  • VM/CodeGenerator.cpp: (JSC::keyForCharacterSwitch): Updated since StringNode now holds an Identifier. (JSC::prepareJumpTableForStringSwitch): Ditto.
  • kjs/nodes.cpp: (JSC::StringNode::emitCode): Ditto. The comment from here is now in the lexer. (JSC::processClauseList): Ditto.
  • kjs/nodes2string.cpp: (JSC::StringNode::streamTo): Ditto.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/lexer.cpp

    r36263 r36660  
    568568        }
    569569        case String:
    570             lvalp->string = makeUString(m_buffer16);
     570            // Atomize constant strings in case they're later used in property lookup.
     571            lvalp->ident = makeIdentifier(m_buffer16);
    571572            token = STRING;
    572573            break;
     
    917918}
    918919
    919 UString* Lexer::makeUString(const Vector<UChar>& buffer)
    920 {
    921     UString* string = new UString(buffer);
    922     m_strings.append(string);
    923     return string;
    924 }
    925 
    926920} // namespace JSC
Note: See TracChangeset for help on using the changeset viewer.