Skip to content

Commit 7beb8af

Browse files
committedSep 29, 2023

File tree

5 files changed

+46
-7
lines changed

5 files changed

+46
-7
lines changed
 

‎src/hotspot/share/compiler/compileBroker.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -804,13 +804,6 @@ Handle CompileBroker::create_thread_oop(const char* name, TRAPS) {
804804
Handle thread_oop = JavaThread::create_system_thread_object(name, CHECK_NH);
805805
return thread_oop;
806806
}
807-
class TrainingReplayThread : public JavaThread {
808-
static void training_replay_thread_entry(JavaThread* thread, TRAPS);
809-
public:
810-
TrainingReplayThread() : JavaThread(&training_replay_thread_entry) { }
811-
812-
bool is_hidden_from_external_view() const { return true; }
813-
};
814807

815808
void TrainingReplayThread::training_replay_thread_entry(JavaThread* thread, TRAPS) {
816809
CompilationPolicy::replay_training_at_init_loop(thread);

‎src/hotspot/share/compiler/compileBroker.hpp

+9
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "compiler/compilerDirectives.hpp"
3232
#include "compiler/compilerThread.hpp"
3333
#include "runtime/atomic.hpp"
34+
#include "runtime/javaThread.hpp"
3435
#include "runtime/perfDataTypes.hpp"
3536
#include "utilities/stack.hpp"
3637
#if INCLUDE_JVMCI
@@ -446,4 +447,12 @@ class CompileBroker: AllStatic {
446447
static void print_heapinfo(outputStream *out, const char* function, size_t granularity);
447448
};
448449

450+
class TrainingReplayThread : public JavaThread {
451+
static void training_replay_thread_entry(JavaThread* thread, TRAPS);
452+
public:
453+
TrainingReplayThread() : JavaThread(&training_replay_thread_entry) { }
454+
455+
bool is_hidden_from_external_view() const { return true; }
456+
};
457+
449458
#endif // SHARE_COMPILER_COMPILEBROKER_HPP

‎src/hotspot/share/runtime/vmStructs.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -1260,6 +1260,7 @@
12601260
declare_type(ServiceThread, JavaThread) \
12611261
declare_type(NotificationThread, JavaThread) \
12621262
declare_type(CompilerThread, JavaThread) \
1263+
declare_type(TrainingReplayThread, JavaThread) \
12631264
declare_type(StringDedupThread, JavaThread) \
12641265
declare_type(AttachListenerThread, JavaThread) \
12651266
declare_toplevel_type(OSThread) \

‎src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Threads.java

+1
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ private static synchronized void initialize(TypeDataBase db) {
151151
virtualConstructor.addMapping("JavaThread", JavaThread.class);
152152
if (!VM.getVM().isCore()) {
153153
virtualConstructor.addMapping("CompilerThread", CompilerThread.class);
154+
virtualConstructor.addMapping("TrainingReplayThread", TrainingReplayThread.class);
154155
}
155156
virtualConstructor.addMapping("JvmtiAgentThread", JvmtiAgentThread.class);
156157
virtualConstructor.addMapping("ServiceThread", ServiceThread.class);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation.
8+
*
9+
* This code is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
* version 2 for more details (a copy is included in the LICENSE file that
13+
* accompanied this code).
14+
*
15+
* You should have received a copy of the GNU General Public License version
16+
* 2 along with this work; if not, write to the Free Software Foundation,
17+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18+
*
19+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20+
* or visit www.oracle.com if you need additional information or have any
21+
* questions.
22+
*
23+
*/
24+
25+
package sun.jvm.hotspot.runtime;
26+
27+
import sun.jvm.hotspot.debugger.Address;
28+
29+
public class TrainingReplayThread extends JavaThread {
30+
public TrainingReplayThread(Address addr) {
31+
super(addr);
32+
}
33+
34+
public boolean isHiddenFromExternalView() { return true; }
35+
}

0 commit comments

Comments
 (0)
Please sign in to comment.