Ignore:
Timestamp:
Nov 8, 2011, 2:49:27 PM (14 years ago)
Author:
[email protected]
Message:

Towards 8 Bit Strings: Templatize JSC::Parser class by Lexer type
https://bugs.webkit.org/show_bug.cgi?id=71761

Source/JavaScriptCore:

Templatized Parser based on Lexer<T>. Moved two enums,
SourceElementsMode and FunctionRequirements out of Parser definition
to work around a clang compiler defect.

Cleaned up SourceCode data() to return StringImpl* and eliminated
the recently added stringData() virtual method.

To keep code in Parser.cpp and keep Parser.h small, the two flavors
of Parser are explicitly instantiated at the end of Parser.cpp.

Reviewed by Gavin Barraclough.

  • interpreter/Interpreter.cpp:

(JSC::appendSourceToError):

  • parser/Lexer.cpp:

(JSC::::setCode):
(JSC::::sourceCode):

  • parser/Parser.cpp:

(JSC::::Parser):
(JSC::::~Parser):
(JSC::::parseInner):
(JSC::::didFinishParsing):
(JSC::::allowAutomaticSemicolon):
(JSC::::parseSourceElements):
(JSC::::parseVarDeclaration):
(JSC::::parseConstDeclaration):
(JSC::::parseDoWhileStatement):
(JSC::::parseWhileStatement):
(JSC::::parseVarDeclarationList):
(JSC::::parseConstDeclarationList):
(JSC::::parseForStatement):
(JSC::::parseBreakStatement):
(JSC::::parseContinueStatement):
(JSC::::parseReturnStatement):
(JSC::::parseThrowStatement):
(JSC::::parseWithStatement):
(JSC::::parseSwitchStatement):
(JSC::::parseSwitchClauses):
(JSC::::parseSwitchDefaultClause):
(JSC::::parseTryStatement):
(JSC::::parseDebuggerStatement):
(JSC::::parseBlockStatement):
(JSC::::parseStatement):
(JSC::::parseFormalParameters):
(JSC::::parseFunctionBody):
(JSC::::parseFunctionInfo):
(JSC::::parseFunctionDeclaration):
(JSC::::parseExpressionOrLabelStatement):
(JSC::::parseExpressionStatement):
(JSC::::parseIfStatement):
(JSC::::parseExpression):
(JSC::::parseAssignmentExpression):
(JSC::::parseConditionalExpression):
(JSC::::isBinaryOperator):
(JSC::::parseBinaryExpression):
(JSC::::parseProperty):
(JSC::::parseObjectLiteral):
(JSC::::parseStrictObjectLiteral):
(JSC::::parseArrayLiteral):
(JSC::::parsePrimaryExpression):
(JSC::::parseArguments):
(JSC::::parseMemberExpression):
(JSC::::parseUnaryExpression):

  • parser/Parser.h:

(JSC::::parse):
(JSC::parse):

  • parser/SourceCode.h:

(JSC::SourceCode::data):
(JSC::SourceCode::subExpression):

  • parser/SourceProvider.h:

(JSC::UStringSourceProvider::data):

Source/WebCore:

Cleaned up SourceCode data() to return StringImpl* and eliminated
the recently added stringData() virtual method.

No tests added - refactored base class SourceCode and its subclasses.

  • bindings/js/CachedScriptSourceProvider.h:

(WebCore::CachedScriptSourceProvider::data):

  • bindings/js/ScriptDebugServer.cpp:

(WebCore::ScriptDebugServer::dispatchDidParseSource):
(WebCore::ScriptDebugServer::dispatchFailedToParseSource):

  • bindings/js/StringSourceProvider.h:

(WebCore::StringSourceProvider::data):

Source/WebKit/mac:

Changed WKPCEvaluate() to use emptyString() when the source is
zero length.

Reviewed by Gavin Barraclough.

  • Plugins/Hosted/NetscapePluginHostProxy.mm:

(WKPCEvaluate):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/parser/SourceProvider.h

    r99436 r99618  
    5757
    5858        virtual UString getRange(int start, int end) const = 0;
    59         virtual const UChar* data() const = 0;
    60         virtual const StringImpl* stringData() const = 0;
     59        virtual const StringImpl* data() const = 0;
    6160        virtual int length() const = 0;
    6261       
     
    9291            return m_source.substringSharingImpl(start, end - start);
    9392        }
    94         const UChar* data() const { return m_data; }
    95         const StringImpl* stringData() const { return m_source.impl(); }
     93        const StringImpl* data() const { return m_source.impl(); }
    9694        int length() const { return m_source.length(); }
    9795
Note: See TracChangeset for help on using the changeset viewer.