author | lmesnik |
Fri, 07 Jun 2019 12:26:50 -0700 | |
changeset 55294 | 3493c1bc59fd |
parent 55206 | 2fe2063fe567 |
child 59056 | 15936b142f86 |
permissions | -rw-r--r-- |
32582
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
1 |
/* |
54150
5529640c5f67
8220512: Deoptimize redefinition functions that have dirty ICs
coleenp
parents:
54067
diff
changeset
|
2 |
* Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved. |
32582
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
4 |
* |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
8 |
* |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
13 |
* accompanied this code). |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
14 |
* |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
18 |
* |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
21 |
* questions. |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
22 |
* |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
23 |
*/ |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
24 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
25 |
#include "precompiled.hpp" |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
26 |
#include "compiler/compileTask.hpp" |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
27 |
#include "compiler/compileLog.hpp" |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
28 |
#include "compiler/compileBroker.hpp" |
33451
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
33160
diff
changeset
|
29 |
#include "compiler/compilerDirectives.hpp" |
46701
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46271
diff
changeset
|
30 |
#include "logging/log.hpp" |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46271
diff
changeset
|
31 |
#include "logging/logStream.hpp" |
37248 | 32 |
#include "memory/resourceArea.hpp" |
49480
d7df2dd501ce
8199809: Don't include frame.inline.hpp and other.inline.hpp from .hpp files
coleenp
parents:
47216
diff
changeset
|
33 |
#include "runtime/handles.inline.hpp" |
32582
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
34 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
35 |
CompileTask* CompileTask::_task_free_list = NULL; |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
36 |
#ifdef ASSERT |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
37 |
int CompileTask::_num_allocated_tasks = 0; |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
38 |
#endif |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
39 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
40 |
/** |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
41 |
* Allocate a CompileTask, from the free list if possible. |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
42 |
*/ |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
43 |
CompileTask* CompileTask::allocate() { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
44 |
MutexLocker locker(CompileTaskAlloc_lock); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
45 |
CompileTask* task = NULL; |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
46 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
47 |
if (_task_free_list != NULL) { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
48 |
task = _task_free_list; |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
49 |
_task_free_list = task->next(); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
50 |
task->set_next(NULL); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
51 |
} else { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
52 |
task = new CompileTask(); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
53 |
DEBUG_ONLY(_num_allocated_tasks++;) |
34197
bef14f844171
8143151: [JVMCI] assertion for allocation of "too many" CompileTasks must take JVMCI into account
twisti
parents:
34196
diff
changeset
|
54 |
assert (WhiteBoxAPI || JVMCI_ONLY(UseJVMCICompiler ||) _num_allocated_tasks < 10000, "Leaking compilation tasks?"); |
32582
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
55 |
task->set_next(NULL); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
56 |
task->set_is_free(true); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
57 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
58 |
assert(task->is_free(), "Task must be free."); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
59 |
task->set_is_free(false); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
60 |
return task; |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
61 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
62 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
63 |
/** |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
64 |
* Add a task to the free list. |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
65 |
*/ |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
66 |
void CompileTask::free(CompileTask* task) { |
54015
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
67 |
MutexLocker locker(CompileTaskAlloc_lock); |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
68 |
if (!task->is_free()) { |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
69 |
task->set_code(NULL); |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
70 |
assert(!task->lock()->is_locked(), "Should not be locked when freed"); |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
71 |
if ((task->_method_holder != NULL && JNIHandles::is_weak_global_handle(task->_method_holder)) || |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
72 |
(task->_hot_method_holder != NULL && JNIHandles::is_weak_global_handle(task->_hot_method_holder))) { |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
73 |
JNIHandles::destroy_weak_global(task->_method_holder); |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
74 |
JNIHandles::destroy_weak_global(task->_hot_method_holder); |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
75 |
} else { |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
76 |
JNIHandles::destroy_global(task->_method_holder); |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
77 |
JNIHandles::destroy_global(task->_hot_method_holder); |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
78 |
} |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
79 |
if (task->_failure_reason_on_C_heap && task->_failure_reason != NULL) { |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
80 |
os::free((void*) task->_failure_reason); |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
81 |
} |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
82 |
task->_failure_reason = NULL; |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
83 |
task->_failure_reason_on_C_heap = false; |
32582
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
84 |
|
54015
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
85 |
task->set_is_free(true); |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
86 |
task->set_next(_task_free_list); |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
87 |
_task_free_list = task; |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
88 |
} |
32582
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
89 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
90 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
91 |
void CompileTask::initialize(int compile_id, |
33593
60764a78fa5c
8140274: methodHandles and constantPoolHandles should be passed as const references
coleenp
parents:
33160
diff
changeset
|
92 |
const methodHandle& method, |
32582
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
93 |
int osr_bci, |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
94 |
int comp_level, |
33593
60764a78fa5c
8140274: methodHandles and constantPoolHandles should be passed as const references
coleenp
parents:
33160
diff
changeset
|
95 |
const methodHandle& hot_method, |
32582
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
96 |
int hot_count, |
38218 | 97 |
CompileTask::CompileReason compile_reason, |
32582
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
98 |
bool is_blocking) { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
99 |
assert(!_lock->is_locked(), "bad locking"); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
100 |
|
46271
979ebd346ecf
8169881: Remove implicit Handle conversions oop->Handle
coleenp
parents:
42650
diff
changeset
|
101 |
Thread* thread = Thread::current(); |
32582
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
102 |
_compile_id = compile_id; |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
103 |
_method = method(); |
54015
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
104 |
_method_holder = JNIHandles::make_weak_global(Handle(thread, method->method_holder()->klass_holder())); |
32582
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
105 |
_osr_bci = osr_bci; |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
106 |
_is_blocking = is_blocking; |
34196
72152eea3d39
8141330: [JVMCI] avoid deadlock between application thread and JVMCI compiler thread under -Xbatch
twisti
parents:
33626
diff
changeset
|
107 |
JVMCI_ONLY(_has_waiter = CompileBroker::compiler(comp_level)->is_jvmci();) |
35547
0ee84aa8e705
8146705: Improve JVMCI support for blocking compilation
dnsimon
parents:
34197
diff
changeset
|
108 |
JVMCI_ONLY(_jvmci_compiler_thread = NULL;) |
32582
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
109 |
_comp_level = comp_level; |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
110 |
_num_inlined_bytecodes = 0; |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
111 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
112 |
_is_complete = false; |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
113 |
_is_success = false; |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
114 |
_code_handle = NULL; |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
115 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
116 |
_hot_method = NULL; |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
117 |
_hot_method_holder = NULL; |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
118 |
_hot_count = hot_count; |
54015
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
119 |
_time_queued = os::elapsed_counter(); |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
120 |
_time_started = 0; |
38218 | 121 |
_compile_reason = compile_reason; |
32582
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
122 |
_failure_reason = NULL; |
53417
126c5e7b97b1
8217445: [JVMCI] incorrect management of JVMCI compilation failure reason string
dnsimon
parents:
49480
diff
changeset
|
123 |
_failure_reason_on_C_heap = false; |
32582
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
124 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
125 |
if (LogCompilation) { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
126 |
if (hot_method.not_null()) { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
127 |
if (hot_method == method) { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
128 |
_hot_method = _method; |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
129 |
} else { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
130 |
_hot_method = hot_method(); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
131 |
// only add loader or mirror if different from _method_holder |
54015
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
132 |
_hot_method_holder = JNIHandles::make_weak_global(Handle(thread, hot_method->method_holder()->klass_holder())); |
32582
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
133 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
134 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
135 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
136 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
137 |
_next = NULL; |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
138 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
139 |
|
37281
c4e7456d6ae1
8144964: JVMCI compilations need to be disabled until the module system is initialized
twisti
parents:
35547
diff
changeset
|
140 |
/** |
c4e7456d6ae1
8144964: JVMCI compilations need to be disabled until the module system is initialized
twisti
parents:
35547
diff
changeset
|
141 |
* Returns the compiler for this task. |
c4e7456d6ae1
8144964: JVMCI compilations need to be disabled until the module system is initialized
twisti
parents:
35547
diff
changeset
|
142 |
*/ |
c4e7456d6ae1
8144964: JVMCI compilations need to be disabled until the module system is initialized
twisti
parents:
35547
diff
changeset
|
143 |
AbstractCompiler* CompileTask::compiler() { |
c4e7456d6ae1
8144964: JVMCI compilations need to be disabled until the module system is initialized
twisti
parents:
35547
diff
changeset
|
144 |
return CompileBroker::compiler(_comp_level); |
c4e7456d6ae1
8144964: JVMCI compilations need to be disabled until the module system is initialized
twisti
parents:
35547
diff
changeset
|
145 |
} |
c4e7456d6ae1
8144964: JVMCI compilations need to be disabled until the module system is initialized
twisti
parents:
35547
diff
changeset
|
146 |
|
54015
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
147 |
// Replace weak handles by strong handles to avoid unloading during compilation. |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
148 |
CompileTask* CompileTask::select_for_compilation() { |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
149 |
if (is_unloaded()) { |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
150 |
// Guard against concurrent class unloading |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
151 |
return NULL; |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
152 |
} |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
153 |
Thread* thread = Thread::current(); |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
154 |
assert(_method->method_holder()->is_loader_alive(), "should be alive"); |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
155 |
Handle method_holder(thread, _method->method_holder()->klass_holder()); |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
156 |
JNIHandles::destroy_weak_global(_method_holder); |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
157 |
JNIHandles::destroy_weak_global(_hot_method_holder); |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
158 |
_method_holder = JNIHandles::make_global(method_holder); |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
159 |
if (_hot_method != NULL) { |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
160 |
_hot_method_holder = JNIHandles::make_global(Handle(thread, _hot_method->method_holder()->klass_holder())); |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
161 |
} |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
162 |
return this; |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
163 |
} |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
164 |
|
32582
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
165 |
// ------------------------------------------------------------------ |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
166 |
// CompileTask::code/set_code |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
167 |
// |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
168 |
nmethod* CompileTask::code() const { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
169 |
if (_code_handle == NULL) return NULL; |
38133
78b95467b9f1
8151956: Support non-continuous CodeBlobs in HotSpot
rbackman
parents:
37296
diff
changeset
|
170 |
CodeBlob *blob = _code_handle->code(); |
78b95467b9f1
8151956: Support non-continuous CodeBlobs in HotSpot
rbackman
parents:
37296
diff
changeset
|
171 |
if (blob != NULL) { |
78b95467b9f1
8151956: Support non-continuous CodeBlobs in HotSpot
rbackman
parents:
37296
diff
changeset
|
172 |
return blob->as_nmethod(); |
78b95467b9f1
8151956: Support non-continuous CodeBlobs in HotSpot
rbackman
parents:
37296
diff
changeset
|
173 |
} |
78b95467b9f1
8151956: Support non-continuous CodeBlobs in HotSpot
rbackman
parents:
37296
diff
changeset
|
174 |
return NULL; |
32582
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
175 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
176 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
177 |
void CompileTask::set_code(nmethod* nm) { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
178 |
if (_code_handle == NULL && nm == NULL) return; |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
179 |
guarantee(_code_handle != NULL, ""); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
180 |
_code_handle->set_code(nm); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
181 |
if (nm == NULL) _code_handle = NULL; // drop the handle also |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
182 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
183 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
184 |
void CompileTask::mark_on_stack() { |
54067
94d1e2c8fe01
8220341: Class redefinition fails with assert(!is_unloaded()) failed: unloaded method on the stack
thartmann
parents:
54015
diff
changeset
|
185 |
if (is_unloaded()) { |
94d1e2c8fe01
8220341: Class redefinition fails with assert(!is_unloaded()) failed: unloaded method on the stack
thartmann
parents:
54015
diff
changeset
|
186 |
return; |
94d1e2c8fe01
8220341: Class redefinition fails with assert(!is_unloaded()) failed: unloaded method on the stack
thartmann
parents:
54015
diff
changeset
|
187 |
} |
32582
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
188 |
// Mark these methods as something redefine classes cannot remove. |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
189 |
_method->set_on_stack(true); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
190 |
if (_hot_method != NULL) { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
191 |
_hot_method->set_on_stack(true); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
192 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
193 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
194 |
|
54015
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
195 |
bool CompileTask::is_unloaded() const { |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
196 |
return _method_holder != NULL && JNIHandles::is_weak_global_handle(_method_holder) && JNIHandles::is_global_weak_cleared(_method_holder); |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
197 |
} |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
198 |
|
32582
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
199 |
// RedefineClasses support |
54150
5529640c5f67
8220512: Deoptimize redefinition functions that have dirty ICs
coleenp
parents:
54067
diff
changeset
|
200 |
void CompileTask::metadata_do(MetadataClosure* f) { |
54015
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
201 |
if (is_unloaded()) { |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
202 |
return; |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
203 |
} |
54150
5529640c5f67
8220512: Deoptimize redefinition functions that have dirty ICs
coleenp
parents:
54067
diff
changeset
|
204 |
f->do_metadata(method()); |
32582
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
205 |
if (hot_method() != NULL && hot_method() != method()) { |
54150
5529640c5f67
8220512: Deoptimize redefinition functions that have dirty ICs
coleenp
parents:
54067
diff
changeset
|
206 |
f->do_metadata(hot_method()); |
32582
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
207 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
208 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
209 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
210 |
// ------------------------------------------------------------------ |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
211 |
// CompileTask::print_line_on_error |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
212 |
// |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
213 |
// This function is called by fatal error handler when the thread |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
214 |
// causing troubles is a compiler thread. |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
215 |
// |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
216 |
// Do not grab any lock, do not allocate memory. |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
217 |
// |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
218 |
// Otherwise it's the same as CompileTask::print_line() |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
219 |
// |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
220 |
void CompileTask::print_line_on_error(outputStream* st, char* buf, int buflen) { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
221 |
// print compiler name |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
222 |
st->print("%s:", CompileBroker::compiler_name(comp_level())); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
223 |
print(st); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
224 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
225 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
226 |
// ------------------------------------------------------------------ |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
227 |
// CompileTask::print_tty |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
228 |
void CompileTask::print_tty() { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
229 |
ttyLocker ttyl; // keep the following output all in one block |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
230 |
// print compiler name if requested |
40084 | 231 |
if (CIPrintCompilerName) { |
232 |
tty->print("%s:", CompileBroker::compiler_name(comp_level())); |
|
233 |
} |
|
234 |
print(tty); |
|
32582
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
235 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
236 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
237 |
// ------------------------------------------------------------------ |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
238 |
// CompileTask::print_impl |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
239 |
void CompileTask::print_impl(outputStream* st, Method* method, int compile_id, int comp_level, |
54015
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
240 |
bool is_osr_method, int osr_bci, bool is_blocking, |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
241 |
const char* msg, bool short_form, bool cr, |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
242 |
jlong time_queued, jlong time_started) { |
32582
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
243 |
if (!short_form) { |
54015
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
244 |
// Print current time |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
245 |
st->print("%7d ", (int)st->time_stamp().milliseconds()); |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
246 |
if (Verbose && time_queued != 0) { |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
247 |
// Print time in queue and time being processed by compiler thread |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
248 |
jlong now = os::elapsed_counter(); |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
249 |
st->print("%d ", (int)TimeHelper::counter_to_millis(now-time_queued)); |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
250 |
if (time_started != 0) { |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
251 |
st->print("%d ", (int)TimeHelper::counter_to_millis(now-time_started)); |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
252 |
} |
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
253 |
} |
32582
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
254 |
} |
33160
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
32582
diff
changeset
|
255 |
// print compiler name if requested |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
32582
diff
changeset
|
256 |
if (CIPrintCompilerName) { |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
32582
diff
changeset
|
257 |
st->print("%s:", CompileBroker::compiler_name(comp_level)); |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
32582
diff
changeset
|
258 |
} |
32582
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
259 |
st->print("%4d ", compile_id); // print compilation number |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
260 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
261 |
// For unloaded methods the transition to zombie occurs after the |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
262 |
// method is cleared so it's impossible to report accurate |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
263 |
// information for that case. |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
264 |
bool is_synchronized = false; |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
265 |
bool has_exception_handler = false; |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
266 |
bool is_native = false; |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
267 |
if (method != NULL) { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
268 |
is_synchronized = method->is_synchronized(); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
269 |
has_exception_handler = method->has_exception_handler(); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
270 |
is_native = method->is_native(); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
271 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
272 |
// method attributes |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
273 |
const char compile_type = is_osr_method ? '%' : ' '; |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
274 |
const char sync_char = is_synchronized ? 's' : ' '; |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
275 |
const char exception_char = has_exception_handler ? '!' : ' '; |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
276 |
const char blocking_char = is_blocking ? 'b' : ' '; |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
277 |
const char native_char = is_native ? 'n' : ' '; |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
278 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
279 |
// print method attributes |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
280 |
st->print("%c%c%c%c%c ", compile_type, sync_char, exception_char, blocking_char, native_char); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
281 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
282 |
if (TieredCompilation) { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
283 |
if (comp_level != -1) st->print("%d ", comp_level); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
284 |
else st->print("- "); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
285 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
286 |
st->print(" "); // more indent |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
287 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
288 |
if (method == NULL) { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
289 |
st->print("(method)"); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
290 |
} else { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
291 |
method->print_short_name(st); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
292 |
if (is_osr_method) { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
293 |
st->print(" @ %d", osr_bci); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
294 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
295 |
if (method->is_native()) |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
296 |
st->print(" (native)"); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
297 |
else |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
298 |
st->print(" (%d bytes)", method->code_size()); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
299 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
300 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
301 |
if (msg != NULL) { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
302 |
st->print(" %s", msg); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
303 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
304 |
if (cr) { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
305 |
st->cr(); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
306 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
307 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
308 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
309 |
void CompileTask::print_inline_indent(int inline_level, outputStream* st) { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
310 |
// 1234567 |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
311 |
st->print(" "); // print timestamp |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
312 |
// 1234 |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
313 |
st->print(" "); // print compilation number |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
314 |
// %s!bn |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
315 |
st->print(" "); // print method attributes |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
316 |
if (TieredCompilation) { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
317 |
st->print(" "); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
318 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
319 |
st->print(" "); // more indent |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
320 |
st->print(" "); // initial inlining indent |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
321 |
for (int i = 0; i < inline_level; i++) st->print(" "); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
322 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
323 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
324 |
// ------------------------------------------------------------------ |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
325 |
// CompileTask::print_compilation |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
326 |
void CompileTask::print(outputStream* st, const char* msg, bool short_form, bool cr) { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
327 |
bool is_osr_method = osr_bci() != InvocationEntryBci; |
54015
cd701366fcf8
8163511: Allocation of compile task fails with assert: "Leaking compilation tasks?"
thartmann
parents:
53417
diff
changeset
|
328 |
print_impl(st, is_unloaded() ? NULL : method(), compile_id(), comp_level(), is_osr_method, osr_bci(), is_blocking(), msg, short_form, cr, _time_queued, _time_started); |
32582
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
329 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
330 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
331 |
// ------------------------------------------------------------------ |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
332 |
// CompileTask::log_task |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
333 |
void CompileTask::log_task(xmlStream* log) { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
334 |
Thread* thread = Thread::current(); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
335 |
methodHandle method(thread, this->method()); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
336 |
ResourceMark rm(thread); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
337 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
338 |
// <task id='9' method='M' osr_bci='X' level='1' blocking='1' stamp='1.234'> |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
339 |
log->print(" compile_id='%d'", _compile_id); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
340 |
if (_osr_bci != CompileBroker::standard_entry_bci) { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
341 |
log->print(" compile_kind='osr'"); // same as nmethod::compile_kind |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
342 |
} // else compile_kind='c2c' |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
343 |
if (!method.is_null()) log->method(method); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
344 |
if (_osr_bci != CompileBroker::standard_entry_bci) { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
345 |
log->print(" osr_bci='%d'", _osr_bci); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
346 |
} |
42650 | 347 |
if (_comp_level != CompLevel_highest_tier) { |
32582
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
348 |
log->print(" level='%d'", _comp_level); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
349 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
350 |
if (_is_blocking) { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
351 |
log->print(" blocking='1'"); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
352 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
353 |
log->stamp(); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
354 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
355 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
356 |
// ------------------------------------------------------------------ |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
357 |
// CompileTask::log_task_queued |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
358 |
void CompileTask::log_task_queued() { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
359 |
Thread* thread = Thread::current(); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
360 |
ttyLocker ttyl; |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
361 |
ResourceMark rm(thread); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
362 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
363 |
xtty->begin_elem("task_queued"); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
364 |
log_task(xtty); |
38218 | 365 |
assert(_compile_reason > CompileTask::Reason_None && _compile_reason < CompileTask::Reason_Count, "Valid values"); |
366 |
xtty->print(" comment='%s'", reason_name(_compile_reason)); |
|
367 |
||
32582
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
368 |
if (_hot_method != NULL) { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
369 |
methodHandle hot(thread, _hot_method); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
370 |
methodHandle method(thread, _method); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
371 |
if (hot() != method()) { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
372 |
xtty->method(hot); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
373 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
374 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
375 |
if (_hot_count != 0) { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
376 |
xtty->print(" hot_count='%d'", _hot_count); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
377 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
378 |
xtty->end_elem(); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
379 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
380 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
381 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
382 |
// ------------------------------------------------------------------ |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
383 |
// CompileTask::log_task_start |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
384 |
void CompileTask::log_task_start(CompileLog* log) { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
385 |
log->begin_head("task"); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
386 |
log_task(log); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
387 |
log->end_head(); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
388 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
389 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
390 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
391 |
// ------------------------------------------------------------------ |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
392 |
// CompileTask::log_task_done |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
393 |
void CompileTask::log_task_done(CompileLog* log) { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
394 |
Thread* thread = Thread::current(); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
395 |
methodHandle method(thread, this->method()); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
396 |
ResourceMark rm(thread); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
397 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
398 |
if (!_is_success) { |
54669
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
54150
diff
changeset
|
399 |
assert(_failure_reason != NULL, "missing"); |
32582
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
400 |
const char* reason = _failure_reason != NULL ? _failure_reason : "unknown"; |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
401 |
log->elem("failure reason='%s'", reason); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
402 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
403 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
404 |
// <task_done ... stamp='1.234'> </task> |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
405 |
nmethod* nm = code(); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
406 |
log->begin_elem("task_done success='%d' nmsize='%d' count='%d'", |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
407 |
_is_success, nm == NULL ? 0 : nm->content_size(), |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
408 |
method->invocation_count()); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
409 |
int bec = method->backedge_count(); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
410 |
if (bec != 0) log->print(" backedge_count='%d'", bec); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
411 |
// Note: "_is_complete" is about to be set, but is not. |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
412 |
if (_num_inlined_bytecodes != 0) { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
413 |
log->print(" inlined_bytes='%d'", _num_inlined_bytecodes); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
414 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
415 |
log->stamp(); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
416 |
log->end_elem(); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
417 |
log->clear_identities(); // next task will have different CI |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
418 |
log->tail("task"); |
55206 | 419 |
log->flush(); |
32582
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
420 |
log->mark_file_end(); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
421 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
422 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
423 |
// ------------------------------------------------------------------ |
33451
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
33160
diff
changeset
|
424 |
// CompileTask::check_break_at_flags |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
33160
diff
changeset
|
425 |
bool CompileTask::check_break_at_flags() { |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
33160
diff
changeset
|
426 |
int compile_id = this->_compile_id; |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
33160
diff
changeset
|
427 |
bool is_osr = (_osr_bci != CompileBroker::standard_entry_bci); |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
33160
diff
changeset
|
428 |
|
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
33160
diff
changeset
|
429 |
if (CICountOSR && is_osr && (compile_id == CIBreakAtOSR)) { |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
33160
diff
changeset
|
430 |
return true; |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
33160
diff
changeset
|
431 |
} else { |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
33160
diff
changeset
|
432 |
return (compile_id == CIBreakAt); |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
33160
diff
changeset
|
433 |
} |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
33160
diff
changeset
|
434 |
} |
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
33160
diff
changeset
|
435 |
|
0712796e4039
8137167: JEP165: Compiler Control: Implementation task
neliasso
parents:
33160
diff
changeset
|
436 |
// ------------------------------------------------------------------ |
32582
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
437 |
// CompileTask::print_inlining |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
438 |
void CompileTask::print_inlining_inner(outputStream* st, ciMethod* method, int inline_level, int bci, const char* msg) { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
439 |
// 1234567 |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
440 |
st->print(" "); // print timestamp |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
441 |
// 1234 |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
442 |
st->print(" "); // print compilation number |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
443 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
444 |
// method attributes |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
445 |
if (method->is_loaded()) { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
446 |
const char sync_char = method->is_synchronized() ? 's' : ' '; |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
447 |
const char exception_char = method->has_exception_handlers() ? '!' : ' '; |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
448 |
const char monitors_char = method->has_monitor_bytecodes() ? 'm' : ' '; |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
449 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
450 |
// print method attributes |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
451 |
st->print(" %c%c%c ", sync_char, exception_char, monitors_char); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
452 |
} else { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
453 |
// %s!bn |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
454 |
st->print(" "); // print method attributes |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
455 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
456 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
457 |
if (TieredCompilation) { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
458 |
st->print(" "); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
459 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
460 |
st->print(" "); // more indent |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
461 |
st->print(" "); // initial inlining indent |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
462 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
463 |
for (int i = 0; i < inline_level; i++) st->print(" "); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
464 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
465 |
st->print("@ %d ", bci); // print bci |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
466 |
method->print_short_name(st); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
467 |
if (method->is_loaded()) |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
468 |
st->print(" (%d bytes)", method->code_size()); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
469 |
else |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
470 |
st->print(" (not loaded)"); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
471 |
|
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
472 |
if (msg != NULL) { |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
473 |
st->print(" %s", msg); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
474 |
} |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
475 |
st->cr(); |
56619bb8bcaa
8135067: Preparatory refactorings for compiler control
neliasso
parents:
diff
changeset
|
476 |
} |
38218 | 477 |
|
46701
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46271
diff
changeset
|
478 |
void CompileTask::print_ul(const char* msg){ |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46271
diff
changeset
|
479 |
LogTarget(Debug, jit, compilation) lt; |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46271
diff
changeset
|
480 |
if (lt.is_enabled()) { |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46271
diff
changeset
|
481 |
LogStream ls(lt); |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46271
diff
changeset
|
482 |
print(&ls, msg, /* short form */ true, /* cr */ true); |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46271
diff
changeset
|
483 |
} |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46271
diff
changeset
|
484 |
} |
38218 | 485 |
|
46701
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46271
diff
changeset
|
486 |
void CompileTask::print_ul(const nmethod* nm, const char* msg) { |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46271
diff
changeset
|
487 |
LogTarget(Debug, jit, compilation) lt; |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46271
diff
changeset
|
488 |
if (lt.is_enabled()) { |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46271
diff
changeset
|
489 |
LogStream ls(lt); |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46271
diff
changeset
|
490 |
print_impl(&ls, nm->method(), nm->compile_id(), |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46271
diff
changeset
|
491 |
nm->comp_level(), nm->is_osr_method(), |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46271
diff
changeset
|
492 |
nm->is_osr_method() ? nm->osr_entry_bci() : -1, |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46271
diff
changeset
|
493 |
/*is_blocking*/ false, |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46271
diff
changeset
|
494 |
msg, /* short form */ true, /* cr */ true); |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46271
diff
changeset
|
495 |
} |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46271
diff
changeset
|
496 |
} |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46271
diff
changeset
|
497 |
|
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46271
diff
changeset
|
498 |
void CompileTask::print_inlining_ul(ciMethod* method, int inline_level, int bci, const char* msg) { |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46271
diff
changeset
|
499 |
LogTarget(Debug, jit, inlining) lt; |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46271
diff
changeset
|
500 |
if (lt.is_enabled()) { |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46271
diff
changeset
|
501 |
LogStream ls(lt); |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46271
diff
changeset
|
502 |
print_inlining_inner(&ls, method, inline_level, bci, msg); |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46271
diff
changeset
|
503 |
} |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46271
diff
changeset
|
504 |
} |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46271
diff
changeset
|
505 |