< 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

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






























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








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

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

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

 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 //------------------------------MachVEPNode-----------------------------------
 498 // Machine Inline Type Entry Point Node
 499 class MachVEPNode : public MachIdealNode {
 500 public:
 501   Label* _verified_entry;
 502 
 503   MachVEPNode(Label* verified_entry, bool verified, bool receiver_only) :
 504     _verified_entry(verified_entry),
 505     _verified(verified),
 506     _receiver_only(receiver_only) {
 507     init_class_id(Class_MachVEP);
 508   }
 509   virtual bool cmp(const Node &n) const {
 510     return (_verified_entry == ((MachVEPNode&)n)._verified_entry) &&
 511            (_verified == ((MachVEPNode&)n)._verified) &&
 512            (_receiver_only == ((MachVEPNode&)n)._receiver_only) &&
 513            MachIdealNode::cmp(n);
 514   }
 515   virtual uint size_of() const { return sizeof(*this); }
 516   virtual void emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const;
 517 
 518 #ifndef PRODUCT
 519   virtual const char* Name() const { return "InlineType Entry-Point"; }
 520   virtual void format(PhaseRegAlloc*, outputStream* st) const;
 521 #endif
 522 private:
 523   bool   _verified;
 524   bool   _receiver_only;
 525 };
 526 
 527 //------------------------------MachUEPNode-----------------------------------
 528 // Machine Unvalidated Entry Point Node
 529 class MachUEPNode : public MachIdealNode {
 530 public:
 531   MachUEPNode( ) {}
 532   virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const;

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

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

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

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