Ignore:
Timestamp:
Sep 7, 2012, 4:59:10 PM (13 years ago)
Author:
[email protected]
Message:

Refactored bytecode generator initialization to support moving captured vars around
https://bugs.webkit.org/show_bug.cgi?id=96159

Reviewed by Gavin Barraclough.

This patch separates the stages of allocating registers, declaring identifiers
in the symbol table, and initializing registers, so you can change
allocation decisions without breaking the world.

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::BytecodeGenerator): Call a set of helper functions
instead of inlining all the code, to help clarity.

(JSC::BytecodeGenerator::allocateCapturedVars):
(JSC::BytecodeGenerator::allocateUncapturedVars):
(JSC::BytecodeGenerator::allocateActivationVar):
(JSC::BytecodeGenerator::allocateArgumentsVars):
(JSC::BytecodeGenerator::allocateCalleeVarUndeclared):
(JSC::BytecodeGenerator::declareParameters):
(JSC::BytecodeGenerator::declareCallee):
(JSC::BytecodeGenerator::initCalleeVar):
(JSC::BytecodeGenerator::initArgumentsVars):
(JSC::BytecodeGenerator::initActivationVar):
(JSC::BytecodeGenerator::initThisParameter):
(JSC::BytecodeGenerator::initFunctionDeclarations):
(JSC::BytecodeGenerator::declareParameter):
(JSC::BytecodeGenerator::createLazyRegisterIfNecessary):
(JSC::BytecodeGenerator::createActivationIfNecessary): Factored these
helper functions out from pre-existing code.

  • bytecompiler/BytecodeGenerator.h:

(BytecodeGenerator):

  • parser/ASTBuilder.h:

(JSC::ASTBuilder::createFuncDeclStatement):
(JSC::ASTBuilder::addVar):

  • parser/Nodes.h:

(JSC::DeclarationStacks::VarDeclaration::VarDeclaration):
(VarDeclaration):
(JSC::DeclarationStacks::FunctionDeclaration::FunctionDeclaration):
(FunctionDeclaration): Declaration stacks get a little more data now,
to support allocating registers before putting things in the symbol
table. I'm convinced that we should eventually just expand the symbol
table to understand these things.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r127938 r127939  
     12012-09-07  Geoffrey Garen  <[email protected]>
     2
     3        Refactored bytecode generator initialization to support moving captured vars around
     4        https://bugs.webkit.org/show_bug.cgi?id=96159
     5
     6        Reviewed by Gavin Barraclough.
     7
     8        This patch separates the stages of allocating registers, declaring identifiers
     9        in the symbol table, and initializing registers, so you can change
     10        allocation decisions without breaking the world.
     11
     12        * bytecompiler/BytecodeGenerator.cpp:
     13        (JSC::BytecodeGenerator::BytecodeGenerator): Call a set of helper functions
     14        instead of inlining all the code, to help clarity.
     15
     16        (JSC::BytecodeGenerator::allocateCapturedVars):
     17        (JSC::BytecodeGenerator::allocateUncapturedVars):
     18        (JSC::BytecodeGenerator::allocateActivationVar):
     19        (JSC::BytecodeGenerator::allocateArgumentsVars):
     20        (JSC::BytecodeGenerator::allocateCalleeVarUndeclared):
     21        (JSC::BytecodeGenerator::declareParameters):
     22        (JSC::BytecodeGenerator::declareCallee):
     23        (JSC::BytecodeGenerator::initCalleeVar):
     24        (JSC::BytecodeGenerator::initArgumentsVars):
     25        (JSC::BytecodeGenerator::initActivationVar):
     26        (JSC::BytecodeGenerator::initThisParameter):
     27        (JSC::BytecodeGenerator::initFunctionDeclarations):
     28        (JSC::BytecodeGenerator::declareParameter):
     29        (JSC::BytecodeGenerator::createLazyRegisterIfNecessary):
     30        (JSC::BytecodeGenerator::createActivationIfNecessary): Factored these
     31        helper functions out from pre-existing code.
     32
     33        * bytecompiler/BytecodeGenerator.h:
     34        (BytecodeGenerator):
     35        * parser/ASTBuilder.h:
     36        (JSC::ASTBuilder::createFuncDeclStatement):
     37        (JSC::ASTBuilder::addVar):
     38        * parser/Nodes.h:
     39        (JSC::DeclarationStacks::VarDeclaration::VarDeclaration):
     40        (VarDeclaration):
     41        (JSC::DeclarationStacks::FunctionDeclaration::FunctionDeclaration):
     42        (FunctionDeclaration): Declaration stacks get a little more data now,
     43        to support allocating registers before putting things in the symbol
     44        table. I'm convinced that we should eventually just expand the symbol
     45        table to understand these things.
     46
    1472012-09-07  Mark Lam  <[email protected]>
    248
Note: See TracChangeset for help on using the changeset viewer.