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; }
475 dump();
476 #endif
477 ShouldNotCallThis();
478 }
479
480 virtual const RegMask &in_RegMask(uint idx) const {
481 if (idx == mach_constant_base_node_input())
482 return MachConstantBaseNode::static_out_RegMask();
483 return MachNode::in_RegMask(idx);
484 }
485
486 // Input edge of MachConstantBaseNode.
487 virtual uint mach_constant_base_node_input() const { return req() - 1; }
488
489 int constant_offset();
490 int constant_offset() const { return ((MachConstantNode*) this)->constant_offset(); }
491 // Unchecked version to avoid assertions in debug output.
492 int constant_offset_unchecked() const;
493 };
494
495 //------------------------------MachUEPNode-----------------------------------
496 // Machine Unvalidated Entry Point Node
497 class MachUEPNode : public MachIdealNode {
498 public:
499 MachUEPNode( ) {}
500 virtual void emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const;
501 virtual uint size(PhaseRegAlloc *ra_) const;
502
503 #ifndef PRODUCT
504 virtual const char *Name() const { return "Unvalidated-Entry-Point"; }
505 virtual void format( PhaseRegAlloc *, outputStream *st ) const;
506 #endif
507 };
508
509 //------------------------------MachPrologNode--------------------------------
510 // Machine function Prolog Node
511 class MachPrologNode : public MachIdealNode {
512 public:
513 MachPrologNode( ) {}
514 virtual void emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const;
515 virtual uint size(PhaseRegAlloc *ra_) const;
516 virtual int reloc() const;
517
518 #ifndef PRODUCT
519 virtual const char *Name() const { return "Prolog"; }
520 virtual void format( PhaseRegAlloc *, outputStream *st ) const;
521 #endif
522 };
523
524 //------------------------------MachEpilogNode--------------------------------
525 // Machine function Epilog Node
526 class MachEpilogNode : public MachIdealNode {
527 public:
528 MachEpilogNode(bool do_poll = false) : _do_polling(do_poll) {}
529 virtual void emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const;
530 virtual uint size(PhaseRegAlloc *ra_) const;
531 virtual int reloc() const;
532 virtual const Pipeline *pipeline() const;
533
534 private:
535 bool _do_polling;
536
537 public:
538 bool do_polling() const { return _do_polling; }
539
540 #ifndef PRODUCT
541 virtual const char *Name() const { return "Epilog"; }
542 virtual void format( PhaseRegAlloc *, outputStream *st ) const;
543 #endif
544 };
545
546 //------------------------------MachNopNode-----------------------------------
547 // Machine function Nop Node
548 class MachNopNode : public MachIdealNode {
549 private:
550 int _count;
900
901 const TypeFunc* tf() const { return _tf; }
902 address entry_point() const { return _entry_point; }
903 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 "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; }
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 //------------------------------MachVEPNode-----------------------------------
497 // Machine Inline Type Entry Point Node
498 class MachVEPNode : public MachIdealNode {
499 public:
500 Label* _verified_entry;
501
502 MachVEPNode(Label* verified_entry, bool verified, bool receiver_only) :
503 _verified_entry(verified_entry),
504 _verified(verified),
505 _receiver_only(receiver_only) {
506 init_class_id(Class_MachVEP);
507 }
508 virtual bool cmp(const Node &n) const {
509 return (_verified_entry == ((MachVEPNode&)n)._verified_entry) &&
510 (_verified == ((MachVEPNode&)n)._verified) &&
511 (_receiver_only == ((MachVEPNode&)n)._receiver_only) &&
512 MachIdealNode::cmp(n);
513 }
514 virtual uint size_of() const { return sizeof(*this); }
515 virtual void emit(C2_MacroAssembler *masm, PhaseRegAlloc* ra_) const;
516
517 #ifndef PRODUCT
518 virtual const char* Name() const { return "InlineType Entry-Point"; }
519 virtual void format(PhaseRegAlloc*, outputStream* st) const;
520 #endif
521 private:
522 bool _verified;
523 bool _receiver_only;
524 };
525
526 //------------------------------MachUEPNode-----------------------------------
527 // Machine Unvalidated Entry Point Node
528 class MachUEPNode : public MachIdealNode {
529 public:
530 MachUEPNode( ) {}
531 virtual void emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const;
532
533 #ifndef PRODUCT
534 virtual const char *Name() const { return "Unvalidated-Entry-Point"; }
535 virtual void format( PhaseRegAlloc *, outputStream *st ) const;
536 #endif
537 };
538
539 //------------------------------MachPrologNode--------------------------------
540 // Machine function Prolog Node
541 class MachPrologNode : public MachIdealNode {
542 public:
543 Label* _verified_entry;
544
545 MachPrologNode(Label* verified_entry) : _verified_entry(verified_entry) {
546 init_class_id(Class_MachProlog);
547 }
548 virtual bool cmp(const Node &n) const {
549 return (_verified_entry == ((MachPrologNode&)n)._verified_entry) && MachIdealNode::cmp(n);
550 }
551 virtual uint size_of() const { return sizeof(*this); }
552 virtual void emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const;
553 virtual int reloc() const;
554
555 #ifndef PRODUCT
556 virtual const char *Name() const { return "Prolog"; }
557 virtual void format( PhaseRegAlloc *, outputStream *st ) const;
558 #endif
559 };
560
561 //------------------------------MachEpilogNode--------------------------------
562 // Machine function Epilog Node
563 class MachEpilogNode : public MachIdealNode {
564 public:
565 MachEpilogNode(bool do_poll = false) : _do_polling(do_poll) {}
566 virtual void emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const;
567 virtual int reloc() const;
568 virtual const Pipeline *pipeline() const;
569
570 private:
571 bool _do_polling;
572
573 public:
574 bool do_polling() const { return _do_polling; }
575
576 #ifndef PRODUCT
577 virtual const char *Name() const { return "Epilog"; }
578 virtual void format( PhaseRegAlloc *, outputStream *st ) const;
579 #endif
580 };
581
582 //------------------------------MachNopNode-----------------------------------
583 // Machine function Nop Node
584 class MachNopNode : public MachIdealNode {
585 private:
586 int _count;
936
937 const TypeFunc* tf() const { return _tf; }
938 address entry_point() const { return _entry_point; }
939 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
|