This patch implements the AttachCurrentThread,AttachCurrentThreadAsDaemon,DetachCurrentThread functions for JNI. Based on this functions, a new debugger function is provided to dynamically register compiled method. Also it fixed several related problem. Now mrp can pass all dacapo2006,all dacapo9.12 with batik as exception and all SPECjvm2008 tests. Presently, it's been tested with MSD configuraion. The GenMSD has some unresolved issues with GC module.