Skip to content

Commit aca288a

Browse files
keithc-caChengJin01
authored andcommitted
Make javaOffloadSwitch(On|Off)WithReason functions global
Add declarations in vm_internal.h so they can be used in ArrayCopyHelpers.cpp. Signed-off-by: Keith W. Campbell <[email protected]>
1 parent 785e48b commit aca288a

File tree

2 files changed

+21
-16
lines changed

2 files changed

+21
-16
lines changed

runtime/vm/jnimisc.cpp

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,7 @@
4545
extern "C" {
4646

4747
#if defined(J9VM_OPT_JAVA_OFFLOAD_SUPPORT)
48-
/**
49-
* Switch onto the zaap processor if not already running there.
50-
*
51-
* @param currentThread[in] the current J9VMThread
52-
* @param reason[in] the reason code
53-
*/
54-
static void
48+
void
5549
javaOffloadSwitchOnWithReason(J9VMThread *currentThread, UDATA reason)
5650
{
5751
J9JavaVM *vm = currentThread->javaVM;
@@ -64,13 +58,7 @@ javaOffloadSwitchOnWithReason(J9VMThread *currentThread, UDATA reason)
6458
}
6559
}
6660

67-
/**
68-
* Switch away from the zaap processor if running there.
69-
*
70-
* @param currentThread[in] the current J9VMThread
71-
* @param reason[in] the reason code
72-
*/
73-
static void
61+
void
7462
javaOffloadSwitchOffWithReason(J9VMThread *currentThread, UDATA reason)
7563
{
7664
J9JavaVM *vm = currentThread->javaVM;
@@ -81,8 +69,7 @@ javaOffloadSwitchOffWithReason(J9VMThread *currentThread, UDATA reason)
8169
}
8270
}
8371
}
84-
#endif /* J9VM_OPT_JAVA_OFFLOAD_SUPPORT */
85-
72+
#endif /* defined(J9VM_OPT_JAVA_OFFLOAD_SUPPORT) */
8673

8774
/**
8875
* Get the array class for a J9Class.

runtime/vm/vm_internal.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,24 @@ freeAllStructFFITypes(J9VMThread *currentThread, void *cifNode);
557557

558558
#if defined(J9VM_OPT_JAVA_OFFLOAD_SUPPORT)
559559

560+
/**
561+
* Switch onto the zaap processor if not already running there.
562+
*
563+
* @param currentThread[in] the current J9VMThread
564+
* @param reason[in] the reason code
565+
*/
566+
void
567+
javaOffloadSwitchOnWithReason(J9VMThread *currentThread, UDATA reason);
568+
569+
/**
570+
* Switch away from the zaap processor if running there.
571+
*
572+
* @param currentThread[in] the current J9VMThread
573+
* @param reason[in] the reason code
574+
*/
575+
void
576+
javaOffloadSwitchOffWithReason(J9VMThread *currentThread, UDATA reason);
577+
560578
#define JAVA_OFFLOAD_SWITCH_ON_WITH_REASON_IF_LIMIT_EXCEEDED(currentThread, reason, length) \
561579
do { \
562580
if ((length) > J9_JNI_OFFLOAD_SWITCH_THRESHOLD) { \

0 commit comments

Comments
 (0)