MM_Interface.gc();
System.gc();
  static void deliverHardwareException(int trapCode, int trapInfo) {    VM_Thread    myThread           = VM_Thread.getCurrentThread();    VM_Registers exceptionRegisters = myThread.hardwareExceptionRegisters;    if ((trapCode == TRAP_STACK_OVERFLOW || trapCode == TRAP_JNI_STACK) &&         myThread.stack.length < (STACK_SIZE_MAX >> LOG_BYTES_IN_ADDRESS) &&         !myThread.hasNativeStackFrame()) {       // expand stack by the size appropriate for normal or native frame       // and resume execution at successor to trap instruction      // (C trap handler has set register.ip to the instruction following the trap).      if (trapCode == TRAP_JNI_STACK) {        VM_Thread.resizeCurrentStack(myThread.stack.length + STACK_SIZE_JNINATIVE_GROW, exceptionRegisters);      } else {        VM_Thread.resizeCurrentStack(myThread.stack.length + STACK_SIZE_GROW, exceptionRegisters);      }      if (VM.VerifyAssertions) VM._assert(exceptionRegisters.inuse == true);       exceptionRegisters.inuse = false;      VM_Magic.restoreHardwareExceptionState(exceptionRegisters);      if (VM.VerifyAssertions) VM._assert(NOT_REACHED);    }    // GC stress testing    if (VM.ForceFrequentGC && VM_Scheduler.allProcessorsInitialized) {      VM.sysWrite("FORCING GC: in deliverHardwareException\n");      MM_Interface.gc();    }    Throwable exceptionObject;    switch (trapCode) {    case TRAP_NULL_POINTER:      exceptionObject = new java.lang.NullPointerException();      break;    case TRAP_ARRAY_BOUNDS:      exceptionObject = new java.lang.ArrayIndexOutOfBoundsException(trapInfo);      break;    case TRAP_DIVIDE_BY_ZERO:      exceptionObject = new java.lang.ArithmeticException();      break;    case TRAP_STACK_OVERFLOW:    case TRAP_JNI_STACK:      exceptionObject = new java.lang.StackOverflowError();      break;    case TRAP_CHECKCAST:      exceptionObject = new java.lang.ClassCastException();      break;    case TRAP_MUST_IMPLEMENT:      exceptionObject = new java.lang.IncompatibleClassChangeError();      break;    case TRAP_STORE_CHECK:      exceptionObject = new java.lang.ArrayStoreException();      break;    default:      exceptionObject = new java.lang.UnknownError();      VM_Scheduler.traceback("UNKNOWN ERROR");      break;    }          VM.disableGC();  // VM.enableGC() is called when the exception is delivered.    deliverException(exceptionObject, exceptionRegisters);  }