diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2011-07-15 17:46:43 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-08-30 13:18:28 +0200 |
commit | c742d2d12122e752a74da3e3f26dff28ff967b9d (patch) | |
tree | 0ba053e34da0681a5a61fa6d36602ffdabef6e0e /src/declarative/qml/parser/qdeclarativejsparser_p.h | |
parent | 3f7ea11f9f9a0ecb2bc571237f8f3523447883f7 (diff) |
Improve performance of the QML front-end
Introduced a new lexer and a more efficient representation of
the AST. Instead of creating unique name ids, we simply use
QStringRef(s).
Change-Id: I403472fa2bb74d2c87dd6314065306499677a3bf
Authored-by: Roberto Raggi
Reviewed-on: http://codereview.qt.nokia.com/3750
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Diffstat (limited to 'src/declarative/qml/parser/qdeclarativejsparser_p.h')
-rw-r--r-- | src/declarative/qml/parser/qdeclarativejsparser_p.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/declarative/qml/parser/qdeclarativejsparser_p.h b/src/declarative/qml/parser/qdeclarativejsparser_p.h index 0cbd76adfc..f77d13a300 100644 --- a/src/declarative/qml/parser/qdeclarativejsparser_p.h +++ b/src/declarative/qml/parser/qdeclarativejsparser_p.h @@ -72,7 +72,6 @@ QT_QML_BEGIN_NAMESPACE namespace QDeclarativeJS { class Engine; -class NameId; class QML_PARSER_EXPORT Parser: protected QDeclarativeJSGrammar { @@ -80,7 +79,6 @@ public: union Value { int ival; double dval; - NameId *sval; AST::ArgumentList *ArgumentList; AST::CaseBlock *CaseBlock; AST::CaseClause *CaseClause; @@ -196,6 +194,9 @@ protected: inline Value &sym(int index) { return sym_stack [tos + index - 1]; } + inline QStringRef &stringRef(int index) + { return string_stack [tos + index - 1]; } + inline AST::SourceLocation &loc(int index) { return location_stack [tos + index - 1]; } @@ -208,6 +209,7 @@ protected: Value *sym_stack; int *state_stack; AST::SourceLocation *location_stack; + QStringRef *string_stack; AST::Node *program; @@ -218,9 +220,11 @@ protected: int token; double dval; AST::SourceLocation loc; + QStringRef spell; }; double yylval; + QStringRef yytokenspell; AST::SourceLocation yylloc; AST::SourceLocation yyprevlloc; |