| Index: src/codegen.h
|
| ===================================================================
|
| --- src/codegen.h (revision 969)
|
| +++ src/codegen.h (working copy)
|
| @@ -44,6 +44,7 @@
|
| // shared code:
|
| // CodeGenerator::CodeGenerator
|
| // CodeGenerator::~CodeGenerator
|
| +// CodeGenerator::SetFrame
|
| // CodeGenerator::ProcessDeferred
|
| // CodeGenerator::GenCode
|
| // CodeGenerator::BuildBoilerplate
|
| @@ -81,16 +82,29 @@
|
| class DeferredCode: public ZoneObject {
|
| public:
|
| explicit DeferredCode(CodeGenerator* generator);
|
| - virtual ~DeferredCode() { }
|
| + virtual ~DeferredCode() {}
|
|
|
| virtual void Generate() = 0;
|
|
|
| MacroAssembler* masm() const { return masm_; }
|
| CodeGenerator* generator() const { return generator_; }
|
|
|
| - JumpTarget* enter() { return &enter_; }
|
| - JumpTarget* exit() { return &exit_; }
|
| + // Emit a conditional branch to the code entry.
|
| + void BranchTo(Condition cc);
|
|
|
| + // Bind the exit target of the code.
|
| + void BindExit();
|
| +
|
| + // Emit an exit from the code if the exit target is bound.
|
| + void ExitIfBound();
|
| +
|
| + Label* enter() { return &enter_; }
|
| +
|
| + VirtualFrame* frame() { return frame_; }
|
| + void clear_frame() { frame_ = NULL; }
|
| +
|
| + RegisterFile* registers() { return ®isters_; }
|
| +
|
| int statement_position() const { return statement_position_; }
|
| int position() const { return position_; }
|
|
|
| @@ -110,8 +124,17 @@
|
|
|
| private:
|
| CodeGenerator* const generator_;
|
| - JumpTarget enter_;
|
| +
|
| + // The entry is a label, paired with a known frame and a known global
|
| + // register file. It is not a jump target because it doesn't use any of
|
| + // the jump target's branch or bind machinery.
|
| + Label enter_;
|
| + VirtualFrame* frame_;
|
| + RegisterFile registers_;
|
| +
|
| + // The exit target is a regular jump target.
|
| JumpTarget exit_;
|
| +
|
| int statement_position_;
|
| int position_;
|
| #ifdef DEBUG
|
|
|