Ticket #1393: tt_1393_debug_changes3.diff
File tt_1393_debug_changes3.diff, 4.6 KB (added by lithos, 12 years ago) |
---|
-
src/ops/object.ops
140 140 PObj_get_FLAGS(interp->current_cont) |= SUB_FLAG_TAILCALL; 141 141 /* Detach continuation from current CallContext to avoid marking dead object. */ 142 142 /* RetContinuation will kill itself after invoke */ 143 fprintf(stderr, "tailcallmethod PMC STR %d %d\n", 144 (interp->current_cont->vtable->base_type == enum_class_RetContinuation), 145 Parrot_pcc_do_run_ops(interp, method_pmc)); 143 146 if (interp->current_cont->vtable->base_type == enum_class_RetContinuation 144 147 && Parrot_pcc_do_run_ops(interp, method_pmc)) { 145 148 PMC * const ctx = CURRENT_CONTEXT(interp); … … 148 151 Parrot_pcc_set_continuation(interp, ctx, PMCNULL); 149 152 } 150 153 interp->current_object = object; 154 fprintf(stderr, "tailcallmethod PMC STR invoking with continuation %p\n", 155 (void*)interp->current_cont); 151 156 dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next); 152 157 } 153 158 goto ADDRESS(dest); -
src/pmc/retcontinuation.pmc
84 84 85 85 /* recycle this PMC and make sure it doesn't get marked */ 86 86 if (!PMC_IS_NULL(from_ctx)) 87 { 88 fprintf(stderr,"%s:%d: resetting continuation (SELF=%p) in context %p\n", 89 __FILE__, __LINE__, (void*)SELF, (void*)from_ctx); 87 90 Parrot_pcc_set_continuation(interp, from_ctx, NULL); 91 } 92 fprintf(stderr,"%s:%d: freeing myself (SELF=%p)\n", 93 __FILE__, __LINE__, (void*)SELF); 88 94 Parrot_gc_free_pmc_header(interp, SELF); 95 Parrot_gc_mark_and_sweep(interp, 0); 89 96 90 97 if (INTERP->code != seg) 91 98 Parrot_switch_to_cs(INTERP, seg, 1); -
src/pmc/sub.pmc
21 21 #include "parrot/oplib/ops.h" 22 22 #include "sub.str" 23 23 24 static unsigned debug_counter = 0; 25 24 26 static void 25 27 print_sub_name(PARROT_INTERP, ARGIN_NULLOK(PMC *sub)) 26 28 { … … 395 397 Parrot_pcc_init_context(INTERP, context, caller_ctx); 396 398 397 399 Parrot_pcc_set_sub(interp, context, SELF); 400 fprintf(stderr, "%d: %s:%d: setting continuation %p in context %p\n", 401 debug_counter++, __FILE__, __LINE__, (void*)ccont, (void*)context); 402 #if 0 403 if (debug_counter-1 == 2515) 404 abort(); 405 #endif 398 406 Parrot_pcc_set_continuation(interp, context, ccont); 399 407 Parrot_pcc_set_constants(interp, context, sub->seg->const_table->constants); 400 408 -
src/gc/api.c
242 242 { 243 243 ASSERT_ARGS(Parrot_gc_mark_PMC_alive_fun) 244 244 if (!PMC_IS_NULL(obj)) { 245 if (!PObj_is_PMC_TEST(obj)) 246 fprintf(stderr, "object at %p is not a PMC\n", (void*)obj); 245 247 PARROT_ASSERT(PObj_is_PMC_TEST(obj)); 246 248 247 249 if (PObj_is_live_or_free_TESTALL(obj)) -
src/sub.c
66 66 ASSERT_ARGS(new_ret_continuation_pmc) 67 67 PMC* const continuation = pmc_new(interp, enum_class_RetContinuation); 68 68 VTABLE_set_pointer(interp, continuation, address); 69 fprintf(stderr, "new ret continuation %p\n", (void*)continuation); 69 70 return continuation; 70 71 } 71 72 -
src/call/context_accessors.c
16 16 17 17 #include "parrot/parrot.h" 18 18 19 static unsigned debug_counter = 0; 20 19 21 /* HEADERIZER HFILE: include/parrot/context.h */ 20 22 21 23 /* HEADERIZER BEGIN: static */ … … 371 373 Parrot_pcc_set_continuation_func(PARROT_INTERP, ARGIN(PMC *ctx), ARGIN_NULLOK(PMC *_continuation)) 372 374 { 373 375 ASSERT_ARGS(Parrot_pcc_set_continuation_func) 376 if (_continuation && _continuation->vtable->base_type == enum_class_RetContinuation) 377 { 378 fprintf(stderr, "%d: setting continuation %p in context %p\n", 379 debug_counter++, (void*)_continuation, (void*)ctx); 380 } 374 381 Parrot_Context *c = get_context_struct_fast(interp, ctx); 375 382 c->current_cont = _continuation; 376 383 }