Skip to content
Permalink
Browse files
Ported some more tests.
  • Loading branch information
lmesnik committed Mar 6, 2021
1 parent efdb7d0 commit e066dadc7f486b647d102d733ed9a65f42494b58
Showing with 12,050 additions and 987 deletions.
  1. +45 −1 src/hotspot/share/prims/jvmti.xml
  2. +55 −5 src/hotspot/share/prims/jvmtiEnv.cpp
  3. +27 −0 src/hotspot/share/prims/jvmtiEnvBase.cpp
  4. +2 −0 src/hotspot/share/prims/jvmtiEnvBase.hpp
  5. +2 −0 src/hotspot/share/prims/jvmtiThreadState.cpp
  6. +9 −6 src/jdk.jdwp.agent/share/native/libjdwp/ThreadReferenceImpl.c
  7. +2 −10 src/jdk.jdwp.agent/share/native/libjdwp/debugLoop.c
  8. +0 −21 src/jdk.jdwp.agent/share/native/libjdwp/eventFilter.c
  9. +0 −1 src/jdk.jdwp.agent/share/native/libjdwp/eventFilter.h
  10. +2 −13 src/jdk.jdwp.agent/share/native/libjdwp/eventHandler.c
  11. +5 −14 src/jdk.jdwp.agent/share/native/libjdwp/stepControl.c
  12. +0 −3 src/jdk.jdwp.agent/share/native/libjdwp/stepControl.h
  13. +27 −22 src/jdk.jdwp.agent/share/native/libjdwp/threadControl.c
  14. +133 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetAllThreads/allthr01/allthr01.java
  15. +292 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetAllThreads/allthr01/liballthr01.cpp
  16. +70 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetAllThreads/allthr02/allthr02.java
  17. +93 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetAllThreads/allthr02/liballthr02.cpp
  18. +128 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetFrameCount/framecnt01/framecnt01.java
  19. +120 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetFrameCount/framecnt01/libframecnt01.cpp
  20. +86 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetFrameCount/framecnt02/framecnt02.java
  21. +76 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetFrameCount/framecnt02/libframecnt02.cpp
  22. +70 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetFrameCount/framecnt03/framecnt03.java
  23. +70 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetFrameCount/framecnt03/libframecnt03.cpp
  24. +120 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetFrameLocation/frameloc01/frameloc01.java
  25. +115 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetFrameLocation/frameloc01/frameloc01a.jasm
  26. +216 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetFrameLocation/frameloc01/libframeloc01.cpp
  27. +72 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetFrameLocation/frameloc02/frameloc02.java
  28. +156 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetFrameLocation/frameloc02/libframeloc02.cpp
  29. +114 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetFrameLocation/frameloc03/frameloc03.java
  30. +159 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetFrameLocation/frameloc03/libframeloc03.cpp
  31. +76 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetStackTrace/getstacktr01/getstacktr01.java
  32. +160 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetStackTrace/getstacktr01/libgetstacktr01.cpp
  33. +73 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetStackTrace/getstacktr02/getstacktr02.java
  34. +113 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetStackTrace/getstacktr02/libgetstacktr02.cpp
  35. +119 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetStackTrace/getstacktr03/getstacktr03.java
  36. +211 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetStackTrace/getstacktr03/libgetstacktr03.cpp
  37. +110 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetStackTrace/getstacktr04/getstacktr04.java
  38. +236 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetStackTrace/getstacktr04/libgetstacktr04.cpp
  39. +111 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetStackTrace/getstacktr05/getstacktr05.java
  40. +288 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetStackTrace/getstacktr05/libgetstacktr05.cpp
  41. +112 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetStackTrace/getstacktr06/getstacktr06.java
  42. +296 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetStackTrace/getstacktr06/libgetstacktr06.cpp
  43. +132 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetStackTrace/getstacktr07/getstacktr07.java
  44. +284 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetStackTrace/getstacktr07/libgetstacktr07.cpp
  45. +145 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetStackTrace/getstacktr08/getstacktr08.java
  46. +377 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetStackTrace/getstacktr08/libgetstacktr08.cpp
  47. +90 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetStackTrace/getstacktr09/getstacktr09.java
  48. +96 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetStackTrace/getstacktr09/libgetstacktr09.cpp
  49. +108 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetThreadInfo/thrinfo01/libthrinfo01.cpp
  50. +135 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetThreadInfo/thrinfo01/thrinfo01.java
  51. +108 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetThreadInfo/thrinfo02/libthrinfo02.cpp
  52. +70 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetThreadInfo/thrinfo02/thrinfo02.java
  53. +243 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetThreadState/thrstat01/libthrstat01.cpp
  54. +171 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetThreadState/thrstat01/thrstat01.java
  55. +353 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetThreadState/thrstat02/libthrstat02.cpp
  56. +234 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetThreadState/thrstat02/thrstat02.java
  57. +147 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetThreadState/thrstat03/libthrstat03.cpp
  58. +120 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetThreadState/thrstat03/thrstat03.java
  59. +88 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetThreadState/thrstat04/libthrstat04.cpp
  60. +64 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetThreadState/thrstat04/thrstat04.java
  61. +158 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetThreadState/thrstat05/libthrstat05.cpp
  62. +374 −0 test/hotspot/jtreg/serviceability/jvmti/thread/GetThreadState/thrstat05/thrstat05.java
  63. +151 −0 test/hotspot/jtreg/serviceability/jvmti/thread/ResumeThread/resumethrd01/libresumethrd01.cpp
  64. +154 −0 test/hotspot/jtreg/serviceability/jvmti/thread/ResumeThread/resumethrd01/resumethrd01.java
  65. +186 −0 test/hotspot/jtreg/serviceability/jvmti/thread/ResumeThread/resumethrd02/libresumethrd02.cpp
  66. +151 −0 test/hotspot/jtreg/serviceability/jvmti/thread/ResumeThread/resumethrd02/resumethrd02.java
  67. +256 −0 ...hotspot/jtreg/serviceability/jvmti/thread/ResumeThreadList/resumethrdlst01/libresumethrdlst01.cpp
  68. +172 −0 test/hotspot/jtreg/serviceability/jvmti/thread/ResumeThreadList/resumethrdlst01/resumethrdlst01.java
  69. +309 −0 ...hotspot/jtreg/serviceability/jvmti/thread/ResumeThreadList/resumethrdlst02/libresumethrdlst02.cpp
  70. +172 −0 test/hotspot/jtreg/serviceability/jvmti/thread/ResumeThreadList/resumethrdlst02/resumethrdlst02.java
  71. +150 −0 test/hotspot/jtreg/serviceability/jvmti/thread/SuspendThread/suspendthrd01/libsuspendthrd01.cpp
  72. +156 −0 test/hotspot/jtreg/serviceability/jvmti/thread/SuspendThread/suspendthrd01/suspendthrd01.java
  73. +190 −0 test/hotspot/jtreg/serviceability/jvmti/thread/SuspendThread/suspendthrd02/libsuspendthrd02.cpp
  74. +156 −0 test/hotspot/jtreg/serviceability/jvmti/thread/SuspendThread/suspendthrd02/suspendthrd02.java
  75. +192 −0 test/hotspot/jtreg/serviceability/jvmti/thread/SuspendThread/suspendthrd03/libsuspendthrd03.cpp
  76. +320 −0 test/hotspot/jtreg/serviceability/jvmti/thread/SuspendThread/suspendthrd03/suspendthrd03.java
  77. +244 −0 ...spot/jtreg/serviceability/jvmti/thread/SuspendThreadList/suspendthrdlst01/libsuspendthrdlst01.cpp
  78. +174 −0 ...otspot/jtreg/serviceability/jvmti/thread/SuspendThreadList/suspendthrdlst01/suspendthrdlst01.java
  79. +292 −0 ...spot/jtreg/serviceability/jvmti/thread/SuspendThreadList/suspendthrdlst02/libsuspendthrdlst02.cpp
  80. +174 −0 ...otspot/jtreg/serviceability/jvmti/thread/SuspendThreadList/suspendthrdlst02/suspendthrdlst02.java
  81. +28 −32 ...tspot/jtreg/serviceability/jvmti/vthread/DoContinueSingleStepTest/libDoContinueSingleStepTest.cpp
  82. +44 −78 test/hotspot/jtreg/serviceability/jvmti/vthread/MethodExitTest/libMethodExitTest.cpp
  83. +35 −39 ...Thread/suspendvthr001.java → serviceability/jvmti/vthread/SuspendResumeAll/SuspendResumeAll.java}
  84. +505 −0 test/hotspot/jtreg/serviceability/jvmti/vthread/SuspendResumeAll/libSuspendResumeAll.cpp
  85. +21 −34 ...pot/jtreg/serviceability/jvmti/vthread/VThreadNotifyFramePopTest/libVThreadNotifyFramePopTest.cpp
  86. +16 −57 test/hotspot/jtreg/serviceability/jvmti/vthread/VThreadTest/libVThreadTest.cpp
  87. +0 −47 test/hotspot/jtreg/vmTestbase/nsk/jvmti/SuspendThread/suspendvthr001/TestDescription.java
  88. +0 −33 test/hotspot/jtreg/vmTestbase/nsk/jvmti/SuspendThread/suspendvthr001/libsuspendvthr001.cpp
  89. +0 −534 test/hotspot/jtreg/vmTestbase/nsk/jvmti/SuspendThread/suspendvthr001/suspendvthr001.cpp
  90. +119 −37 test/lib/jdk/test/lib/jvmti/jvmti_common.h
  91. +15 −0 test/lib/jdk/test/lib/jvmti/jvmti_thread.h
@@ -2316,8 +2316,30 @@ jvmtiEnv *jvmti;
<required id="can_support_virtual_threads"></required>
</capabilities>
<parameters>
<param id="except_count">
<jint min="0"/>
<description>
The number of threads in the list of threads not to be suspended.
</description>
</param>
<param id="except_list">
<inbuf incount="except_count">
<jthread/>
<nullok>not an error if <code>except_count == 0</code></nullok>
</inbuf>
<description>
The list of threads not to be suspended.
</description>
</param>
</parameters>
<errors>
<error id="JVMTI_ERROR_INVALID_THREAD">
A thread in <paramlink id="except_list"></paramlink> was invalid.
</error>
<error id="JVMTI_ERROR_NULL_POINTER">
Both <paramlink id="except_list"></paramlink> was <code>NULL</code>
and <paramlink id="except_count"></paramlink> was non-zero.
</error>
</errors>
</function>

@@ -2326,7 +2348,7 @@ jvmtiEnv *jvmti;
<description>
Resume all virtual threads except those already resumed.
Virtual threads may be suspended with
<functionlink id="RsuspendAllVirtualThreads"></functionlink> or
<functionlink id="SuspendAllVirtualThreads"></functionlink> or
<functionlink id="SuspendThreadList"></functionlink> or
<functionlink id="SuspendThread"></functionlink>.
Virtual threads that are currently resumed do not change state.
@@ -2337,8 +2359,30 @@ jvmtiEnv *jvmti;
<required id="can_support_virtual_threads"></required>
</capabilities>
<parameters>
<param id="except_count">
<jint min="0"/>
<description>
The number of threads in the list of threads not to be resumed.
</description>
</param>
<param id="except_list">
<inbuf incount="except_count">
<jthread/>
<nullok>not an error if <code>except_count == 0</code></nullok>
</inbuf>
<description>
The list of threads not to be resumed.
</description>
</param>
</parameters>
<errors>
<error id="JVMTI_ERROR_INVALID_THREAD">
A thread in <paramlink id="except_list"></paramlink> was invalid.
</error>
<error id="JVMTI_ERROR_NULL_POINTER">
Both <paramlink id="except_list"></paramlink> was <code>NULL</code>
and <paramlink id="except_count"></paramlink> was non-zero.
</error>
</errors>
</function>

@@ -1064,21 +1064,37 @@ JvmtiEnv::SuspendThreadList(jint request_count, const jthread* request_list, jvm


jvmtiError
JvmtiEnv::SuspendAllVirtualThreads() {
JvmtiEnv::SuspendAllVirtualThreads(jint except_count, const jthread* except_list) {
int needSafepoint = 0; // > 0 if a safepoint is needed
jvmtiError err = JvmtiEnvBase::check_thread_list(except_count, except_list);
if (err != JVMTI_ERROR_NONE) {
return err;
}
if (!JvmtiExport::can_support_virtual_threads()) {
return JVMTI_ERROR_MUST_POSSESS_CAPABILITY;
}
{
ResourceMark rm;
JvmtiVTMTDisabler vtmt_disabler;
GrowableArray<jthread>* elist = new GrowableArray<jthread>(except_count);

// Collect threads from except_list which resumed status must be restored.
for (int idx = 0; idx < except_count; idx++) {
jthread thread = except_list[idx];
oop thread_oop = JNIHandles::resolve_external_guard(thread);
if (!JvmtiVTSuspender::vthread_is_ext_suspended(thread_oop)) {
// is resumed, so its resumed status must be restored
elist->append(except_list[idx]);
}
}

for (JavaThreadIteratorWithHandle jtiwh; JavaThread *java_thread = jtiwh.next(); ) {
oop jt_oop = java_thread->threadObj();
if (jt_oop == NULL || java_thread->is_exiting() ||
!java_lang_Thread::is_alive(jt_oop) ||
java_thread->is_jvmti_agent_thread() ||
java_thread->is_hidden_from_external_view()) {
java_thread->is_hidden_from_external_view() ||
is_in_thread_list(except_count, except_list, jt_oop)) {
continue;
}
oop thread_oop = java_thread->mounted_vthread();
@@ -1092,6 +1108,15 @@ JvmtiEnv::SuspendAllVirtualThreads() {
}
}
JvmtiVTSuspender::register_all_vthreads_suspend();

// Resume threads from except list that were resumed before.
for (int idx = 0; idx < elist->length(); idx++) {
jthread thread = elist->at(idx);
oop thread_oop = JNIHandles::resolve_external_guard(thread);
if (JvmtiVTSuspender::vthread_is_ext_suspended(thread_oop)) {
JvmtiVTSuspender::register_vthread_resume(thread_oop);
}
}
}
if (needSafepoint > 0) {
VM_ThreadsSuspendJVMTI tsj;
@@ -1144,19 +1169,35 @@ JvmtiEnv::ResumeThreadList(jint request_count, const jthread* request_list, jvmt


jvmtiError
JvmtiEnv::ResumeAllVirtualThreads() {
JvmtiEnv::ResumeAllVirtualThreads(jint except_count, const jthread* except_list) {
jvmtiError err = JvmtiEnvBase::check_thread_list(except_count, except_list);
if (err != JVMTI_ERROR_NONE) {
return err;
}
if (!JvmtiExport::can_support_virtual_threads()) {
return JVMTI_ERROR_MUST_POSSESS_CAPABILITY;
}
JvmtiVTMTDisabler vtmt_disabler;
ResourceMark rm;
JvmtiVTMTDisabler vtmt_disabler;
GrowableArray<jthread>* elist = new GrowableArray<jthread>(except_count);

// Collect threads from except_list which suspended status must be restored.
for (int idx = 0; idx < except_count; idx++) {
jthread thread = except_list[idx];
oop thread_oop = JNIHandles::resolve_external_guard(thread);
if (JvmtiVTSuspender::vthread_is_ext_suspended(thread_oop)) {
// is suspended, so its suspended status must be restored
elist->append(except_list[idx]);
}
}

for (JavaThreadIteratorWithHandle jtiwh; JavaThread *java_thread = jtiwh.next(); ) {
oop jt_oop = java_thread->threadObj();
if (jt_oop == NULL || java_thread->is_exiting() ||
!java_lang_Thread::is_alive(jt_oop) ||
java_thread->is_jvmti_agent_thread() ||
java_thread->is_hidden_from_external_view()) {
java_thread->is_hidden_from_external_view() ||
is_in_thread_list(except_count, except_list, jt_oop)) {
continue;
}
oop thread_oop = java_thread->mounted_vthread();
@@ -1167,6 +1208,15 @@ JvmtiEnv::ResumeAllVirtualThreads() {
}
}
JvmtiVTSuspender::register_all_vthreads_resume();

// Suspend threads from except list that were suspended before.
for (int idx = 0; idx < elist->length(); idx++) {
jthread thread = elist->at(idx);
oop thread_oop = JNIHandles::resolve_external_guard(thread);
if (!JvmtiVTSuspender::vthread_is_ext_suspended(thread_oop)) {
JvmtiVTSuspender::register_vthread_suspend(thread_oop);
}
}
return JVMTI_ERROR_NONE;
}

@@ -1442,6 +1442,33 @@ JvmtiEnvBase::get_object_monitor_usage(JavaThread* calling_thread, jobject objec
return JVMTI_ERROR_NONE;
}

jvmtiError
JvmtiEnvBase::check_thread_list(jint count, const jthread* list) {
if (list == NULL && count != 0) {
return JVMTI_ERROR_NULL_POINTER;
}
for (int i = 0; i < count; i++) {
jthread thread = list[i];
oop thread_oop = JNIHandles::resolve_external_guard(thread);
if (thread_oop == NULL || !thread_oop->is_a(vmClasses::VirtualThread_klass())) {
return JVMTI_ERROR_INVALID_THREAD;
}
}
return JVMTI_ERROR_NONE;
}

bool
JvmtiEnvBase::is_in_thread_list(jint count, const jthread* list, oop jt_oop) {
for (int idx = 0; idx < count; idx++) {
jthread thread = list[idx];
oop thread_oop = JNIHandles::resolve_external_guard(thread);
if (thread_oop == jt_oop) {
return true;
}
}
return false;
}

jvmtiError
JvmtiEnvBase::suspend_thread(oop thread_oop, JavaThread* java_thread, bool single_suspend,
int* need_safepoint_p) {
@@ -85,6 +85,8 @@ class JvmtiEnvBase : public CHeapObj<mtInternal> {
static jvmtiError suspend_thread(oop thread_oop, JavaThread* java_thread, bool single_suspend,
int* need_safepoint_p);
static jvmtiError resume_thread(oop thread_oop, JavaThread* java_thread, bool single_suspend);
static jvmtiError check_thread_list(jint count, const jthread* list);
static bool is_in_thread_list(jint count, const jthread* list, oop jt_oop);
private:

enum {
@@ -358,13 +358,15 @@ JvmtiVTSuspender::register_all_vthreads_suspend() {

_vthread_suspend_mode = vthread_suspend_all;
_vthread_suspend_list->invalidate();
_vthread_resume_list->invalidate();
}

void
JvmtiVTSuspender::register_all_vthreads_resume() {
MonitorLocker ml(JvmtiVTMT_lock, Mutex::_no_safepoint_check_flag);

_vthread_suspend_mode = vthread_suspend_none;
_vthread_suspend_list->invalidate();
_vthread_resume_list->invalidate();
}

@@ -49,24 +49,25 @@ name(PacketInputStream *in, PacketOutputStream *out)
return JNI_TRUE;
}

WITH_LOCAL_REFS(env, 3) {
/* Get the thread name */
WITH_LOCAL_REFS(env, 1) {

jvmtiThreadInfo info;
jvmtiError error;

(void)memset(&info, 0, sizeof(info));

error = JVMTI_FUNC_PTR(gdata->jvmti,GetThreadInfo)
(gdata->jvmti, thread, &info);
(gdata->jvmti, thread, &info);

if (error != JVMTI_ERROR_NONE) {
outStream_setError(out, map2jdwpError(error));
} else {
(void)outStream_writeString(out, info.name);
}

if ( info.name != NULL ) {
if ( info.name != NULL )
jvmtiDeallocate(info.name);
}

} END_WITH_LOCAL_REFS(env);

return JNI_TRUE;
@@ -169,9 +170,11 @@ threadGroup(PacketInputStream *in, PacketOutputStream *out)

jvmtiThreadInfo info;
jvmtiError error;

(void)memset(&info, 0, sizeof(info));

error = JVMTI_FUNC_PTR(gdata->jvmti,GetThreadInfo)
(gdata->jvmti, thread, &info);
(gdata->jvmti, thread, &info);

if (error != JVMTI_ERROR_NONE) {
outStream_setError(out, map2jdwpError(error));
@@ -83,7 +83,6 @@ debugLoop_run(void)
jboolean shouldListen;
jdwpPacket p;
jvmtiStartFunction func;
JNIEnv *env = getEnv();

/* Initialize all statics */
/* We may be starting a new connection after an error */
@@ -158,15 +157,8 @@ debugLoop_run(void)
*/
outStream_setError(&out, JDWP_ERROR(VM_DEAD));
} else {
/* Provide 64 localrefs by default. */
/* vthread fixme: Now that this default set of localrefs is in place, we can remove a
* bunch of WITH_LOCAL_REFS/END_WITH_LOCAL_REFS blocks. The only ones needed are
* ones that could potentially go over 64, likes ones within loops. Note this only
* refers to command handlers called from here, not all uses of WITH_LOCAL_REFS. */
WITH_LOCAL_REFS(env, 64) {
/* Call the command handler */
replyToSender = func(&in, &out);
} END_WITH_LOCAL_REFS(env);
/* Call the command handler */
replyToSender = func(&in, &out);
}

/* Reply to the sender */
@@ -977,27 +977,6 @@ eventFilter_setStepFilter(HandlerNode *node, jint index,
return JVMTI_ERROR_NONE;
}

/*
* Finds the step filter in a node, and sets the thread for that filter.
* vthread fixme: not used. delete once we know for sure we'll never need it.
*/
void
eventFilter_setStepFilterThread(HandlerNode *node, jthread thread)
{
JNIEnv *env = getEnv();
Filter *filter = FILTERS_ARRAY(node);
int i;
for (i = 0; i < FILTER_COUNT(node); ++i, ++filter) {
switch (filter->modifier) {
case JDWP_REQUEST_MODIFIER(Step):
tossGlobalRef(env, &(filter->u.Step.thread));
saveGlobalRef(env, thread, &(filter->u.Step.thread));
return;
}
}
JDI_ASSERT(JNI_FALSE); /* We should have found a step filter, but didn't. */
}

jvmtiError
eventFilter_setSourceNameMatchFilter(HandlerNode *node,
jint index,
@@ -66,7 +66,6 @@ jvmtiError eventFilter_setStepFilter(HandlerNode *node,
jint index,
jthread thread,
jint size, jint depth);
void eventFilter_setStepFilterThread(HandlerNode *node, jthread thread);
jvmtiError eventFilter_setSourceNameMatchFilter(HandlerNode *node,
jint index,
char *sourceNamePattern);
@@ -675,7 +675,7 @@ filterAndAddVThread(JNIEnv *env, EventInfo *evinfo, EventIndex ei, jbyte eventSe
* consumes the event.
*/
static void
event_callback_helper(JNIEnv *env, EventInfo *evinfo)
event_callback(JNIEnv *env, EventInfo *evinfo)
{
struct bag *eventBag;
jbyte eventSessionID = currentSessionID; /* session could change */
@@ -743,8 +743,7 @@ event_callback_helper(JNIEnv *env, EventInfo *evinfo)
* resources can be allocated. This must be done before
* grabbing any locks.
*/
eventBag = threadControl_onEventHandlerEntry(
eventSessionID, evinfo, currentException);
eventBag = threadControl_onEventHandlerEntry(eventSessionID, evinfo, currentException);
if ( eventBag == NULL ) {
jboolean invoking;
do {
@@ -829,16 +828,6 @@ event_callback_helper(JNIEnv *env, EventInfo *evinfo)
}
}

static void
event_callback(JNIEnv *env, EventInfo *evinfo)
{
/* vthread fixme: There are a bunch of WITH_LOCAL_REFS that we can remove now that
* we are doing one here. */
WITH_LOCAL_REFS(env, 64) {
event_callback_helper(env, evinfo);
} END_WITH_LOCAL_REFS(env);
}

/* Returns a local ref to the declaring class for an object. */
static jclass
getObjectClass(jobject object)

0 comments on commit e066dad

Please sign in to comment.