Changeset 31809 in webkit for trunk/JavaScriptCore/kjs/Parser.cpp


Ignore:
Timestamp:
Apr 11, 2008, 1:14:45 AM (17 years ago)
Author:
[email protected]
Message:

Reviewed by Geoff.

Generate a pure (re-entrant) parser with Bison.

No change on SunSpider.

  • kjs/Parser.cpp: (KJS::Parser::parse):
  • kjs/grammar.y:
  • kjs/lexer.cpp: (kjsyylex): (KJS::Lexer::lex):
  • kjs/lexer.h: Pass state as function arguments, instead of global data. Don't call lexer() as often as before, as this function is about to become slower due to thread-specific storage.
  • kjs/function.cpp: (KJS::isStrWhiteSpace): Don't call isSeparatorSpace() for 8-bit characters, as these are already taken care of. This is a small speedup, compensating for a small slowdown caused by switching Bison mode.
File:
1 edited

Legend:

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

    r31072 r31809  
    3030#include <wtf/Vector.h>
    3131
    32 extern int kjsyyparse();
     32extern int kjsyyparse(void*);
    3333
    3434namespace KJS {
     
    5757        *sourceId = m_sourceId;
    5858
    59     int parseError = kjsyyparse();
     59    int parseError = kjsyyparse(&lexer);
    6060    bool lexError = lexer.sawError();
    6161    lexer.clear();
Note: See TracChangeset for help on using the changeset viewer.