Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/hotspot/share/jvmci/jvmciCompilerToVM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3223,6 +3223,10 @@ C2V_VMENTRY(void, getOopMapAt, (JNIEnv* env, jobject, ARGUMENT_PAIR(method),
JVMCIENV->copy_longs_from((jlong*)oop_map_buf, oop_map, 0, nwords);
C2V_END

C2V_VMENTRY_0(jint, getCompilationActivityMode, (JNIEnv* env, jobject))
return CompileBroker::get_compilation_activity_mode();
}

#define CC (char*) /*cast a literal from (const char*)*/
#define FN_PTR(f) CAST_FROM_FN_PTR(void*, &(c2v_ ## f))

Expand Down Expand Up @@ -3385,6 +3389,7 @@ JNINativeMethod CompilerToVM::methods[] = {
{CC "notifyCompilerInliningEvent", CC "(I" HS_METHOD2 HS_METHOD2 "ZLjava/lang/String;I)V", FN_PTR(notifyCompilerInliningEvent)},
{CC "getOopMapAt", CC "(" HS_METHOD2 "I[J)V", FN_PTR(getOopMapAt)},
{CC "updateCompilerThreadCanCallJava", CC "(Z)Z", FN_PTR(updateCompilerThreadCanCallJava)},
{CC "getCompilationActivityMode", CC "()I", FN_PTR(getCompilationActivityMode)},
};

int CompilerToVM::methods_count() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1522,4 +1522,10 @@ void getOopMapAt(HotSpotResolvedJavaMethodImpl method, int bci, long[] oopMap) {
* @returns false if no change was made, otherwise true
*/
native boolean updateCompilerThreadCanCallJava(boolean newState);

/**
* Returns the current {@code CompileBroker} compilation activity mode which is one of:
* {@code stop_compilation = 0}, {@code run_compilation = 1} or {@code shutdown_compilation = 2}
*/
native int getCompilationActivityMode();
}
Original file line number Diff line number Diff line change
Expand Up @@ -1488,4 +1488,12 @@ JVMCIError exitHotSpotWithMessage(int status, String format, Object... args) {
exitHotSpot(status);
throw JVMCIError.shouldNotReachHere();
}

/**
* Returns HotSpot's {@code CompileBroker} compilation activity mode which is one of:
* {@code stop_compilation = 0}, {@code run_compilation = 1} or {@code shutdown_compilation = 2}
*/
public int getCompilationActivityMode() {
return compilerToVm.getCompilationActivityMode();
}
}