Change commonRef to avoid using jweak

On Android there is a hard limit to the number of JNI weak global
references (jweaks) active at any one time. It is possible for
Programs that make heavy use of jweaks (or have an extremely large
number of classes) to hit this limit while debugging, causing the
program to abort with an error message. We changed the commonRef
system to use the RefNode* tag to keep a weak-reference to objects
instead of explicit jweaks. We then keep track of unloads by watching
for the ObjectFree events of those objects. This relies on an
extension function to gain a raw-monitor without suspension.

Test: attach debugger to katana.
Test: ./art/tools/run-libjdwp-tests.sh --mode=host
Bug: 76205593

Change-Id: Ieca806e38d2eaa97c6b3b691b3e6f52e49581061
7 files changed