Chromium Code Reviews| Index: src/jump-target.h |
| =================================================================== |
| --- src/jump-target.h (revision 1967) |
| +++ src/jump-target.h (working copy) |
| @@ -58,29 +58,35 @@ |
| // Construct a jump target with a given code generator used to generate |
|
William Hesse
2009/05/18 12:18:24
This comment should be changed.
|
| // code and to provide access to a current frame. |
| - explicit JumpTarget(CodeGenerator* cgen, |
| - Directionality direction = FORWARD_ONLY); |
| + explicit JumpTarget(Directionality direction) |
| + : direction_(direction), |
| + reaching_frames_(0), |
| + merge_labels_(0), |
| + entry_frame_(NULL) { |
| + } |
| // Construct a jump target without a code generator. A code |
|
William Hesse
2009/05/18 12:18:24
This comment should be changed.
|
| // generator must be supplied before using the jump target as a |
| // label. This is useful, eg, when break targets are embedded in |
| // AST nodes. |
| - JumpTarget(); |
| + JumpTarget() |
| + : direction_(FORWARD_ONLY), |
| + reaching_frames_(0), |
| + merge_labels_(0), |
| + entry_frame_(NULL) { |
| + } |
| virtual ~JumpTarget() {} |
| - // Supply a code generator and directionality to an already |
| - // constructed jump target. This function expects to be given a |
| - // non-null code generator, and to be called only when the code |
| - // generator is not yet set. |
| - virtual void Initialize(CodeGenerator* cgen, |
| - Directionality direction = FORWARD_ONLY); |
| + // Set the direction of the jump target. |
| + virtual void set_direction(Directionality direction) { |
| + direction_ = direction; |
| + } |
| // Treat the jump target as a fresh one. The state is reset. |
| void Unuse(); |
| - // Accessors. |
| - CodeGenerator* code_generator() const { return cgen_; } |
| + inline CodeGenerator* cgen(); |
| Label* entry_label() { return &entry_label_; } |
| @@ -163,12 +169,6 @@ |
| } |
| protected: |
| - // The code generator gives access to its current frame. |
| - CodeGenerator* cgen_; |
| - |
| - // Used to emit code. |
| - MacroAssembler* masm_; |
| - |
| // Directionality flag set at initialization time. |
| Directionality direction_; |
| @@ -232,12 +232,8 @@ |
| virtual ~BreakTarget() {} |
| - // Supply a code generator, expected expression stack height, and |
| - // directionality to an already constructed break target. This |
| - // function expects to be given a non-null code generator, and to be |
| - // called only when the code generator is not yet set. |
| - virtual void Initialize(CodeGenerator* cgen, |
| - Directionality direction = FORWARD_ONLY); |
| + // Set the direction of the break target. |
| + virtual void set_direction(Directionality direction); |
| // Copy the state of this break target to the destination. The |
| // lists of forward-reaching frames and merge-point labels are |