66 assert((caller_tree == NULL ? 0 : caller_tree->stack_depth() + 1) == stack_depth(), "correct (redundant) depth parameter");
67 assert(caller_bci == this->caller_bci(), "correct (redundant) bci parameter");
68 // Update hierarchical counts, count_inline_bcs() and count_inlines()
69 InlineTree *caller = (InlineTree *)caller_tree;
70 for( ; caller != NULL; caller = ((InlineTree *)(caller->caller_tree())) ) {
71 caller->_count_inline_bcs += count_inline_bcs();
72 NOT_PRODUCT(caller->_count_inlines++;)
73 }
74 }
75
76 /**
77 * Return true when EA is ON and a java constructor is called or
78 * a super constructor is called from an inlined java constructor.
79 * Also return true for boxing methods.
80 */
81 static bool is_init_with_ea(ciMethod* callee_method,
82 ciMethod* caller_method, Compile* C) {
83 if (!C->do_escape_analysis() || !EliminateAllocations) {
84 return false; // EA is off
85 }
86 if (callee_method->is_initializer()) {
87 return true; // constuctor
88 }
89 if (caller_method->is_initializer() &&
90 caller_method != C->method() &&
91 caller_method->holder()->is_subclass_of(callee_method->holder())) {
92 return true; // super constructor is called from inlined constructor
93 }
94 if (C->eliminate_boxing() && callee_method->is_boxing_method()) {
95 return true;
96 }
97 return false;
98 }
99
100 /**
101 * Force inlining unboxing accessor.
102 */
103 static bool is_unboxing_method(ciMethod* callee_method, Compile* C) {
104 return C->eliminate_boxing() && callee_method->is_unboxing_method();
105 }
106
107 // positive filter: should callee be inlined?
108 bool InlineTree::should_inline(ciMethod* callee_method, ciMethod* caller_method,
109 int caller_bci, ciCallProfile& profile,
|
66 assert((caller_tree == NULL ? 0 : caller_tree->stack_depth() + 1) == stack_depth(), "correct (redundant) depth parameter");
67 assert(caller_bci == this->caller_bci(), "correct (redundant) bci parameter");
68 // Update hierarchical counts, count_inline_bcs() and count_inlines()
69 InlineTree *caller = (InlineTree *)caller_tree;
70 for( ; caller != NULL; caller = ((InlineTree *)(caller->caller_tree())) ) {
71 caller->_count_inline_bcs += count_inline_bcs();
72 NOT_PRODUCT(caller->_count_inlines++;)
73 }
74 }
75
76 /**
77 * Return true when EA is ON and a java constructor is called or
78 * a super constructor is called from an inlined java constructor.
79 * Also return true for boxing methods.
80 */
81 static bool is_init_with_ea(ciMethod* callee_method,
82 ciMethod* caller_method, Compile* C) {
83 if (!C->do_escape_analysis() || !EliminateAllocations) {
84 return false; // EA is off
85 }
86 if (callee_method->is_object_constructor()) {
87 return true; // constructor
88 }
89 if (caller_method->is_object_constructor_or_class_initializer() &&
90 caller_method != C->method() &&
91 caller_method->holder()->is_subclass_of(callee_method->holder())) {
92 return true; // super constructor is called from inlined constructor
93 }
94 if (C->eliminate_boxing() && callee_method->is_boxing_method()) {
95 return true;
96 }
97 return false;
98 }
99
100 /**
101 * Force inlining unboxing accessor.
102 */
103 static bool is_unboxing_method(ciMethod* callee_method, Compile* C) {
104 return C->eliminate_boxing() && callee_method->is_unboxing_method();
105 }
106
107 // positive filter: should callee be inlined?
108 bool InlineTree::should_inline(ciMethod* callee_method, ciMethod* caller_method,
109 int caller_bci, ciCallProfile& profile,
|