Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(692)

Unified Diff: src/jump-target.h

Issue 113458: First round of size reduction for JumpTargets. Reduce their size by... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/jump-target.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/jump-target.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698