Beispiel #1
0
void clearException() {
    ExecEnv *ee = getExecEnv();

    if(ee->overflow) {
        ee->overflow = FALSE;
        ee->stack_end -= STACK_RED_ZONE_SIZE;
    }
    ee->exception = NULL;
}
Beispiel #2
0
Class *getCallerCallerClass() {
    Frame *last = getExecEnv()->last_frame->prev;

    if((last->mb == NULL && (last = last->prev)->prev == NULL) ||
             (last = getCallerFrame(last)) == NULL)
        return NULL;

    return last->mb->class;
}
Beispiel #3
0
void printException() {
    ExecEnv *ee = getExecEnv();
    Object *exception = ee->exception;

    if(exception != NULL) {
        MethodBlock *mb = lookupMethod(exception->class, SYMBOL(printStackTrace),
                                                         SYMBOL(___V));
        clearException();
        executeMethod(exception, mb);

        /* If we're really low on memory we might have been able to throw
         * OutOfMemory, but then been unable to print any part of it!  In
         * this case the VM just seems to stop... */
        if(ee->exception) {
            jam_fprintf(stderr, "Exception occurred while printing exception (%s)...\n",
                            CLASS_CB(ee->exception->class)->name);
            jam_fprintf(stderr, "Original exception was %s\n", CLASS_CB(exception->class)->name);
        }
Beispiel #4
0
void setException(Object *exp) {
    getExecEnv()->exception = exp;
}
Beispiel #5
0
Object *exceptionOccurred() {
   return getExecEnv()->exception; 
}