mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 10:04:42 +02:00
8061205: MetadataOnStackMark only needs to walk code cache during class redefinition
Only do full metadata walk during class redefinition and only walk handles during class unloading. Reviewed-by: sspitsyn, stefank
This commit is contained in:
parent
984cf4c9b5
commit
7b384c6958
19 changed files with 147 additions and 248 deletions
|
@ -203,8 +203,6 @@ Thread::Thread() {
|
|||
// This initial value ==> never claimed.
|
||||
_oops_do_parity = 0;
|
||||
|
||||
_metadata_on_stack_buffer = NULL;
|
||||
|
||||
// the handle mark links itself to last_handle_mark
|
||||
new HandleMark(this);
|
||||
|
||||
|
@ -776,7 +774,8 @@ void Thread::nmethods_do(CodeBlobClosure* cf) {
|
|||
// no nmethods in a generic thread...
|
||||
}
|
||||
|
||||
void Thread::metadata_do(void f(Metadata*)) {
|
||||
void Thread::metadata_handles_do(void f(Metadata*)) {
|
||||
// Only walk the Handles in Thread.
|
||||
if (metadata_handles() != NULL) {
|
||||
for (int i = 0; i< metadata_handles()->length(); i++) {
|
||||
f(metadata_handles()->at(i));
|
||||
|
@ -2713,7 +2712,6 @@ void JavaThread::nmethods_do(CodeBlobClosure* cf) {
|
|||
}
|
||||
|
||||
void JavaThread::metadata_do(void f(Metadata*)) {
|
||||
Thread::metadata_do(f);
|
||||
if (has_last_Java_frame()) {
|
||||
// Traverse the execution stack to call f() on the methods in the stack
|
||||
for (StackFrameStream fst(this); !fst.is_done(); fst.next()) {
|
||||
|
@ -4104,6 +4102,21 @@ void Threads::metadata_do(void f(Metadata*)) {
|
|||
}
|
||||
}
|
||||
|
||||
class ThreadHandlesClosure : public ThreadClosure {
|
||||
void (*_f)(Metadata*);
|
||||
public:
|
||||
ThreadHandlesClosure(void f(Metadata*)) : _f(f) {}
|
||||
virtual void do_thread(Thread* thread) {
|
||||
thread->metadata_handles_do(_f);
|
||||
}
|
||||
};
|
||||
|
||||
void Threads::metadata_handles_do(void f(Metadata*)) {
|
||||
// Only walk the Handles in Thread.
|
||||
ThreadHandlesClosure handles_closure(f);
|
||||
threads_do(&handles_closure);
|
||||
}
|
||||
|
||||
void Threads::deoptimized_wrt_marked_nmethods() {
|
||||
ALL_JAVA_THREADS(p) {
|
||||
p->deoptimized_wrt_marked_nmethods();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue