void eval_current(void) { int tag; next_node(); tag = tag_of(input); switch(tag) { case TAG_CD: eval_cd(); break; case TAG_PRIMITIVE: ((primitive*)input)->block(); break; case TAG_SYMBOL: eval_symbol(); break; case TAG_INT: case TAG_ARRAY: case TAG_STRING: case TAG_NIL: case TAG_CONTEXT: execute_waiter(); break; case TAG_I_S: push(wait_stack,((inp_stub*)input)->func); break; default: printf("evaluated object of unknown tag:%i ",tag); break; } check_gc(0.5 KB); }
void next_node(void) { if(tag_of(current) != TAG_CCELL || current->cdr == NULL) { current = pop(callstack); if(tag_of(current)==TAG_CCELL) input = current->car; else input = current; } else { current = current->cdr; input = current->car; } }
debug_command_return debug_lisp_registers(ExceptionInformation *xp, siginfo_t *info, int arg) { if (lisp_debugger_in_foreign_code == false) { #ifdef PPC TCR *xpcontext = (TCR *)ptr_from_lispobj(xpGPR(xp, rcontext)); fprintf(dbgout, "rcontext = 0x%lX ", xpcontext); if (!active_tcr_p(xpcontext)) { fprintf(dbgout, "(INVALID)\n"); } else { fprintf(dbgout, "\nnargs = %d\n", xpGPR(xp, nargs) >> fixnumshift); show_lisp_register(xp, "fn", fn); show_lisp_register(xp, "arg_z", arg_z); show_lisp_register(xp, "arg_y", arg_y); show_lisp_register(xp, "arg_x", arg_x); show_lisp_register(xp, "temp0", temp0); show_lisp_register(xp, "temp1/next_method_context", temp1); show_lisp_register(xp, "temp2/nfn", temp2); show_lisp_register(xp, "temp3/fname", temp3); /* show_lisp_register(xp, "new_fn", new_fn); */ show_lisp_register(xp, "save0", save0); show_lisp_register(xp, "save1", save1); show_lisp_register(xp, "save2", save2); show_lisp_register(xp, "save3", save3); show_lisp_register(xp, "save4", save4); show_lisp_register(xp, "save5", save5); show_lisp_register(xp, "save6", save6); show_lisp_register(xp, "save7", save7); } #endif #ifdef X8664 show_lisp_register(xp, "arg_z", Iarg_z); show_lisp_register(xp, "arg_y", Iarg_y); show_lisp_register(xp, "arg_x", Iarg_x); fprintf(dbgout,"------\n"); show_lisp_register(xp, "fn", Ifn); fprintf(dbgout,"------\n"); show_lisp_register(xp, "save0", Isave0); show_lisp_register(xp, "save1", Isave1); show_lisp_register(xp, "save2", Isave2); show_lisp_register(xp, "save3", Isave3); fprintf(dbgout,"------\n"); show_lisp_register(xp, "temp0", Itemp0); show_lisp_register(xp, "temp1", Itemp1); show_lisp_register(xp, "temp2", Itemp2); fprintf(dbgout,"------\n"); if (tag_of(xpGPR(xp,Inargs)) == tag_fixnum) { fprintf(dbgout,"%%rcx (nargs) = %ld (maybe)\n", unbox_fixnum(xpGPR(xp,Inargs)&0xffff)); } #endif #ifdef X8632 show_lisp_register(xp, "arg_z", Iarg_z); show_lisp_register(xp, "arg_y", Iarg_y); fprintf(dbgout,"------\n"); show_lisp_register(xp, "fn", Ifn); fprintf(dbgout,"------\n"); show_lisp_register(xp, "temp0", Itemp0); show_lisp_register(xp, "temp1", Itemp1); fprintf(dbgout,"------\n"); if (tag_of(xpGPR(xp,Inargs)) == tag_fixnum) { fprintf(dbgout,"%%edx (nargs) = %d (maybe)\n", unbox_fixnum(xpGPR(xp,Inargs))); } #endif #ifdef ARM TCR *xpcontext = (TCR *)ptr_from_lispobj(xpGPR(xp, rcontext)); fprintf(dbgout, "rcontext = 0x%lX ", xpcontext); if (!active_tcr_p(xpcontext)) { fprintf(dbgout, "(INVALID)\n"); } else { fprintf(dbgout, "\nnargs = %d\n", xpGPR(xp, nargs) >> fixnumshift); show_lisp_register(xp, "fn", Rfn); show_lisp_register(xp, "arg_z", arg_z); show_lisp_register(xp, "arg_y", arg_y); show_lisp_register(xp, "arg_x", arg_x); show_lisp_register(xp, "temp0", temp0); show_lisp_register(xp, "temp1/fname/next_method_context", temp1); show_lisp_register(xp, "temp2/nfn", temp2); } #endif }
void sprint_gvector(LispObj o, int depth) { LispObj header = header_of(o); unsigned elements = header_element_count(header), subtag = header_subtag(header); switch(subtag) { case subtag_function: sprint_function(o, depth); break; case subtag_symbol: sprint_symbol(o); break; case subtag_struct: case subtag_istruct: add_c_string("#<"); sprint_lisp_object(deref(o,1), depth); add_c_string(" @"); sprint_unsigned_hex(o); add_c_string(">"); break; case subtag_simple_vector: { int i; add_c_string("#("); for(i = 1; i <= elements; i++) { if (i > 1) { add_char(' '); } sprint_lisp_object(deref(o, i), depth); } add_char(')'); break; } case subtag_instance: { LispObj class_or_hash = deref(o,1); if (tag_of(class_or_hash) == tag_fixnum) { sprint_random_vector(o, subtag, elements); } else { add_c_string("#<CLASS "); sprint_lisp_object(class_or_hash, depth); add_c_string(" @"); sprint_unsigned_hex(o); add_c_string(">"); } break; } default: sprint_random_vector(o, subtag, elements); break; } }
void operator()(T const& value) { to_stream_dispatch(value, tag_of(boost::addressof(value))); this->m_Stream.flush(); }