Bug 165768

Summary: Rename BytecodeGenerator's m_symbolTableStack to m_lexicalScopeStack.
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: JavaScriptCoreAssignee: Mark Lam <mark.lam>
Status: RESOLVED FIXED    
Severity: Normal CC: fpizlo, ggaren, jfbastien, keith_miller, msaboff, saam, ysuzuki
Priority: P2    
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 160168    
Attachments:
Description Flags
proposed patch. saam: review+

Description Mark Lam 2016-12-12 12:49:21 PST
The lexical scope in "m_lexicalScopeStack" here refers to a pair of { } in the source code that bounds the scope of variables.

There are 4 places in the code where we call m_symbolTableStack.append() to append a new stack entry.  In only 3 of the 4 cases, a symbol table is provided in the new stack entry.  In all 4 cases, a scope register is provided in the new stack entry.

Also, 3 of the 4 functions that appends an entry to this stack are named:
1. initializeVarLexicalEnvironment()
2. pushLexicalScopeInternal()
3. emitPushWithScope()

The 4th function is the BytecodeGenerator constructor where it pushes the scope for a module environment.

Based on these details, m_lexicalScopeStack is a better name for this stack than m_symbolTableStack.
Comment 1 Mark Lam 2016-12-12 12:53:39 PST
Created attachment 296944 [details]
proposed patch.
Comment 2 Mark Lam 2016-12-12 13:04:59 PST
Thanks for the review.  Landed in r209723: <http://trac.webkit.org/r209723>.