Changeset 110287 in webkit for trunk/Source/JavaScriptCore/ChangeLog
- Timestamp:
- Mar 9, 2012, 4:06:48 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r110268 r110287 1 2012-03-09 Andy Wingo <[email protected]> 2 3 Refactor code feature analysis in the parser 4 https://bugs.webkit.org/show_bug.cgi?id=79112 5 6 Reviewed by Geoffrey Garen. 7 8 This commit refactors the parser to more uniformly propagate flag 9 bits down and up the parse process, as the parser descends and 10 returns into nested blocks. Some flags get passed town to 11 subscopes, some apply to specific scopes only, and some get 12 unioned up after parsing subscopes. 13 14 The goal is to eventually be very precise with scoping 15 information, once we have block scopes: one block scope might use 16 `eval', which would require the emission of a symbol table within 17 that block and containing blocks, whereas another block in the 18 same function might not, allowing us to not emit a symbol table. 19 20 * parser/Nodes.h: 21 (JSC::ScopeFlags): Rename from CodeFeatures. 22 (JSC::ScopeNode::addScopeFlags): 23 (JSC::ScopeNode::scopeFlags): New accessors for m_scopeFlags. 24 (JSC::ScopeNode::isStrictMode): 25 (JSC::ScopeNode::usesEval): 26 (JSC::ScopeNode::usesArguments): 27 (JSC::ScopeNode::setUsesArguments): 28 (JSC::ScopeNode::usesThis): 29 (JSC::ScopeNode::needsActivationForMoreThanVariables): 30 (JSC::ScopeNode::needsActivation): Refactor these accessors to 31 operate on the m_scopeFlags member. 32 (JSC::ScopeNode::source): 33 (JSC::ScopeNode::sourceURL): 34 (JSC::ScopeNode::sourceID): Shuffle these definitions around; no 35 semantic change. 36 (JSC::ScopeNode::ScopeNode) 37 (JSC::ProgramNode::ProgramNode) 38 (JSC::EvalNode::EvalNode) 39 (JSC::FunctionBodyNode::FunctionBodyNode): Have these constructors 40 take a ScopeFlags as an argument, instead of a bool inStrictContext. 41 42 * parser/Nodes.cpp: 43 (JSC::ScopeNode::ScopeNode): 44 (JSC::ProgramNode::ProgramNode): 45 (JSC::ProgramNode::create): 46 (JSC::EvalNode::EvalNode): 47 (JSC::EvalNode::create): 48 (JSC::FunctionBodyNode::FunctionBodyNode): 49 (JSC::FunctionBodyNode::create): Adapt constructors to change. 50 51 * parser/ASTBuilder.h: 52 (JSC::ASTBuilder::ASTBuilder): 53 (JSC::ASTBuilder::thisExpr): 54 (JSC::ASTBuilder::createResolve): 55 (JSC::ASTBuilder::createFunctionBody): 56 (JSC::ASTBuilder::createFuncDeclStatement): 57 (JSC::ASTBuilder::createTryStatement): 58 (JSC::ASTBuilder::createWithStatement): 59 (JSC::ASTBuilder::addVar): 60 (JSC::ASTBuilder::Scope::Scope): 61 (Scope): 62 (ASTBuilder): 63 (JSC::ASTBuilder::makeFunctionCallNode): Don't track scope 64 features here. Instead rely on the base Parser mechanism to track 65 features. 66 67 * parser/NodeInfo.h (NodeInfo, NodeDeclarationInfo): "ScopeFlags". 68 69 * parser/Parser.h: 70 (JSC::Scope::Scope): Manage scope through flags, not 71 bit-booleans. This lets us uniformly propagate them up and down. 72 (JSC::Scope::declareWrite): 73 (JSC::Scope::declareParameter): 74 (JSC::Scope::useVariable): 75 (JSC::Scope::collectFreeVariables): 76 (JSC::Scope::getCapturedVariables): 77 (JSC::Scope::saveFunctionInfo): 78 (JSC::Scope::restoreFunctionInfo): 79 (JSC::Parser::pushScope): Adapt to use scope flags and their 80 accessors instead of bit-booleans. 81 * parser/Parser.cpp: 82 (JSC::::Parser): 83 (JSC::::parseInner): 84 (JSC::::didFinishParsing): 85 (JSC::::parseSourceElements): 86 (JSC::::parseVarDeclarationList): 87 (JSC::::parseConstDeclarationList): 88 (JSC::::parseWithStatement): 89 (JSC::::parseTryStatement): 90 (JSC::::parseFunctionBody): 91 (JSC::::parseFunctionInfo): 92 (JSC::::parseFunctionDeclaration): 93 (JSC::::parsePrimaryExpression): Hoist some of the flag handling 94 out of the "context" (ASTBuilder or SyntaxChecker) and to here. 95 Does not seem to have a performance impact. 96 97 * parser/SourceProviderCacheItem.h (SourceProviderCacheItem): 98 Cache the scopeflags. 99 * parser/SyntaxChecker.h: Remove evalCount() decl. 100 101 * runtime/Executable.cpp: 102 (JSC::EvalExecutable::compileInternal): 103 (JSC::ProgramExecutable::compileInternal): 104 (JSC::FunctionExecutable::produceCodeBlockFor): 105 * runtime/Executable.h: 106 (JSC::ScriptExecutable::ScriptExecutable): 107 (JSC::ScriptExecutable::usesEval): 108 (JSC::ScriptExecutable::usesArguments): 109 (JSC::ScriptExecutable::needsActivation): 110 (JSC::ScriptExecutable::isStrictMode): 111 (JSC::ScriptExecutable::recordParse): 112 (ScriptExecutable): ScopeFlags, not features. 113 1 114 2012-03-08 Benjamin Poulain <[email protected]> 2 115
Note:
See TracChangeset
for help on using the changeset viewer.