[RFA/JDWP] suspend counting for JDWP

Tom Tromey tromey@redhat.com
Fri Sep 22 00:19:00 GMT 2006


>>>>> "Keith" == Keith Seitz <keiths@redhat.com> writes:

Keith> Now that the last bits of missing JVMTI functionality are in, I can
Keith> submit this patch, which implements the JDWP methods
Keith> VMVirtualMachine.suspendThread, VMVirtualMachine.resumeThread and
Keith> VMVirtualMachine.getSuspendCount using JVMTI.

Keith> +// Thread suspension table. Maps Thread to suspend count
Keith> +static ::java::util::Hashtable *_jdwp_suspend_counts;

If possible stick this in a class somewhere.  Over time I'd like to
see us get rid of globals which must be GC-scanned.

Keith> +  _Jv_MonitorEnter (_jdwp_suspend_counts);

Use the JvSynchronize helper class instead of explicit enter/exit
pairs.  It removes a whole class of potential errors.  There's a few
places to do this...

Keith> +      count = new Integer (1);

Integer.valueOf is slightly preferred nowadays -- it caches small
integers, which means less garbage.  There's a few of these too.

Otherwise looks good, thanks.

Tom



More information about the Java-patches mailing list