467 public:
468 const uint _size; // Number of targets
469
470 PCTableNode( Node *ctrl, Node *idx, uint size ) : MultiBranchNode(2), _size(size) {
471 init_class_id(Class_PCTable);
472 init_req(0, ctrl);
473 init_req(1, idx);
474 }
475 virtual int Opcode() const;
476 virtual const Type* Value(PhaseGVN* phase) const;
477 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
478 virtual const Type *bottom_type() const;
479 virtual bool pinned() const { return true; }
480 virtual int required_outcnt() const { return _size; }
481 };
482
483 //------------------------------JumpNode---------------------------------------
484 // Indirect branch. Uses PCTable above to implement a switch statement.
485 // It emits as a table load and local branch.
486 class JumpNode : public PCTableNode {
487 public:
488 JumpNode( Node* control, Node* switch_val, uint size) : PCTableNode(control, switch_val, size) {
489 init_class_id(Class_Jump);
490 }
491 virtual int Opcode() const;
492 virtual const RegMask& out_RegMask() const;
493 virtual const Node* is_block_proj() const { return this; }
494 #ifndef PRODUCT
495 virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
496 #endif
497 };
498
499 class JumpProjNode : public JProjNode {
500 virtual uint hash() const;
501 virtual uint cmp( const Node &n ) const;
502 virtual uint size_of() const { return sizeof(*this); }
503
504 private:
505 const int _dest_bci;
506 const uint _proj_no;
507 const int _switch_val;
508 public:
|
467 public:
468 const uint _size; // Number of targets
469
470 PCTableNode( Node *ctrl, Node *idx, uint size ) : MultiBranchNode(2), _size(size) {
471 init_class_id(Class_PCTable);
472 init_req(0, ctrl);
473 init_req(1, idx);
474 }
475 virtual int Opcode() const;
476 virtual const Type* Value(PhaseGVN* phase) const;
477 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
478 virtual const Type *bottom_type() const;
479 virtual bool pinned() const { return true; }
480 virtual int required_outcnt() const { return _size; }
481 };
482
483 //------------------------------JumpNode---------------------------------------
484 // Indirect branch. Uses PCTable above to implement a switch statement.
485 // It emits as a table load and local branch.
486 class JumpNode : public PCTableNode {
487 virtual uint size_of() const { return sizeof(*this); }
488 public:
489 float* _probs; // probabily of each projection
490 float _fcnt; // total number of times this Jump was executed
491 JumpNode( Node* control, Node* switch_val, uint size, float* probs, float cnt)
492 : PCTableNode(control, switch_val, size),
493 _probs(probs), _fcnt(cnt) {
494 init_class_id(Class_Jump);
495 }
496 virtual int Opcode() const;
497 virtual const RegMask& out_RegMask() const;
498 virtual const Node* is_block_proj() const { return this; }
499 #ifndef PRODUCT
500 virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
501 #endif
502 };
503
504 class JumpProjNode : public JProjNode {
505 virtual uint hash() const;
506 virtual uint cmp( const Node &n ) const;
507 virtual uint size_of() const { return sizeof(*this); }
508
509 private:
510 const int _dest_bci;
511 const uint _proj_no;
512 const int _switch_val;
513 public:
|