Changeset 47664 in webkit for trunk/JavaScriptCore/parser/Nodes.h


Ignore:
Timestamp:
Aug 21, 2009, 11:40:53 PM (16 years ago)
Author:
Darin Adler
Message:

Syntax tree nodes should use arena allocation
https://bugs.webkit.org/show_bug.cgi?id=25674

Patch by Darin Adler <Darin Adler> on 2009-08-21
Reviewed by Gavin Barraclough.

Use an actual arena now. 0.6% speedup on SunSpider.

New and improved with 100% less leaking of the universe.

Removed all exports involving the class FunctionBodyNode, which no
longer needs to be used outside JavaScriptCore.

Executable.h project-internal instead of "private".

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::BytecodeGenerator): Updated since VarStack
contains const Identifier* now.

  • parser/Grammar.y: Made identifiers from the lexer be const

Identifier* and updated since VarStack contains const Identifier* now.

  • parser/Lexer.cpp:

(JSC::Lexer::setCode): Pass in ParserArena, used for identifiers.
(JSC::Lexer::makeIdentifier): Changed return type to const Identifier*
and changed to call ParserArena.
(JSC::Lexer::clear): Removed the code to manage m_identifiers and
added code to set m_arena to 0.

  • parser/Lexer.h: Updated for changes above.
  • parser/NodeConstructors.h:

(JSC::ParserArenaFreeable::operator new): Added. Calls allocateFreeable
on the arena.
(JSC::ParserArenaDeletable::operator new): Changed to call the
allocateDeletable function on the arena instead of deleteWithArena.
(JSC::PropertyNode::PropertyNode): Added new constructor that makes
numeric identifiers. Some day we might want to optimize this for
integers so it doesn't create a string for each one.
(JSC::ContinueNode::ContinueNode): Initialize m_ident to nullIdentifier
since it's now a const Identifier& so it can't be left uninitialized.
(JSC::BreakNode::BreakNode): Ditto.
(JSC::CaseClauseNode::CaseClauseNode): Updated to use SourceElements*
to keep track of the statements rather than a separate statement vector.
(JSC::BlockNode::BlockNode): Ditto.
(JSC::ForInNode::ForInNode): Initialize m_ident to nullIdentifier.

  • parser/Nodes.cpp: Moved the comment explaining emitBytecode in here.

It seemed strangely out of place in the header.
(JSC::ThrowableExpressionData::emitThrowError): Added an overload for
UString as well as Identifier.
(JSC::SourceElements::singleStatement): Added.
(JSC::SourceElements::lastStatement): Added.
(JSC::RegExpNode::emitBytecode): Changed the throwError code to use
the substitution mechanism instead of doing a string append.
(JSC::SourceElements::emitBytecode): Added. Replaces the old
statementListEmitCode function, since we now keep the SourceElements
objects around.
(JSC::BlockNode::lastStatement): Added.
(JSC::BlockNode::emitBytecode): Changed to use emitBytecode instead of
statementListEmitCode.
(JSC::CaseClauseNode::emitBytecode): Added.
(JSC::CaseBlockNode::emitBytecodeForBlock): Changed to use emitBytecode
instead of statementListEmitCode.
(JSC::ScopeNodeData::ScopeNodeData): Changed to store the
SourceElements* instead of using releaseContentsIntoVector.
(JSC::ScopeNode::emitStatementsBytecode): Added.
(JSC::ScopeNode::singleStatement): Added.
(JSC::ProgramNode::emitBytecode): Call emitStatementsBytecode instead
of statementListEmitCode.
(JSC::EvalNode::emitBytecode): Ditto.
(JSC::FunctionBodyNode::emitBytecode): Call emitStatementsBytecode
insetad of statementListEmitCode and check for the return node using
the new functions.

  • parser/Nodes.h: Changed VarStack to store const Identifier* instead

of Identifier and rely on the arena to control lifetime. Added a new
ParserArenaFreeable class. Made ParserArenaDeletable inherit from
FastAllocBase instead of having its own operator new. Base the Node
class on ParserArenaFreeable. Changed the various Node classes
to use const Identifier& instead of Identifier to avoid the need to
call their destructors and allow them to function as "freeable" in the
arena. Removed extraneous JSC_FAST_CALL on definitions of inline functions.
Changed ElementNode, PropertyNode, ArgumentsNode, ParameterNode,
CaseClauseNode, ClauseListNode, and CaseBlockNode to use ParserArenaFreeable
as a base class since they do not descend from Node. Eliminated the
StatementVector type and instead have various classes use SourceElements*
instead of StatementVector. This prevents those classes from having to
use ParserArenaDeletable to make sure the vector destructor is called.

  • parser/Parser.cpp:

(JSC::Parser::parse): Pass the arena to the lexer.

  • parser/Parser.h: Added an include of ParserArena.h, which is no longer

included by Nodes.h.
(JSC::Parser::parseFunctionFromGlobalCode): Changed to use the
singleStatement function, since there is no longer any children function.
Removed some unneeded use of RefPtr.

  • parser/ParserArena.cpp:

(JSC::ParserArena::ParserArena): Added. Initializes the new members,
m_freeableMemory, m_freeablePoolEnd, and m_identifiers.
(JSC::ParserArena::freeablePool): Added. Computes the pool pointer,
since we store only the current pointer and the end of pool pointer.
(JSC::ParserArena::deallocateObjects): Added. Contains the common
memory-deallocation logic used by both the destructor and the
reset function.
(JSC::ParserArena::~ParserArena): Changed to call deallocateObjects.
(JSC::ParserArena::reset): Ditto. Also added code to zero out the
new structures, and switched to use clear() instead of shrink(0) since
we don't really reuse arenas.
(JSC::ParserArena::makeNumericIdentifier): Added.
(JSC::ParserArena::allocateFreeablePool): Added. Used when the pool
is empty.
(JSC::ParserArena::isEmpty): Added. No longer inline, which is fine
since this is used only for assertions at the moment.
(JSC::ParserArena::derefWithArena): Make non-inline.

  • parser/ParserArena.h: Added an actual arena of "freeable" objects,

ones that don't need destructors to be called. Also added a separate
IdentifierArena object, a segmented vector of identifiers that used
to be in the Lexer.

  • runtime/Executable.h: Moved the definition of the

FunctionExecutable::make function here. It can't go in JSFunction.h
since that header has to be used outside JavaScriptCore and so can't
include this, which includes Nodes.h. The function could be moved
elswhere if we don't want to include JSFunction.h in this header, but
for now this seems to be the best place.

  • runtime/JSFunction.h: Removed the include of Executable.h and

definition of the FunctionExecutable::make function.

  • wtf/FastMalloc.cpp: Fixed an incorrect comment.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/parser/Nodes.h

    r47582 r47664  
    3535#include "SymbolTable.h"
    3636#include <wtf/MathExtras.h>
    37 #include <wtf/OwnPtr.h>
    3837
    3938namespace JSC {
     
    4140    class ArgumentListNode;
    4241    class BytecodeGenerator;
    43     class CodeBlock;
    44     class EvalCodeBlock;
    45     class EvalExecutable;
    46     class FuncDeclNode;
    4742    class FunctionBodyNode;
    48     class FunctionCodeBlock;
    49     class JSFunction;
    50     class ProgramCodeBlock;
    51     class ProgramExecutable;
    5243    class PropertyListNode;
    5344    class ReadModifyResolveNode;
    5445    class RegisterID;
    5546    class ScopeChainNode;
     47    class ScopeNode;
    5648
    5749    typedef unsigned CodeFeatures;
     
    9183    namespace DeclarationStacks {
    9284        enum VarAttrs { IsConstant = 1, HasInitializer = 2 };
    93         typedef Vector<std::pair<Identifier, unsigned> > VarStack;
     85        typedef Vector<std::pair<const Identifier*, unsigned> > VarStack;
    9486        typedef Vector<FunctionBodyNode*> FunctionStack;
    9587    }
     
    10193    };
    10294
     95    class ParserArenaFreeable {
     96    public:
     97        // ParserArenaFreeable objects are are freed when the arena is deleted.
     98        // Destructors are not called. Clients must not call delete on such objects.
     99        void* operator new(size_t, JSGlobalData*);
     100    };
     101
    103102    class ParserArenaDeletable {
    104     protected:
    105         ParserArenaDeletable() { }
    106 
    107103    public:
    108104        virtual ~ParserArenaDeletable() { }
    109105
    110         // Objects created with this version of new are deleted when the arena is deleted.
     106        // ParserArenaDeletable objects are deleted when the arena is deleted.
     107        // Clients must not call delete directly on such objects.
    111108        void* operator new(size_t, JSGlobalData*);
    112 
    113         // Objects created with this version of new are not deleted when the arena is deleted.
    114         // Other arrangements must be made.
    115         void* operator new(size_t);
    116 
    117         void operator delete(void*);
    118     };
    119 
    120     class ParserArenaRefCounted : public RefCountedCustomAllocated<ParserArenaRefCounted> {
     109    };
     110
     111    class ParserArenaRefCounted : public RefCounted<ParserArenaRefCounted> {
    121112    protected:
    122113        ParserArenaRefCounted(JSGlobalData*);
     
    129120    };
    130121
    131     class Node : public ParserArenaDeletable {
     122    class Node : public ParserArenaFreeable {
    132123    protected:
    133124        Node(JSGlobalData*);
    134125
    135126    public:
    136         /*
    137             Return value: The register holding the production's value.
    138                      dst: An optional parameter specifying the most efficient
    139                           destination at which to store the production's value.
    140                           The callee must honor dst.
    141 
    142             dst provides for a crude form of copy propagation. For example,
    143 
    144             x = 1
    145 
    146             becomes
    147            
    148             load r[x], 1
    149            
    150             instead of
    151 
    152             load r0, 1
    153             mov r[x], r0
    154            
    155             because the assignment node, "x =", passes r[x] as dst to the number
    156             node, "1".
    157         */
    158         virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* dst = 0) = 0;
     127        virtual ~Node() { }
     128
     129        virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* destination = 0) = 0;
    159130
    160131        int lineNo() const { return m_line; }
     
    165136
    166137    class ExpressionNode : public Node {
    167     public:
     138    protected:
    168139        ExpressionNode(JSGlobalData*, ResultType = ResultType::unknownType());
    169140
     141    public:
    170142        virtual bool isNumber() const { return false; }
    171143        virtual bool isString() const { return false; }
     
    185157        ResultType resultDescriptor() const { return m_resultType; }
    186158
    187         // This needs to be in public in order to compile using GCC 3.x
    188         typedef enum { EvalOperator, FunctionCall } CallerType;
    189 
    190159    private:
    191160        ResultType m_resultType;
     
    193162
    194163    class StatementNode : public Node {
    195     public:
     164    protected:
    196165        StatementNode(JSGlobalData*);
    197166
    198         void setLoc(int line0, int line1);
     167    public:
     168        void setLoc(int firstLine, int lastLine);
    199169        int firstLine() const { return lineNo(); }
    200170        int lastLine() const { return m_lastLine; }
     
    234204    class NumberNode : public ExpressionNode {
    235205    public:
    236         NumberNode(JSGlobalData*, double v);
    237 
    238         double value() const { return m_double; }
    239         void setValue(double d) { m_double = d; }
     206        NumberNode(JSGlobalData*, double value);
     207
     208        double value() const { return m_value; }
     209        void setValue(double value) { m_value = value; }
    240210
    241211    private:
     
    245215        virtual bool isPure(BytecodeGenerator&) const { return true; }
    246216
    247         double m_double;
     217        double m_value;
    248218    };
    249219
    250220    class StringNode : public ExpressionNode {
    251221    public:
    252         StringNode(JSGlobalData*, const Identifier& v);
     222        StringNode(JSGlobalData*, const Identifier&);
    253223
    254224        const Identifier& value() { return m_value; }
     225
     226    private:
    255227        virtual bool isPure(BytecodeGenerator&) const { return true; }
    256228
    257     private:
    258229        virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0);
    259230       
    260231        virtual bool isString() const { return true; }
    261232
    262         Identifier m_value;
     233        const Identifier& m_value;
    263234    };
    264235   
     
    291262
    292263    protected:
    293         RegisterID* emitThrowError(BytecodeGenerator&, ErrorType, const char* msg);
    294         RegisterID* emitThrowError(BytecodeGenerator&, ErrorType, const char* msg, const Identifier&);
     264        RegisterID* emitThrowError(BytecodeGenerator&, ErrorType, const char* message);
     265        RegisterID* emitThrowError(BytecodeGenerator&, ErrorType, const char* message, const UString&);
     266        RegisterID* emitThrowError(BytecodeGenerator&, ErrorType, const char* message, const Identifier&);
    295267
    296268    private:
     
    303275    public:
    304276        ThrowableSubExpressionData()
    305             : ThrowableExpressionData()
    306             , m_subexpressionDivotOffset(0)
     277            : m_subexpressionDivotOffset(0)
    307278            , m_subexpressionEndOffset(0)
    308279        {
     
    333304    public:
    334305        ThrowablePrefixedSubExpressionData()
    335             : ThrowableExpressionData()
    336             , m_subexpressionDivotOffset(0)
     306            : m_subexpressionDivotOffset(0)
    337307            , m_subexpressionStartOffset(0)
    338308        {
     
    367337        virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0);
    368338
    369         Identifier m_pattern;
    370         Identifier m_flags;
     339        const Identifier& m_pattern;
     340        const Identifier& m_flags;
    371341    };
    372342
     
    392362        virtual bool isResolveNode() const { return true; }
    393363
    394         Identifier m_ident;
     364        const Identifier& m_ident;
    395365        int32_t m_startOffset;
    396366    };
    397367
    398     class ElementNode : public ParserArenaDeletable {
     368    class ElementNode : public ParserArenaFreeable {
    399369    public:
    400370        ElementNode(JSGlobalData*, int elision, ExpressionNode*);
     
    429399    };
    430400
    431     class PropertyNode : public ParserArenaDeletable {
     401    class PropertyNode : public ParserArenaFreeable {
    432402    public:
    433403        enum Type { Constant, Getter, Setter };
     
    440410    private:
    441411        friend class PropertyListNode;
    442         Identifier m_name;
     412        const Identifier& m_name;
    443413        ExpressionNode* m_assign;
    444414        Type m_type;
     
    500470
    501471        ExpressionNode* m_base;
    502         Identifier m_ident;
     472        const Identifier& m_ident;
    503473    };
    504474
     
    515485    };
    516486
    517     class ArgumentsNode : public ParserArenaDeletable {
     487    class ArgumentsNode : public ParserArenaFreeable {
    518488    public:
    519489        ArgumentsNode(JSGlobalData*);
     
    563533        virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0);
    564534
    565         Identifier m_ident;
     535        const Identifier& m_ident;
    566536        ArgumentsNode* m_args;
    567537        size_t m_index; // Used by LocalVarFunctionCallNode.
     
    590560    protected:
    591561        ExpressionNode* m_base;
    592         const Identifier m_ident;
     562        const Identifier& m_ident;
    593563        ArgumentsNode* m_args;
    594564    };
     
    615585
    616586    protected:
    617         const Identifier m_ident;
     587        const Identifier& m_ident;
    618588    };
    619589
     
    648618
    649619        ExpressionNode* m_base;
    650         Identifier m_ident;
     620        const Identifier& m_ident;
    651621        Operator m_operator;
    652622    };
     
    670640        virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0);
    671641
    672         Identifier m_ident;
     642        const Identifier& m_ident;
    673643    };
    674644
     
    692662
    693663        ExpressionNode* m_base;
    694         Identifier m_ident;
     664        const Identifier& m_ident;
    695665    };
    696666
     
    724694        virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0);
    725695
    726         Identifier m_ident;
     696        const Identifier& m_ident;
    727697    };
    728698
     
    767737
    768738        ExpressionNode* m_base;
    769         Identifier m_ident;
     739        const Identifier& m_ident;
    770740        Operator m_operator;
    771741    };
     
    826796        BinaryOpNode(JSGlobalData*, ResultType, ExpressionNode* expr1, ExpressionNode* expr2, OpcodeID, bool rightHasAssignments);
    827797
    828         RegisterID* emitStrcat(BytecodeGenerator& generator, RegisterID* dst, RegisterID* lhs = 0, ReadModifyResolveNode* emitExpressionInfoForMe = 0);
     798        RegisterID* emitStrcat(BytecodeGenerator& generator, RegisterID* destination, RegisterID* lhs = 0, ReadModifyResolveNode* emitExpressionInfoForMe = 0);
    829799
    830800    private:
     
    1009979        virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0);
    1010980
    1011         Identifier m_ident;
     981        const Identifier& m_ident;
    1012982        ExpressionNode* m_right;
    1013983        size_t m_index; // Used by ReadModifyLocalVarNode.
     
    1023993        virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0);
    1024994
    1025         Identifier m_ident;
     995        const Identifier& m_ident;
    1026996        ExpressionNode* m_right;
    1027997        size_t m_index; // Used by ReadModifyLocalVarNode.
     
    10661036
    10671037        ExpressionNode* m_base;
    1068         Identifier m_ident;
     1038        const Identifier& m_ident;
    10691039        ExpressionNode* m_right;
    10701040        bool m_rightHasAssignments;
     
    10791049
    10801050        ExpressionNode* m_base;
    1081         Identifier m_ident;
     1051        const Identifier& m_ident;
    10821052        ExpressionNode* m_right;
    10831053        Operator m_operator : 31;
     
    11231093        virtual RegisterID* emitCodeSingle(BytecodeGenerator&);
    11241094
    1125         Identifier m_ident;
     1095        const Identifier& m_ident;
    11261096
    11271097    public:
     
    11421112    };
    11431113
    1144     typedef Vector<StatementNode*> StatementVector;
    1145 
    11461114    class SourceElements : public ParserArenaDeletable {
    11471115    public:
     
    11491117
    11501118        void append(StatementNode*);
    1151         void releaseContentsIntoVector(StatementVector& destination)
    1152         {
    1153             ASSERT(destination.isEmpty());
    1154             m_statements.swap(destination);
    1155             destination.shrinkToFit();
    1156         }
    1157 
    1158     private:
    1159         StatementVector m_statements;
     1119
     1120        StatementNode* singleStatement() const;
     1121        StatementNode* lastStatement() const;
     1122
     1123        void emitBytecode(BytecodeGenerator&, RegisterID* destination);
     1124
     1125    private:
     1126        Vector<StatementNode*> m_statements;
    11601127    };
    11611128
    11621129    class BlockNode : public StatementNode {
    11631130    public:
    1164         BlockNode(JSGlobalData*, SourceElements* children);
    1165 
    1166         StatementVector& children() { return m_children; }
     1131        BlockNode(JSGlobalData*, SourceElements* = 0);
     1132
     1133        StatementNode* lastStatement() const;
    11671134
    11681135    private:
     
    11711138        virtual bool isBlock() const { return true; }
    11721139
    1173         StatementVector m_children;
     1140        SourceElements* m_statements;
    11741141    };
    11751142
     
    12811248        virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0);
    12821249
    1283         Identifier m_ident;
     1250        const Identifier& m_ident;
    12841251        ExpressionNode* m_init;
    12851252        ExpressionNode* m_lexpr;
     
    12971264        virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0);
    12981265
    1299         Identifier m_ident;
     1266        const Identifier& m_ident;
    13001267    };
    13011268
     
    13081275        virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0);
    13091276
    1310         Identifier m_ident;
     1277        const Identifier& m_ident;
    13111278    };
    13121279
     
    13431310        virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0);
    13441311
    1345         Identifier m_name;
     1312        const Identifier& m_name;
    13461313        StatementNode* m_statement;
    13471314    };
     
    13621329
    13631330    private:
    1364         virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* dst = 0);
     1331        virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0);
    13651332
    13661333        StatementNode* m_tryBlock;
    1367         Identifier m_exceptionIdent;
     1334        const Identifier& m_exceptionIdent;
    13681335        StatementNode* m_catchBlock;
    13691336        StatementNode* m_finallyBlock;
     
    13711338    };
    13721339
    1373     class ParameterNode : public ParserArenaDeletable {
     1340    class ParameterNode : public ParserArenaFreeable {
    13741341    public:
    13751342        ParameterNode(JSGlobalData*, const Identifier&);
     
    13801347
    13811348    private:
    1382         Identifier m_ident;
     1349        const Identifier& m_ident;
    13831350        ParameterNode* m_next;
    13841351    };
     
    13941361        FunctionStack m_functionStack;
    13951362        int m_numConstants;
    1396         StatementVector m_children;
     1363        SourceElements* m_statements;
    13971364    };
    13981365
     
    14041371        ScopeNode(JSGlobalData*);
    14051372        ScopeNode(JSGlobalData*, const SourceCode&, SourceElements*, VarStack*, FunctionStack*, CodeFeatures, int numConstants);
     1373
     1374        using ParserArenaRefCounted::operator new;
    14061375
    14071376        void adoptData(std::auto_ptr<ScopeNodeData> data)
     
    14301399        FunctionStack& functionStack() { ASSERT(m_data); return m_data->m_functionStack; }
    14311400
    1432         StatementVector& children() { ASSERT(m_data); return m_data->m_children; }
    1433 
    14341401        int neededConstants()
    14351402        {
     
    14401407        }
    14411408
     1409        StatementNode* singleStatement() const;
     1410
     1411        void emitStatementsBytecode(BytecodeGenerator&, RegisterID* destination);
     1412
    14421413    protected:
    14431414        void setSource(const SourceCode& source) { m_source = source; }
     
    14881459        const Identifier& ident() { return m_ident; }
    14891460
    1490         void reparseDataIfNecessary(ScopeChainNode* scopeChainNode);
     1461        void reparseDataIfNecessary(ScopeChainNode*);
    14911462
    14921463    private:
    14931464        FunctionBodyNode(JSGlobalData*);
    14941465        FunctionBodyNode(JSGlobalData*, SourceElements*, VarStack*, FunctionStack*, const SourceCode&, CodeFeatures, int numConstants);
     1466
    14951467        Identifier m_ident;
    14961468        Identifier* m_parameters;
     
    15021474        FuncExprNode(JSGlobalData*, const Identifier&, FunctionBodyNode* body, const SourceCode& source, ParameterNode* parameter = 0);
    15031475
    1504         FunctionBodyNode* body() { return m_body.get(); }
     1476        FunctionBodyNode* body() { return m_body; }
    15051477
    15061478    private:
     
    15091481        virtual bool isFuncExprNode() const { return true; }
    15101482
    1511         RefPtr<FunctionBodyNode> m_body;
     1483        FunctionBodyNode* m_body;
    15121484    };
    15131485
     
    15161488        FuncDeclNode(JSGlobalData*, const Identifier&, FunctionBodyNode*, const SourceCode&, ParameterNode* = 0);
    15171489
    1518         FunctionBodyNode* body() { return m_body.get(); }
    1519 
    1520     private:
    1521         virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0);
    1522 
    1523         RefPtr<FunctionBodyNode> m_body;
    1524     };
    1525 
    1526     class CaseClauseNode : public ParserArenaDeletable {
    1527     public:
    1528         CaseClauseNode(JSGlobalData*, ExpressionNode*);
    1529         CaseClauseNode(JSGlobalData*, ExpressionNode*, SourceElements*);
     1490        FunctionBodyNode* body() { return m_body; }
     1491
     1492    private:
     1493        virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0);
     1494
     1495        FunctionBodyNode* m_body;
     1496    };
     1497
     1498    class CaseClauseNode : public ParserArenaFreeable {
     1499    public:
     1500        CaseClauseNode(JSGlobalData*, ExpressionNode*, SourceElements* = 0);
    15301501
    15311502        ExpressionNode* expr() const { return m_expr; }
    1532         StatementVector& children() { return m_children; }
    1533 
    1534     private:
    1535         ExpressionNode* m_expr;
    1536         StatementVector m_children;
    1537     };
    1538 
    1539     class ClauseListNode : public ParserArenaDeletable {
     1503
     1504        void emitBytecode(BytecodeGenerator&, RegisterID* destination);
     1505
     1506    private:
     1507        ExpressionNode* m_expr;
     1508        SourceElements* m_statements;
     1509    };
     1510
     1511    class ClauseListNode : public ParserArenaFreeable {
    15401512    public:
    15411513        ClauseListNode(JSGlobalData*, CaseClauseNode*);
     
    15501522    };
    15511523
    1552     class CaseBlockNode : public ParserArenaDeletable {
     1524    class CaseBlockNode : public ParserArenaFreeable {
    15531525    public:
    15541526        CaseBlockNode(JSGlobalData*, ClauseListNode* list1, CaseClauseNode* defaultClause, ClauseListNode* list2);
    15551527
    1556         RegisterID* emitBytecodeForBlock(BytecodeGenerator&, RegisterID* input, RegisterID* dst = 0);
     1528        RegisterID* emitBytecodeForBlock(BytecodeGenerator&, RegisterID* input, RegisterID* destination);
    15571529
    15581530    private:
Note: See TracChangeset for help on using the changeset viewer.