From 81bc750723a18f21cd17d1b173cd2a4dda9cea6e Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Tue, 24 May 2011 11:24:40 +0100 Subject: Merge WebKit at r80534: Intial merge by Git Change-Id: Ia7a83357124c9e1cdb1debf55d9661ec0bd09a61 --- Source/JavaScriptCore/parser/ASTBuilder.h | 32 +++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'Source/JavaScriptCore/parser/ASTBuilder.h') diff --git a/Source/JavaScriptCore/parser/ASTBuilder.h b/Source/JavaScriptCore/parser/ASTBuilder.h index 0e18d1d..9ab0f9d 100644 --- a/Source/JavaScriptCore/parser/ASTBuilder.h +++ b/Source/JavaScriptCore/parser/ASTBuilder.h @@ -76,9 +76,9 @@ public: ASTBuilder(JSGlobalData* globalData, Lexer* lexer) : m_globalData(globalData) , m_lexer(lexer) + , m_scope(globalData) , m_evalCount(0) { - m_scopes.append(Scope(globalData)); } struct BinaryExprContext { @@ -115,10 +115,10 @@ public: JSC::SourceElements* createSourceElements() { return new (m_globalData) JSC::SourceElements(m_globalData); } - ParserArenaData* varDeclarations() { return m_scopes.last().m_varDeclarations; } - ParserArenaData* funcDeclarations() { return m_scopes.last().m_funcDeclarations; } - int features() const { return m_scopes.last().m_features; } - int numConstants() const { return m_scopes.last().m_numConstants; } + ParserArenaData* varDeclarations() { return m_scope.m_varDeclarations; } + ParserArenaData* funcDeclarations() { return m_scope.m_funcDeclarations; } + int features() const { return m_scope.m_features; } + int numConstants() const { return m_scope.m_numConstants; } void appendToComma(CommaNode* commaNode, ExpressionNode* expr) { commaNode->append(expr); } @@ -300,7 +300,7 @@ public: FuncDeclNode* decl = new (m_globalData) FuncDeclNode(m_globalData, *name, body, m_lexer->sourceCode(openBracePos, closeBracePos, bodyStartLine), parameters); if (*name == m_globalData->propertyNames->arguments) usesArguments(); - m_scopes.last().m_funcDeclarations->data.append(decl->body()); + m_scope.m_funcDeclarations->data.append(decl->body()); body->setLoc(bodyStartLine, bodyEndLine); return decl; } @@ -494,7 +494,7 @@ public: { if (m_globalData->propertyNames->arguments == *ident) usesArguments(); - m_scopes.last().m_varDeclarations->data.append(std::make_pair(ident, attrs)); + m_scope.m_varDeclarations->data.append(std::make_pair(ident, attrs)); } ExpressionNode* combineCommaNodes(ExpressionNode* list, ExpressionNode* init) @@ -611,17 +611,17 @@ private: node->setExceptionSourceCode(divot, divot - start, end - divot); } - void incConstants() { m_scopes.last().m_numConstants++; } - void usesThis() { m_scopes.last().m_features |= ThisFeature; } - void usesCatch() { m_scopes.last().m_features |= CatchFeature; } - void usesClosures() { m_scopes.last().m_features |= ClosureFeature; } - void usesArguments() { m_scopes.last().m_features |= ArgumentsFeature; } - void usesAssignment() { m_scopes.last().m_features |= AssignFeature; } - void usesWith() { m_scopes.last().m_features |= WithFeature; } + void incConstants() { m_scope.m_numConstants++; } + void usesThis() { m_scope.m_features |= ThisFeature; } + void usesCatch() { m_scope.m_features |= CatchFeature; } + void usesClosures() { m_scope.m_features |= ClosureFeature; } + void usesArguments() { m_scope.m_features |= ArgumentsFeature; } + void usesAssignment() { m_scope.m_features |= AssignFeature; } + void usesWith() { m_scope.m_features |= WithFeature; } void usesEval() { m_evalCount++; - m_scopes.last().m_features |= EvalFeature; + m_scope.m_features |= EvalFeature; } ExpressionNode* createNumber(double d) { @@ -630,7 +630,7 @@ private: JSGlobalData* m_globalData; Lexer* m_lexer; - Vector m_scopes; + Scope m_scope; Vector m_binaryOperandStack; Vector m_assignmentInfoStack; Vector, 10> m_binaryOperatorStack; -- cgit v1.1