20 * CA 95054 USA or visit www.sun.com if you need additional information or
21 * have any questions.
22 *
23 */
24
25 #include "incls/_precompiled.incl"
26 #include "incls/_bytecodeInfo.cpp.incl"
27
28 //=============================================================================
29 //------------------------------InlineTree-------------------------------------
30 InlineTree::InlineTree( Compile* c, const InlineTree *caller_tree, ciMethod* callee, JVMState* caller_jvms, int caller_bci, float site_invoke_ratio )
31 : C(c), _caller_jvms(caller_jvms),
32 _caller_tree((InlineTree*)caller_tree),
33 _method(callee), _site_invoke_ratio(site_invoke_ratio),
34 _count_inline_bcs(method()->code_size()) {
35 NOT_PRODUCT(_count_inlines = 0;)
36 if (_caller_jvms != NULL) {
37 // Keep a private copy of the caller_jvms:
38 _caller_jvms = new (C) JVMState(caller_jvms->method(), caller_tree->caller_jvms());
39 _caller_jvms->set_bci(caller_jvms->bci());
40 }
41 assert(_caller_jvms->same_calls_as(caller_jvms), "consistent JVMS");
42 assert((caller_tree == NULL ? 0 : caller_tree->inline_depth() + 1) == inline_depth(), "correct (redundant) depth parameter");
43 assert(caller_bci == this->caller_bci(), "correct (redundant) bci parameter");
44 if (UseOldInlining) {
45 // Update hierarchical counts, count_inline_bcs() and count_inlines()
46 InlineTree *caller = (InlineTree *)caller_tree;
47 for( ; caller != NULL; caller = ((InlineTree *)(caller->caller_tree())) ) {
48 caller->_count_inline_bcs += count_inline_bcs();
49 NOT_PRODUCT(caller->_count_inlines++;)
50 }
51 }
52 }
53
54 InlineTree::InlineTree(Compile* c, ciMethod* callee_method, JVMState* caller_jvms, float site_invoke_ratio)
55 : C(c), _caller_jvms(caller_jvms), _caller_tree(NULL),
56 _method(callee_method), _site_invoke_ratio(site_invoke_ratio),
57 _count_inline_bcs(method()->code_size()) {
58 NOT_PRODUCT(_count_inlines = 0;)
59 assert(!UseOldInlining, "do not use for old stuff");
|
20 * CA 95054 USA or visit www.sun.com if you need additional information or
21 * have any questions.
22 *
23 */
24
25 #include "incls/_precompiled.incl"
26 #include "incls/_bytecodeInfo.cpp.incl"
27
28 //=============================================================================
29 //------------------------------InlineTree-------------------------------------
30 InlineTree::InlineTree( Compile* c, const InlineTree *caller_tree, ciMethod* callee, JVMState* caller_jvms, int caller_bci, float site_invoke_ratio )
31 : C(c), _caller_jvms(caller_jvms),
32 _caller_tree((InlineTree*)caller_tree),
33 _method(callee), _site_invoke_ratio(site_invoke_ratio),
34 _count_inline_bcs(method()->code_size()) {
35 NOT_PRODUCT(_count_inlines = 0;)
36 if (_caller_jvms != NULL) {
37 // Keep a private copy of the caller_jvms:
38 _caller_jvms = new (C) JVMState(caller_jvms->method(), caller_tree->caller_jvms());
39 _caller_jvms->set_bci(caller_jvms->bci());
40 assert(!caller_jvms->is_restart(), "there should be no restart bytecode with inlining");
41 }
42 assert(_caller_jvms->same_calls_as(caller_jvms), "consistent JVMS");
43 assert((caller_tree == NULL ? 0 : caller_tree->inline_depth() + 1) == inline_depth(), "correct (redundant) depth parameter");
44 assert(caller_bci == this->caller_bci(), "correct (redundant) bci parameter");
45 if (UseOldInlining) {
46 // Update hierarchical counts, count_inline_bcs() and count_inlines()
47 InlineTree *caller = (InlineTree *)caller_tree;
48 for( ; caller != NULL; caller = ((InlineTree *)(caller->caller_tree())) ) {
49 caller->_count_inline_bcs += count_inline_bcs();
50 NOT_PRODUCT(caller->_count_inlines++;)
51 }
52 }
53 }
54
55 InlineTree::InlineTree(Compile* c, ciMethod* callee_method, JVMState* caller_jvms, float site_invoke_ratio)
56 : C(c), _caller_jvms(caller_jvms), _caller_tree(NULL),
57 _method(callee_method), _site_invoke_ratio(site_invoke_ratio),
58 _count_inline_bcs(method()->code_size()) {
59 NOT_PRODUCT(_count_inlines = 0;)
60 assert(!UseOldInlining, "do not use for old stuff");
|