Changeset 66375 in webkit for trunk/JavaScriptCore/parser/Lexer.h


Ignore:
Timestamp:
Aug 30, 2010, 1:24:40 AM (15 years ago)
Author:
[email protected]
Message:

Refactor number parsing in the lexer
https://bugs.webkit.org/show_bug.cgi?id=44104

Reviewed by Darin Adler.

Number parsing was full of gotos, and needed a complete
redesign to remove them (Only one remained). Furthermore
integer arithmetic is empolyed for fast cases (= small
integer numbers).

  • parser/Lexer.cpp:

(JSC::Lexer::parseHex):
(JSC::Lexer::parseOctal):
(JSC::Lexer::parseDecimal):
(JSC::Lexer::parseNumberAfterDecimalPoint):
(JSC::Lexer::parseNumberAfterExponentIndicator):
(JSC::Lexer::lex):

  • parser/Lexer.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/parser/Lexer.h

    r64827 r66375  
    9797        ALWAYS_INLINE JSTokenType parseIdentifier(JSTokenData*, LexType);
    9898        ALWAYS_INLINE bool parseString(JSTokenData* lvalp);
     99        ALWAYS_INLINE void parseHex(double& returnValue);
     100        ALWAYS_INLINE bool parseOctal(double& returnValue);
     101        ALWAYS_INLINE bool parseDecimal(double& returnValue);
     102        ALWAYS_INLINE void parseNumberAfterDecimalPoint();
     103        ALWAYS_INLINE bool parseNumberAfterExponentIndicator();
    99104
    100105        static const size_t initialReadBufferCapacity = 32;
Note: See TracChangeset for help on using the changeset viewer.