- p = trap_handle(type, val, pv, sp, ra, xpc, _p);
-
- /* Set registers. */
-
- switch (type) {
- case TRAP_COMPILER:
- if (p != NULL) {
- _gregs[REG_PV] = (uintptr_t) p;
-#if defined(__UCLIBC__)
- _gregs[CTX_EPC] = (uintptr_t) p;
-#else
- _mc->pc = (uintptr_t) p;
-#endif
- 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 = builtin_retrieve_exception();
-
- assert(p != NULL);
-
- /* fall-through */
-
- default:
- _gregs[REG_ITMP1_XPTR] = (uintptr_t) p;
- _gregs[REG_ITMP2_XPC] = (uintptr_t) xpc;
-#if defined(__UCLIBC__)
- _gregs[CTX_EPC] = (uintptr_t) asm_handle_exception;
-#else
- _mc->pc = (uintptr_t) asm_handle_exception;
-#endif
- }
+ trap_handle(type, val, pv, sp, ra, xpc, _p);