+ /* Set registers. */
+
+ switch (type) {
+ case EXCEPTION_HARDWARE_COMPILER:
+ if (p != NULL) {
+ _gregs[REG_PV] = (uintptr_t) p;
+ _gregs[PT_NIP] = (uintptr_t) p;
+ break;
+ }
+
+ /* Get and set the PV from the parent Java method. */
+
+ pv = md_codegen_get_pv_from_pc(ra);
+
+ _gregs[REG_PV] = (uintptr_t) pv;
+
+ /* Get the exception object. */
+
+ p = exceptions_get_and_clear_exception();
+
+ assert(p != NULL);
+
+ /* fall-through */
+
+ case EXCEPTION_HARDWARE_PATCHER:
+ if (p == NULL)
+ break;