34 #include "opto/regmask.hpp"
35 #include "utilities/growableArray.hpp"
36
37 class BufferBlob;
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 State;
58
59 //---------------------------MachOper------------------------------------------
60 class MachOper : public ResourceObj {
61 public:
62 // Allocate right next to the MachNodes in the same arena
63 void *operator new(size_t x) throw() {
64 Compile* C = Compile::current();
65 return C->node_arena()->AmallocWords(x);
66 }
67
68 // Opcode
69 virtual uint opcode() const = 0;
70
71 // Number of input edges.
72 // Generally at least 1
73 virtual uint num_edges() const { return 1; }
484 dump();
485 #endif
486 ShouldNotCallThis();
487 }
488
489 virtual const RegMask &in_RegMask(uint idx) const {
490 if (idx == mach_constant_base_node_input())
491 return MachConstantBaseNode::static_out_RegMask();
492 return MachNode::in_RegMask(idx);
493 }
494
495 // Input edge of MachConstantBaseNode.
496 virtual uint mach_constant_base_node_input() const { return req() - 1; }
497
498 int constant_offset();
499 int constant_offset() const { return ((MachConstantNode*) this)->constant_offset(); }
500 // Unchecked version to avoid assertions in debug output.
501 int constant_offset_unchecked() const;
502 };
503
504 //------------------------------MachUEPNode-----------------------------------
505 // Machine Unvalidated Entry Point Node
506 class MachUEPNode : public MachIdealNode {
507 public:
508 MachUEPNode( ) {}
509 virtual void emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const;
510 virtual uint size(PhaseRegAlloc *ra_) const;
511
512 #ifndef PRODUCT
513 virtual const char *Name() const { return "Unvalidated-Entry-Point"; }
514 virtual void format( PhaseRegAlloc *, outputStream *st ) const;
515 #endif
516 };
517
518 //------------------------------MachPrologNode--------------------------------
519 // Machine function Prolog Node
520 class MachPrologNode : public MachIdealNode {
521 public:
522 MachPrologNode( ) {}
523 virtual void emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const;
524 virtual uint size(PhaseRegAlloc *ra_) const;
525 virtual int reloc() const;
526
527 #ifndef PRODUCT
528 virtual const char *Name() const { return "Prolog"; }
529 virtual void format( PhaseRegAlloc *, outputStream *st ) const;
530 #endif
531 };
532
533 //------------------------------MachEpilogNode--------------------------------
534 // Machine function Epilog Node
535 class MachEpilogNode : public MachIdealNode {
536 public:
537 MachEpilogNode(bool do_poll = false) : _do_polling(do_poll) {}
538 virtual void emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const;
539 virtual uint size(PhaseRegAlloc *ra_) const;
540 virtual int reloc() const;
541 virtual const Pipeline *pipeline() const;
542
543 private:
544 bool _do_polling;
545
546 public:
547 bool do_polling() const { return _do_polling; }
548
549 #ifndef PRODUCT
550 virtual const char *Name() const { return "Epilog"; }
551 virtual void format( PhaseRegAlloc *, outputStream *st ) const;
552 #endif
553 };
554
555 //------------------------------MachNopNode-----------------------------------
556 // Machine function Nop Node
557 class MachNopNode : public MachIdealNode {
558 private:
559 int _count;
909
910 const TypeFunc* tf() const { return _tf; }
911 address entry_point() const { return _entry_point; }
912 float cnt() const { return _cnt; }
913
914 void set_tf(const TypeFunc* tf) { _tf = tf; }
915 void set_entry_point(address p) { _entry_point = p; }
916 void set_cnt(float c) { _cnt = c; }
917 void set_guaranteed_safepoint(bool b) { _guaranteed_safepoint = b; }
918
919 MachCallNode() : MachSafePointNode() {
920 init_class_id(Class_MachCall);
921 }
922
923 virtual const Type *bottom_type() const;
924 virtual bool pinned() const { return false; }
925 virtual const Type* Value(PhaseGVN* phase) const;
926 virtual const RegMask &in_RegMask(uint) const;
927 virtual int ret_addr_offset() { return 0; }
928
929 NOT_LP64(bool return_value_is_used() const;)
930
931 // Similar to cousin class CallNode::returns_pointer
932 bool returns_pointer() const;
933
934 bool guaranteed_safepoint() const { return _guaranteed_safepoint; }
935
936 #ifndef PRODUCT
937 virtual void dump_spec(outputStream *st) const;
938 #endif
939 };
940
941 //------------------------------MachCallJavaNode------------------------------
942 // "Base" class for machine-specific versions of subroutine calls
943 class MachCallJavaNode : public MachCallNode {
944 protected:
945 virtual bool cmp( const Node &n ) const;
946 virtual uint size_of() const; // Size is bigger
947 public:
948 ciMethod* _method; // Method being direct called
949 bool _override_symbolic_info; // Override symbolic call site info from bytecode
950 bool _optimized_virtual; // Tells if node is a static call or an optimized virtual
951 bool _method_handle_invoke; // Tells if the call has to preserve SP
952 bool _arg_escape; // ArgEscape in parameter list
|
34 #include "opto/regmask.hpp"
35 #include "utilities/growableArray.hpp"
36
37 class BufferBlob;
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 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
74 virtual uint num_edges() const { return 1; }
485 dump();
486 #endif
487 ShouldNotCallThis();
488 }
489
490 virtual const RegMask &in_RegMask(uint idx) const {
491 if (idx == mach_constant_base_node_input())
492 return MachConstantBaseNode::static_out_RegMask();
493 return MachNode::in_RegMask(idx);
494 }
495
496 // Input edge of MachConstantBaseNode.
497 virtual uint mach_constant_base_node_input() const { return req() - 1; }
498
499 int constant_offset();
500 int constant_offset() const { return ((MachConstantNode*) this)->constant_offset(); }
501 // Unchecked version to avoid assertions in debug output.
502 int constant_offset_unchecked() const;
503 };
504
505 //------------------------------MachVEPNode-----------------------------------
506 // Machine Inline Type Entry Point Node
507 class MachVEPNode : public MachIdealNode {
508 public:
509 Label* _verified_entry;
510
511 MachVEPNode(Label* verified_entry, bool verified, bool receiver_only) :
512 _verified_entry(verified_entry),
513 _verified(verified),
514 _receiver_only(receiver_only) {
515 init_class_id(Class_MachVEP);
516 }
517 virtual bool cmp(const Node &n) const {
518 return (_verified_entry == ((MachVEPNode&)n)._verified_entry) &&
519 (_verified == ((MachVEPNode&)n)._verified) &&
520 (_receiver_only == ((MachVEPNode&)n)._receiver_only) &&
521 MachIdealNode::cmp(n);
522 }
523 virtual uint size_of() const { return sizeof(*this); }
524 virtual void emit(C2_MacroAssembler *masm, PhaseRegAlloc* ra_) const;
525
526 #ifndef PRODUCT
527 virtual const char* Name() const { return "InlineType Entry-Point"; }
528 virtual void format(PhaseRegAlloc*, outputStream* st) const;
529 #endif
530 private:
531 bool _verified;
532 bool _receiver_only;
533 };
534
535 //------------------------------MachUEPNode-----------------------------------
536 // Machine Unvalidated Entry Point Node
537 class MachUEPNode : public MachIdealNode {
538 public:
539 MachUEPNode( ) {}
540 virtual void emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const;
541
542 #ifndef PRODUCT
543 virtual const char *Name() const { return "Unvalidated-Entry-Point"; }
544 virtual void format( PhaseRegAlloc *, outputStream *st ) const;
545 #endif
546 };
547
548 //------------------------------MachPrologNode--------------------------------
549 // Machine function Prolog Node
550 class MachPrologNode : public MachIdealNode {
551 public:
552 Label* _verified_entry;
553
554 MachPrologNode(Label* verified_entry) : _verified_entry(verified_entry) {
555 init_class_id(Class_MachProlog);
556 }
557 virtual bool cmp(const Node &n) const {
558 return (_verified_entry == ((MachPrologNode&)n)._verified_entry) && MachIdealNode::cmp(n);
559 }
560 virtual uint size_of() const { return sizeof(*this); }
561 virtual void emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const;
562 virtual int reloc() const;
563
564 #ifndef PRODUCT
565 virtual const char *Name() const { return "Prolog"; }
566 virtual void format( PhaseRegAlloc *, outputStream *st ) const;
567 #endif
568 };
569
570 //------------------------------MachEpilogNode--------------------------------
571 // Machine function Epilog Node
572 class MachEpilogNode : public MachIdealNode {
573 public:
574 MachEpilogNode(bool do_poll = false) : _do_polling(do_poll) {}
575 virtual void emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const;
576 virtual int reloc() const;
577 virtual const Pipeline *pipeline() const;
578
579 private:
580 bool _do_polling;
581
582 public:
583 bool do_polling() const { return _do_polling; }
584
585 #ifndef PRODUCT
586 virtual const char *Name() const { return "Epilog"; }
587 virtual void format( PhaseRegAlloc *, outputStream *st ) const;
588 #endif
589 };
590
591 //------------------------------MachNopNode-----------------------------------
592 // Machine function Nop Node
593 class MachNopNode : public MachIdealNode {
594 private:
595 int _count;
945
946 const TypeFunc* tf() const { return _tf; }
947 address entry_point() const { return _entry_point; }
948 float cnt() const { return _cnt; }
949
950 void set_tf(const TypeFunc* tf) { _tf = tf; }
951 void set_entry_point(address p) { _entry_point = p; }
952 void set_cnt(float c) { _cnt = c; }
953 void set_guaranteed_safepoint(bool b) { _guaranteed_safepoint = b; }
954
955 MachCallNode() : MachSafePointNode() {
956 init_class_id(Class_MachCall);
957 }
958
959 virtual const Type *bottom_type() const;
960 virtual bool pinned() const { return false; }
961 virtual const Type* Value(PhaseGVN* phase) const;
962 virtual const RegMask &in_RegMask(uint) const;
963 virtual int ret_addr_offset() { return 0; }
964
965 bool return_value_is_used() const;
966
967 // Similar to cousin class CallNode::returns_pointer
968 bool returns_pointer() const;
969 bool returns_scalarized() const;
970
971 bool guaranteed_safepoint() const { return _guaranteed_safepoint; }
972
973 #ifndef PRODUCT
974 virtual void dump_spec(outputStream *st) const;
975 #endif
976 };
977
978 //------------------------------MachCallJavaNode------------------------------
979 // "Base" class for machine-specific versions of subroutine calls
980 class MachCallJavaNode : public MachCallNode {
981 protected:
982 virtual bool cmp( const Node &n ) const;
983 virtual uint size_of() const; // Size is bigger
984 public:
985 ciMethod* _method; // Method being direct called
986 bool _override_symbolic_info; // Override symbolic call site info from bytecode
987 bool _optimized_virtual; // Tells if node is a static call or an optimized virtual
988 bool _method_handle_invoke; // Tells if the call has to preserve SP
989 bool _arg_escape; // ArgEscape in parameter list
|