src/share/vm/opto/machnode.hpp

changeset 3051
11211f7cb5a0
parent 3049
95134e034042
child 3316
f03a3c8bd5e5
     1.1 --- a/src/share/vm/opto/machnode.hpp	Tue Aug 16 04:14:05 2011 -0700
     1.2 +++ b/src/share/vm/opto/machnode.hpp	Tue Aug 16 11:53:57 2011 -0700
     1.3 @@ -185,7 +185,6 @@
     1.4    virtual void use_cisc_RegMask();
     1.5  
     1.6    // Support for short branches
     1.7 -  virtual MachNode *short_branch_version(Compile* C) { return NULL; }
     1.8    bool may_be_short_branch() const { return (flags() & Flag_may_be_short_branch) != 0; }
     1.9  
    1.10    // Avoid back to back some instructions on some CPUs.
    1.11 @@ -272,18 +271,12 @@
    1.12    // Call "get_base_and_disp" to decide which category of memory is used here.
    1.13    virtual const class TypePtr *adr_type() const;
    1.14  
    1.15 -  // Negate conditional branches.  Error for non-branch Nodes
    1.16 -  virtual void negate();
    1.17 -
    1.18    // Apply peephole rule(s) to this instruction
    1.19    virtual MachNode *peephole( Block *block, int block_index, PhaseRegAlloc *ra_, int &deleted, Compile* C );
    1.20  
    1.21    // Top-level ideal Opcode matched
    1.22    virtual int ideal_Opcode()     const { return Op_Node; }
    1.23  
    1.24 -  // Set the branch inside jump MachNodes.  Error for non-branch Nodes.
    1.25 -  virtual void label_set( Label* label, uint block_num );
    1.26 -
    1.27    // Adds the label for the case
    1.28    virtual void add_case_label( int switch_val, Label* blockLabel);
    1.29  
    1.30 @@ -514,25 +507,41 @@
    1.31  #endif
    1.32  };
    1.33  
    1.34 +//------------------------------MachBranchNode--------------------------------
    1.35 +// Abstract machine branch Node
    1.36 +class MachBranchNode : public MachIdealNode {
    1.37 +public:
    1.38 +  MachBranchNode() : MachIdealNode() {
    1.39 +    init_class_id(Class_MachBranch);
    1.40 +  }
    1.41 +  virtual void label_set(Label* label, uint block_num) = 0;
    1.42 +  virtual void save_label(Label** label, uint* block_num) = 0;
    1.43 +
    1.44 +  // Support for short branches
    1.45 +  virtual MachNode *short_branch_version(Compile* C) { return NULL; }
    1.46 +
    1.47 +  virtual bool pinned() const { return true; };
    1.48 +};
    1.49 +
    1.50  //------------------------------MachNullChkNode--------------------------------
    1.51  // Machine-dependent null-pointer-check Node.  Points a real MachNode that is
    1.52  // also some kind of memory op.  Turns the indicated MachNode into a
    1.53  // conditional branch with good latency on the ptr-not-null path and awful
    1.54  // latency on the pointer-is-null path.
    1.55  
    1.56 -class MachNullCheckNode : public MachIdealNode {
    1.57 +class MachNullCheckNode : public MachBranchNode {
    1.58  public:
    1.59    const uint _vidx;             // Index of memop being tested
    1.60 -  MachNullCheckNode( Node *ctrl, Node *memop, uint vidx ) : MachIdealNode(), _vidx(vidx) {
    1.61 +  MachNullCheckNode( Node *ctrl, Node *memop, uint vidx ) : MachBranchNode(), _vidx(vidx) {
    1.62      init_class_id(Class_MachNullCheck);
    1.63 -    init_flags(Flag_is_Branch);
    1.64      add_req(ctrl);
    1.65      add_req(memop);
    1.66    }
    1.67 +  virtual uint size_of() const { return sizeof(*this); }
    1.68  
    1.69    virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const;
    1.70    virtual void label_set(Label* label, uint block_num);
    1.71 -  virtual bool pinned() const { return true; };
    1.72 +  virtual void save_label(Label** label, uint* block_num);
    1.73    virtual void negate() { }
    1.74    virtual const class Type *bottom_type() const { return TypeTuple::IFBOTH; }
    1.75    virtual uint ideal_reg() const { return NotAMachineReg; }
    1.76 @@ -578,14 +587,16 @@
    1.77  
    1.78  //------------------------------MachIfNode-------------------------------------
    1.79  // Machine-specific versions of IfNodes
    1.80 -class MachIfNode : public MachNode {
    1.81 +class MachIfNode : public MachBranchNode {
    1.82    virtual uint size_of() const { return sizeof(*this); } // Size is bigger
    1.83  public:
    1.84    float _prob;                  // Probability branch goes either way
    1.85    float _fcnt;                  // Frequency counter
    1.86 -  MachIfNode() : MachNode() {
    1.87 +  MachIfNode() : MachBranchNode() {
    1.88      init_class_id(Class_MachIf);
    1.89    }
    1.90 +  // Negate conditional branches.
    1.91 +  virtual void negate() = 0;
    1.92  #ifndef PRODUCT
    1.93    virtual void dump_spec(outputStream *st) const;
    1.94  #endif
    1.95 @@ -593,9 +604,9 @@
    1.96  
    1.97  //------------------------------MachGotoNode-----------------------------------
    1.98  // Machine-specific versions of GotoNodes
    1.99 -class MachGotoNode : public MachNode {
   1.100 +class MachGotoNode : public MachBranchNode {
   1.101  public:
   1.102 -  MachGotoNode() : MachNode() {
   1.103 +  MachGotoNode() : MachBranchNode() {
   1.104      init_class_id(Class_MachGoto);
   1.105    }
   1.106  };

mercurial