53 // total execution time used at this call site.
54 const float _site_invoke_ratio;
55 const int _max_inline_level; // the maximum inline level for this sub-tree (may be adjusted)
56 float compute_callee_frequency( int caller_bci ) const;
57
58 GrowableArray<InlineTree*> _subtrees;
59
60 void print_impl(outputStream* stj, int indent) const PRODUCT_RETURN;
61
62 protected:
63 InlineTree(Compile* C,
64 const InlineTree* caller_tree,
65 ciMethod* callee_method,
66 JVMState* caller_jvms,
67 int caller_bci,
68 float site_invoke_ratio,
69 int max_inline_level);
70 InlineTree *build_inline_tree_for_callee(ciMethod* callee_method,
71 JVMState* caller_jvms,
72 int caller_bci);
73 const char* try_to_inline(ciMethod* callee_method, ciMethod* caller_method, int caller_bci, ciCallProfile& profile, WarmCallInfo* wci_result);
74 const char* should_inline(ciMethod* callee_method, ciMethod* caller_method, int caller_bci, ciCallProfile& profile, WarmCallInfo* wci_result) const;
75 const char* should_not_inline(ciMethod* callee_method, ciMethod* caller_method, WarmCallInfo* wci_result) const;
76 void print_inlining(ciMethod *callee_method, int caller_bci, const char *failure_msg) const;
77
78 InlineTree *caller_tree() const { return _caller_tree; }
79 InlineTree* callee_at(int bci, ciMethod* m) const;
80 int inline_level() const { return stack_depth(); }
81 int stack_depth() const { return _caller_jvms ? _caller_jvms->depth() : 0; }
82
83 public:
84 static const char* check_can_parse(ciMethod* callee);
85
86 static InlineTree* build_inline_tree_root();
87 static InlineTree* find_subtree_from_root(InlineTree* root, JVMState* jvms, ciMethod* callee);
88
89 // For temporary (stack-allocated, stateless) ilts:
90 InlineTree(Compile* c, ciMethod* callee_method, JVMState* caller_jvms, float site_invoke_ratio, int max_inline_level);
91
92 // InlineTree enum
93 enum InlineStyle {
94 Inline_do_not_inline = 0, //
95 Inline_cha_is_monomorphic = 1, //
96 Inline_type_profile_monomorphic = 2 //
97 };
98
99 // See if it is OK to inline.
100 // The receiver is the inline tree for the caller.
101 //
102 // The result is a temperature indication. If it is hot or cold,
103 // inlining is immediate or undesirable. Otherwise, the info block
104 // returned is newly allocated and may be enqueued.
105 //
106 // If the method is inlinable, a new inline subtree is created on the fly,
107 // and may be accessed by find_subtree_from_root.
108 // The call_method is the dest_method for a special or static invocation.
109 // The call_method is an optimized virtual method candidate otherwise.
110 WarmCallInfo* ok_to_inline(ciMethod *call_method, JVMState* caller_jvms, ciCallProfile& profile, WarmCallInfo* wci);
111
112 // Information about inlined method
113 JVMState* caller_jvms() const { return _caller_jvms; }
114 ciMethod *method() const { return _method; }
115 int caller_bci() const { return _caller_jvms ? _caller_jvms->bci() : InvocationEntryBci; }
116 uint count_inline_bcs() const { return _count_inline_bcs; }
117 float site_invoke_ratio() const { return _site_invoke_ratio; };
118
119 #ifndef PRODUCT
120 private:
121 uint _count_inlines; // Count of inlined methods
122 public:
123 // Debug information collected during parse
124 uint count_inlines() const { return _count_inlines; };
125 #endif
126 GrowableArray<InlineTree*> subtrees() { return _subtrees; }
127
128 void print_value_on(outputStream* st) const PRODUCT_RETURN;
129 };
130
|
53 // total execution time used at this call site.
54 const float _site_invoke_ratio;
55 const int _max_inline_level; // the maximum inline level for this sub-tree (may be adjusted)
56 float compute_callee_frequency( int caller_bci ) const;
57
58 GrowableArray<InlineTree*> _subtrees;
59
60 void print_impl(outputStream* stj, int indent) const PRODUCT_RETURN;
61
62 protected:
63 InlineTree(Compile* C,
64 const InlineTree* caller_tree,
65 ciMethod* callee_method,
66 JVMState* caller_jvms,
67 int caller_bci,
68 float site_invoke_ratio,
69 int max_inline_level);
70 InlineTree *build_inline_tree_for_callee(ciMethod* callee_method,
71 JVMState* caller_jvms,
72 int caller_bci);
73 const char* try_to_inline(ciMethod* callee_method, ciMethod* caller_method, int caller_bci, ciCallProfile& profile, WarmCallInfo* wci_result, bool& should_delay);
74 const char* should_inline(ciMethod* callee_method, ciMethod* caller_method, int caller_bci, ciCallProfile& profile, WarmCallInfo* wci_result) const;
75 const char* should_not_inline(ciMethod* callee_method, ciMethod* caller_method, WarmCallInfo* wci_result) const;
76 void print_inlining(ciMethod *callee_method, int caller_bci, const char *failure_msg) const;
77
78 InlineTree *caller_tree() const { return _caller_tree; }
79 InlineTree* callee_at(int bci, ciMethod* m) const;
80 int inline_level() const { return stack_depth(); }
81 int stack_depth() const { return _caller_jvms ? _caller_jvms->depth() : 0; }
82
83 public:
84 static const char* check_can_parse(ciMethod* callee);
85
86 static InlineTree* build_inline_tree_root();
87 static InlineTree* find_subtree_from_root(InlineTree* root, JVMState* jvms, ciMethod* callee);
88
89 // For temporary (stack-allocated, stateless) ilts:
90 InlineTree(Compile* c, ciMethod* callee_method, JVMState* caller_jvms, float site_invoke_ratio, int max_inline_level);
91
92 // InlineTree enum
93 enum InlineStyle {
94 Inline_do_not_inline = 0, //
95 Inline_cha_is_monomorphic = 1, //
96 Inline_type_profile_monomorphic = 2 //
97 };
98
99 // See if it is OK to inline.
100 // The receiver is the inline tree for the caller.
101 //
102 // The result is a temperature indication. If it is hot or cold,
103 // inlining is immediate or undesirable. Otherwise, the info block
104 // returned is newly allocated and may be enqueued.
105 //
106 // If the method is inlinable, a new inline subtree is created on the fly,
107 // and may be accessed by find_subtree_from_root.
108 // The call_method is the dest_method for a special or static invocation.
109 // The call_method is an optimized virtual method candidate otherwise.
110 WarmCallInfo* ok_to_inline(ciMethod *call_method, JVMState* caller_jvms, ciCallProfile& profile, WarmCallInfo* wci, bool& should_delay);
111
112 // Information about inlined method
113 JVMState* caller_jvms() const { return _caller_jvms; }
114 ciMethod *method() const { return _method; }
115 int caller_bci() const { return _caller_jvms ? _caller_jvms->bci() : InvocationEntryBci; }
116 uint count_inline_bcs() const { return _count_inline_bcs; }
117 float site_invoke_ratio() const { return _site_invoke_ratio; };
118
119 #ifndef PRODUCT
120 private:
121 uint _count_inlines; // Count of inlined methods
122 public:
123 // Debug information collected during parse
124 uint count_inlines() const { return _count_inlines; };
125 #endif
126 GrowableArray<InlineTree*> subtrees() { return _subtrees; }
127
128 void print_value_on(outputStream* st) const PRODUCT_RETURN;
129 };
130
|