/** * Wrapper to save/restore volatile registers when a class needs to be dynamically * loaded/resolved/etc. */ @Interruptible public static void OPT_resolve() throws NoClassDefFoundError { VM.disableGC(); // (1) Get the compiled method & compilerInfo for the (opt) // compiled method that called OPT_resolve LocalAddress fp = VM_Magic.getCallerFramePointer(VM_Magic.getFramePointer()); int cmid = VM_Magic.getCompiledMethodID(fp); VM_OptCompiledMethod cm = (VM_OptCompiledMethod) VM_CompiledMethods.getCompiledMethod(cmid); // (2) Get the return address LocalAddress ip = VM_Magic.getReturnAddress(VM_Magic.getFramePointer()); Offset offset = cm.getInstructionOffset(ip); VM.enableGC(); // (3) Call the routine in VM_OptLinker that does all the real work. VM_OptLinker.resolveDynamicLink(cm, offset); }