< prev index next >

src/jdk.jdwp.agent/share/native/libjdwp/debugLoop.c

Print this page

        

@@ -81,10 +81,11 @@
 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 */
     cmdQueue = NULL;
     cmdQueueLock = debugMonitorCreate("JDWP Command Queue Lock");

@@ -153,12 +154,19 @@
                  * VirtualMachine cmdSet quietly ignores some cmds
                  * after VM death, so, it sends it's own errors.
                  */
                 outStream_setError(&out, JDWP_ERROR(VM_DEAD));
             } else {
-                /* Call the command handler */
-                replyToSender = func(&in, &out);
+              /* Provide 64 localrefs by default. */
+              /* fiber 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);
             }
 
             /* Reply to the sender */
             if (replyToSender) {
                 if (inStream_error(&in)) {
< prev index next >