if (VM.TraceStackTrace) { VM.disableGC(); VM_Scheduler.dumpStack(); VM.enableGC(); }
   public static VM_StackTrace[] create() {     if (VM.TraceTimes) VM_Timer.start(VM_Timer.EXCEPTION_HANDLING);     // count number of frames comprising stack     //     int stackFrameCount = 0;     VM.disableGC(); // so fp & ip don't change under our feet     VM_Address fp = VM_Magic.getFramePointer();     VM_Address ip = VM_Magic.getReturnAddress(fp);     fp = VM_Magic.getCallerFramePointer(fp);     while (VM_Magic.getCallerFramePointer(fp).toInt() != STACKFRAME_SENTINAL_FP) {       stackFrameCount++;       int compiledMethodId = VM_Magic.getCompiledMethodID(fp);       if (compiledMethodId!=INVISIBLE_METHOD_ID) {	 VM_CompiledMethod compiledMethod = VM_CompiledMethods.getCompiledMethod(compiledMethodId);	 if (compiledMethod.getMethod().getDeclaringClass().isBridgeFromNative()) {	   // skip native frames, stopping at last native frame preceeding the	   // Java To C transition frame	   fp = VM_Runtime.unwindNativeStackFrame(fp);	 	 }       }        ip = VM_Magic.getReturnAddress(fp);       fp = VM_Magic.getCallerFramePointer(fp);     }     VM.enableGC();     // allocate space in which to record stacktrace     //     VM_StackTrace[] stackTrace = new VM_StackTrace[stackFrameCount];     for (int i = 0; i < stackFrameCount; ++i) {       stackTrace[i] = new VM_StackTrace();     }     // rewalk stack and record stacktrace     //     VM.disableGC(); // so fp & ip don't change under our feet     fp = VM_Magic.getFramePointer();     ip = VM_Magic.getReturnAddress(fp);     fp = VM_Magic.getCallerFramePointer(fp);     for (int i = 0; i < stackFrameCount; ++i) {       int compiledMethodId = VM_Magic.getCompiledMethodID(fp);       if (compiledMethodId!=INVISIBLE_METHOD_ID) {	 VM_CompiledMethod compiledMethod = VM_CompiledMethods.getCompiledMethod(compiledMethodId);	 stackTrace[i].compiledMethod = compiledMethod;	 stackTrace[i].instructionOffset = ip.diff(VM_Magic.objectAsAddress(compiledMethod.getInstructions()));	 if (compiledMethod.getMethod().getDeclaringClass().isBridgeFromNative()) {	   // skip native frames, stopping at last native frame preceeding the	   // Java To C transition frame	   fp = VM_Runtime.unwindNativeStackFrame(fp);	 }              }       ip = VM_Magic.getReturnAddress(fp);       fp = VM_Magic.getCallerFramePointer(fp);     }     VM.enableGC();           if (VM.TraceTimes) VM_Timer.stop(VM_Timer.EXCEPTION_HANDLING);     return stackTrace;   }