mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 17:44:40 +02:00
8267916: Adopt cast notation for CompilerThread conversions
Reviewed-by: kbarrett, iklam, dholmes
This commit is contained in:
parent
9bf347bc1f
commit
a52a08d20b
6 changed files with 13 additions and 15 deletions
|
@ -939,7 +939,7 @@ JavaThread* CompileBroker::make_thread(ThreadType type, jobject thread_handle, C
|
|||
|
||||
new_thread->set_threadObj(JNIHandles::resolve_non_null(thread_handle));
|
||||
if (type == compiler_t) {
|
||||
new_thread->as_CompilerThread()->set_compiler(comp);
|
||||
CompilerThread::cast(new_thread)->set_compiler(comp);
|
||||
}
|
||||
Threads::add(new_thread);
|
||||
Thread::start(new_thread);
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "compiler/abstractCompiler.hpp"
|
||||
#include "compiler/compileTask.hpp"
|
||||
#include "compiler/compilerDirectives.hpp"
|
||||
#include "compiler/compilerThread.hpp"
|
||||
#include "runtime/atomic.hpp"
|
||||
#include "runtime/perfDataTypes.hpp"
|
||||
#include "utilities/stack.hpp"
|
||||
|
|
|
@ -56,7 +56,14 @@ class CompilerThread : public JavaThread {
|
|||
|
||||
public:
|
||||
|
||||
static CompilerThread* current();
|
||||
static CompilerThread* current() {
|
||||
return CompilerThread::cast(JavaThread::current());
|
||||
}
|
||||
|
||||
static CompilerThread* cast(Thread* t) {
|
||||
assert(t->is_Compiler_thread(), "incorrect cast to CompilerThread");
|
||||
return static_cast<CompilerThread*>(t);
|
||||
}
|
||||
|
||||
CompilerThread(CompileQueue* queue, CompilerCounters* counters);
|
||||
~CompilerThread();
|
||||
|
@ -109,15 +116,6 @@ class CompilerThread : public JavaThread {
|
|||
static void thread_entry(JavaThread* thread, TRAPS);
|
||||
};
|
||||
|
||||
inline CompilerThread* JavaThread::as_CompilerThread() {
|
||||
assert(is_Compiler_thread(), "just checking");
|
||||
return (CompilerThread*)this;
|
||||
}
|
||||
|
||||
inline CompilerThread* CompilerThread::current() {
|
||||
return JavaThread::current()->as_CompilerThread();
|
||||
}
|
||||
|
||||
// Dedicated thread to sweep the code cache
|
||||
class CodeCacheSweeperThread : public JavaThread {
|
||||
CompiledMethod* _scanned_compiled_method; // nmethod being scanned by the sweeper
|
||||
|
|
|
@ -156,7 +156,7 @@ void JVMCI::ensure_box_caches_initialized(TRAPS) {
|
|||
|
||||
JavaThread* JVMCI::compilation_tick(JavaThread* thread) {
|
||||
if (thread->is_Compiler_thread()) {
|
||||
CompileTask *task = thread->as_CompilerThread()->task();
|
||||
CompileTask *task = CompilerThread::cast(thread)->task();
|
||||
if (task != NULL) {
|
||||
JVMCICompileState *state = task->blocking_jvmci_compile_state();
|
||||
if (state != NULL) {
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "classfile/javaClasses.inline.hpp"
|
||||
#include "code/compiledIC.hpp"
|
||||
#include "compiler/compileBroker.hpp"
|
||||
#include "compiler/compilerThread.hpp"
|
||||
#include "compiler/oopMap.hpp"
|
||||
#include "jvmci/jvmciCodeInstaller.hpp"
|
||||
#include "jvmci/jvmciCompilerToVM.hpp"
|
||||
|
@ -436,7 +437,7 @@ MonitorValue* CodeInstaller::get_monitor_value(JVMCIObject value, GrowableArray<
|
|||
|
||||
void CodeInstaller::initialize_dependencies(JVMCIObject compiled_code, OopRecorder* oop_recorder, JVMCI_TRAPS) {
|
||||
JavaThread* thread = JavaThread::current();
|
||||
CompilerThread* compilerThread = thread->is_Compiler_thread() ? thread->as_CompilerThread() : NULL;
|
||||
CompilerThread* compilerThread = thread->is_Compiler_thread() ? CompilerThread::cast(thread) : NULL;
|
||||
_oop_recorder = oop_recorder;
|
||||
_dependencies = new Dependencies(&_arena, _oop_recorder, compilerThread != NULL ? compilerThread->log() : NULL);
|
||||
JVMCIObjectArray assumptions = jvmci_env()->get_HotSpotCompiledCode_assumptions(compiled_code);
|
||||
|
|
|
@ -1429,8 +1429,6 @@ class JavaThread: public Thread {
|
|||
// operation. You may not want that either.
|
||||
static JavaThread* active();
|
||||
|
||||
inline CompilerThread* as_CompilerThread();
|
||||
|
||||
protected:
|
||||
virtual void pre_run();
|
||||
virtual void run();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue