< prev index next >

src/hotspot/share/opto/machnode.hpp

Print this page

  35 
  36 class BufferBlob;
  37 class CodeBuffer;
  38 class JVMState;
  39 class MachCallDynamicJavaNode;
  40 class MachCallJavaNode;
  41 class MachCallLeafNode;
  42 class MachCallNativeNode;
  43 class MachCallNode;
  44 class MachCallRuntimeNode;
  45 class MachCallStaticJavaNode;
  46 class MachEpilogNode;
  47 class MachIfNode;
  48 class MachNullCheckNode;
  49 class MachOper;
  50 class MachProjNode;
  51 class MachPrologNode;
  52 class MachReturnNode;
  53 class MachSafePointNode;
  54 class MachSpillCopyNode;

  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

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






























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








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

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

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

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

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

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

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

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

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