< prev index next >

src/hotspot/share/opto/machnode.hpp

Print this page

  34 #include "utilities/growableArray.hpp"
  35 
  36 class BufferBlob;
  37 class CodeBuffer;
  38 class JVMState;
  39 class MachCallDynamicJavaNode;
  40 class MachCallJavaNode;
  41 class MachCallLeafNode;
  42 class MachCallNode;
  43 class MachCallRuntimeNode;
  44 class MachCallStaticJavaNode;
  45 class MachEpilogNode;
  46 class MachIfNode;
  47 class MachNullCheckNode;
  48 class MachOper;
  49 class MachProjNode;
  50 class MachPrologNode;
  51 class MachReturnNode;
  52 class MachSafePointNode;
  53 class MachSpillCopyNode;

  54 class Matcher;
  55 class PhaseRegAlloc;
  56 class RegMask;
  57 class RTMLockingCounters;
  58 class State;
  59 
  60 //---------------------------MachOper------------------------------------------
  61 class MachOper : public ResourceObj {
  62 public:
  63   // Allocate right next to the MachNodes in the same arena
  64   void *operator new(size_t x) throw() {
  65     Compile* C = Compile::current();
  66     return C->node_arena()->AmallocWords(x);
  67   }
  68 
  69   // Opcode
  70   virtual uint opcode() const = 0;
  71 
  72   // Number of input edges.
  73   // Generally at least 1

 477     dump();
 478 #endif
 479     ShouldNotCallThis();
 480   }
 481 
 482   virtual const RegMask &in_RegMask(uint idx) const {
 483     if (idx == mach_constant_base_node_input())
 484       return MachConstantBaseNode::static_out_RegMask();
 485     return MachNode::in_RegMask(idx);
 486   }
 487 
 488   // Input edge of MachConstantBaseNode.
 489   virtual uint mach_constant_base_node_input() const { return req() - 1; }
 490 
 491   int  constant_offset();
 492   int  constant_offset() const { return ((MachConstantNode*) this)->constant_offset(); }
 493   // Unchecked version to avoid assertions in debug output.
 494   int  constant_offset_unchecked() const;
 495 };
 496 






























 497 //------------------------------MachUEPNode-----------------------------------
 498 // Machine Unvalidated Entry Point Node
 499 class MachUEPNode : public MachIdealNode {
 500 public:
 501   MachUEPNode( ) {}
 502   virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const;
 503   virtual uint size(PhaseRegAlloc *ra_) const;
 504 
 505 #ifndef PRODUCT
 506   virtual const char *Name() const { return "Unvalidated-Entry-Point"; }
 507   virtual void format( PhaseRegAlloc *, outputStream *st ) const;
 508 #endif
 509 };
 510 
 511 //------------------------------MachPrologNode--------------------------------
 512 // Machine function Prolog Node
 513 class MachPrologNode : public MachIdealNode {
 514 public:
 515   MachPrologNode( ) {}








 516   virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const;
 517   virtual uint size(PhaseRegAlloc *ra_) const;
 518   virtual int reloc() const;
 519 
 520 #ifndef PRODUCT
 521   virtual const char *Name() const { return "Prolog"; }
 522   virtual void format( PhaseRegAlloc *, outputStream *st ) const;
 523 #endif
 524 };
 525 
 526 //------------------------------MachEpilogNode--------------------------------
 527 // Machine function Epilog Node
 528 class MachEpilogNode : public MachIdealNode {
 529 public:
 530   MachEpilogNode(bool do_poll = false) : _do_polling(do_poll) {}
 531   virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const;
 532   virtual uint size(PhaseRegAlloc *ra_) const;
 533   virtual int reloc() const;
 534   virtual const Pipeline *pipeline() const;
 535 
 536 private:
 537   bool _do_polling;
 538 
 539 public:
 540   bool do_polling() const { return _do_polling; }
 541 
 542 #ifndef PRODUCT
 543   virtual const char *Name() const { return "Epilog"; }
 544   virtual void format( PhaseRegAlloc *, outputStream *st ) const;
 545 #endif
 546 };
 547 
 548 //------------------------------MachNopNode-----------------------------------
 549 // Machine function Nop Node
 550 class MachNopNode : public MachIdealNode {
 551 private:
 552   int _count;

 900 
 901   const TypeFunc* tf()        const { return _tf; }
 902   const address entry_point() const { return _entry_point; }
 903   const float   cnt()         const { return _cnt; }
 904 
 905   void set_tf(const TypeFunc* tf)       { _tf = tf; }
 906   void set_entry_point(address p)       { _entry_point = p; }
 907   void set_cnt(float c)                 { _cnt = c; }
 908   void set_guaranteed_safepoint(bool b) { _guaranteed_safepoint = b; }
 909 
 910   MachCallNode() : MachSafePointNode() {
 911     init_class_id(Class_MachCall);
 912   }
 913 
 914   virtual const Type *bottom_type() const;
 915   virtual bool  pinned() const { return false; }
 916   virtual const Type* Value(PhaseGVN* phase) const;
 917   virtual const RegMask &in_RegMask(uint) const;
 918   virtual int ret_addr_offset() { return 0; }
 919 
 920   NOT_LP64(bool return_value_is_used() const;)
 921 
 922   // Similar to cousin class CallNode::returns_pointer
 923   bool returns_pointer() const;

 924 
 925   bool guaranteed_safepoint() const { return _guaranteed_safepoint; }
 926 
 927 #ifndef PRODUCT
 928   virtual void dump_spec(outputStream *st) const;
 929 #endif
 930 };
 931 
 932 //------------------------------MachCallJavaNode------------------------------
 933 // "Base" class for machine-specific versions of subroutine calls
 934 class MachCallJavaNode : public MachCallNode {
 935 protected:
 936   virtual bool cmp( const Node &n ) const;
 937   virtual uint size_of() const; // Size is bigger
 938 public:
 939   ciMethod* _method;                 // Method being direct called
 940   bool      _override_symbolic_info; // Override symbolic call site info from bytecode
 941   bool      _optimized_virtual;      // Tells if node is a static call or an optimized virtual
 942   bool      _method_handle_invoke;   // Tells if the call has to preserve SP
 943   bool      _arg_escape;             // ArgEscape in parameter list

  34 #include "utilities/growableArray.hpp"
  35 
  36 class BufferBlob;
  37 class CodeBuffer;
  38 class JVMState;
  39 class MachCallDynamicJavaNode;
  40 class MachCallJavaNode;
  41 class MachCallLeafNode;
  42 class MachCallNode;
  43 class MachCallRuntimeNode;
  44 class MachCallStaticJavaNode;
  45 class MachEpilogNode;
  46 class MachIfNode;
  47 class MachNullCheckNode;
  48 class MachOper;
  49 class MachProjNode;
  50 class MachPrologNode;
  51 class MachReturnNode;
  52 class MachSafePointNode;
  53 class MachSpillCopyNode;
  54 class MachVEPNode;
  55 class Matcher;
  56 class PhaseRegAlloc;
  57 class RegMask;
  58 class RTMLockingCounters;
  59 class State;
  60 
  61 //---------------------------MachOper------------------------------------------
  62 class MachOper : public ResourceObj {
  63 public:
  64   // Allocate right next to the MachNodes in the same arena
  65   void *operator new(size_t x) throw() {
  66     Compile* C = Compile::current();
  67     return C->node_arena()->AmallocWords(x);
  68   }
  69 
  70   // Opcode
  71   virtual uint opcode() const = 0;
  72 
  73   // Number of input edges.
  74   // Generally at least 1

 478     dump();
 479 #endif
 480     ShouldNotCallThis();
 481   }
 482 
 483   virtual const RegMask &in_RegMask(uint idx) const {
 484     if (idx == mach_constant_base_node_input())
 485       return MachConstantBaseNode::static_out_RegMask();
 486     return MachNode::in_RegMask(idx);
 487   }
 488 
 489   // Input edge of MachConstantBaseNode.
 490   virtual uint mach_constant_base_node_input() const { return req() - 1; }
 491 
 492   int  constant_offset();
 493   int  constant_offset() const { return ((MachConstantNode*) this)->constant_offset(); }
 494   // Unchecked version to avoid assertions in debug output.
 495   int  constant_offset_unchecked() const;
 496 };
 497 
 498 //------------------------------MachVEPNode-----------------------------------
 499 // Machine Inline Type Entry Point Node
 500 class MachVEPNode : public MachIdealNode {
 501 public:
 502   Label* _verified_entry;
 503 
 504   MachVEPNode(Label* verified_entry, bool verified, bool receiver_only) :
 505     _verified_entry(verified_entry),
 506     _verified(verified),
 507     _receiver_only(receiver_only) {
 508     init_class_id(Class_MachVEP);
 509   }
 510   virtual bool cmp(const Node &n) const {
 511     return (_verified_entry == ((MachVEPNode&)n)._verified_entry) &&
 512            (_verified == ((MachVEPNode&)n)._verified) &&
 513            (_receiver_only == ((MachVEPNode&)n)._receiver_only) &&
 514            MachIdealNode::cmp(n);
 515   }
 516   virtual uint size_of() const { return sizeof(*this); }
 517   virtual void emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const;
 518 
 519 #ifndef PRODUCT
 520   virtual const char* Name() const { return "InlineType Entry-Point"; }
 521   virtual void format(PhaseRegAlloc*, outputStream* st) const;
 522 #endif
 523 private:
 524   bool   _verified;
 525   bool   _receiver_only;
 526 };
 527 
 528 //------------------------------MachUEPNode-----------------------------------
 529 // Machine Unvalidated Entry Point Node
 530 class MachUEPNode : public MachIdealNode {
 531 public:
 532   MachUEPNode( ) {}
 533   virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const;

 534 
 535 #ifndef PRODUCT
 536   virtual const char *Name() const { return "Unvalidated-Entry-Point"; }
 537   virtual void format( PhaseRegAlloc *, outputStream *st ) const;
 538 #endif
 539 };
 540 
 541 //------------------------------MachPrologNode--------------------------------
 542 // Machine function Prolog Node
 543 class MachPrologNode : public MachIdealNode {
 544 public:
 545   Label* _verified_entry;
 546 
 547   MachPrologNode(Label* verified_entry) : _verified_entry(verified_entry) {
 548     init_class_id(Class_MachProlog);
 549   }
 550   virtual bool cmp(const Node &n) const {
 551     return (_verified_entry == ((MachPrologNode&)n)._verified_entry) && MachIdealNode::cmp(n);
 552   }
 553   virtual uint size_of() const { return sizeof(*this); }
 554   virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const;

 555   virtual int reloc() const;
 556 
 557 #ifndef PRODUCT
 558   virtual const char *Name() const { return "Prolog"; }
 559   virtual void format( PhaseRegAlloc *, outputStream *st ) const;
 560 #endif
 561 };
 562 
 563 //------------------------------MachEpilogNode--------------------------------
 564 // Machine function Epilog Node
 565 class MachEpilogNode : public MachIdealNode {
 566 public:
 567   MachEpilogNode(bool do_poll = false) : _do_polling(do_poll) {}
 568   virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const;

 569   virtual int reloc() const;
 570   virtual const Pipeline *pipeline() const;
 571 
 572 private:
 573   bool _do_polling;
 574 
 575 public:
 576   bool do_polling() const { return _do_polling; }
 577 
 578 #ifndef PRODUCT
 579   virtual const char *Name() const { return "Epilog"; }
 580   virtual void format( PhaseRegAlloc *, outputStream *st ) const;
 581 #endif
 582 };
 583 
 584 //------------------------------MachNopNode-----------------------------------
 585 // Machine function Nop Node
 586 class MachNopNode : public MachIdealNode {
 587 private:
 588   int _count;

 936 
 937   const TypeFunc* tf()        const { return _tf; }
 938   const address entry_point() const { return _entry_point; }
 939   const float   cnt()         const { return _cnt; }
 940 
 941   void set_tf(const TypeFunc* tf)       { _tf = tf; }
 942   void set_entry_point(address p)       { _entry_point = p; }
 943   void set_cnt(float c)                 { _cnt = c; }
 944   void set_guaranteed_safepoint(bool b) { _guaranteed_safepoint = b; }
 945 
 946   MachCallNode() : MachSafePointNode() {
 947     init_class_id(Class_MachCall);
 948   }
 949 
 950   virtual const Type *bottom_type() const;
 951   virtual bool  pinned() const { return false; }
 952   virtual const Type* Value(PhaseGVN* phase) const;
 953   virtual const RegMask &in_RegMask(uint) const;
 954   virtual int ret_addr_offset() { return 0; }
 955 
 956   bool return_value_is_used() const;
 957 
 958   // Similar to cousin class CallNode::returns_pointer
 959   bool returns_pointer() const;
 960   bool returns_scalarized() const;
 961 
 962   bool guaranteed_safepoint() const { return _guaranteed_safepoint; }
 963 
 964 #ifndef PRODUCT
 965   virtual void dump_spec(outputStream *st) const;
 966 #endif
 967 };
 968 
 969 //------------------------------MachCallJavaNode------------------------------
 970 // "Base" class for machine-specific versions of subroutine calls
 971 class MachCallJavaNode : public MachCallNode {
 972 protected:
 973   virtual bool cmp( const Node &n ) const;
 974   virtual uint size_of() const; // Size is bigger
 975 public:
 976   ciMethod* _method;                 // Method being direct called
 977   bool      _override_symbolic_info; // Override symbolic call site info from bytecode
 978   bool      _optimized_virtual;      // Tells if node is a static call or an optimized virtual
 979   bool      _method_handle_invoke;   // Tells if the call has to preserve SP
 980   bool      _arg_escape;             // ArgEscape in parameter list
< prev index next >