[svn:parrot] r40835 - in branches/context_pmc3: src t/pmc
whiteknight at svn.parrot.org
whiteknight at svn.parrot.org
Thu Aug 27 23:46:51 UTC 2009
Author: whiteknight
Date: Thu Aug 27 23:46:47 2009
New Revision: 40835
URL: https://trac.parrot.org/parrot/changeset/40835
Log:
[context_pmc3] hack fix for bacek++. YOU CANNOT UNSEE MY EVIL ONCE YOU HAVE SEEN IT
Modified:
branches/context_pmc3/src/scheduler.c
branches/context_pmc3/t/pmc/exceptionhandler.t
Modified: branches/context_pmc3/src/scheduler.c
==============================================================================
--- branches/context_pmc3/src/scheduler.c Thu Aug 27 22:16:46 2009 (r40834)
+++ branches/context_pmc3/src/scheduler.c Thu Aug 27 23:46:47 2009 (r40835)
@@ -873,22 +873,20 @@
iter = PMCNULL;
}
else {
+ ++already_doing;
- ++already_doing;
-
- /* Exceptions store the handler iterator for rethrow, other kinds of
- * tasks don't (though they could). */
- if (task->vtable->base_type == enum_class_Exception
- && VTABLE_get_integer_keyed_str(interp, task, handled_str) == -1) {
- iter = VTABLE_get_attr_str(interp, task, iter_str);
- context = (PMC *)VTABLE_get_pointer(interp, task);
- }
- else {
- context = CONTEXT(interp);
- if (!PMC_IS_NULL(CONTEXT_FIELD(interp, context, handlers)))
- iter = VTABLE_get_iter(interp, CONTEXT_FIELD(interp, context, handlers));
- }
-
+ /* Exceptions store the handler iterator for rethrow, other kinds of
+ * tasks don't (though they could). */
+ if (task->vtable->base_type == enum_class_Exception
+ && VTABLE_get_integer_keyed_str(interp, task, handled_str) == -1) {
+ iter = VTABLE_get_attr_str(interp, task, iter_str);
+ context = (PMC *)VTABLE_get_pointer(interp, task);
+ }
+ else {
+ context = CONTEXT(interp);
+ if (!PMC_IS_NULL(CONTEXT_FIELD(interp, context, handlers)))
+ iter = VTABLE_get_iter(interp, CONTEXT_FIELD(interp, context, handlers));
+ }
}
while (context) {
@@ -899,7 +897,11 @@
if (!PMC_IS_NULL(handler)) {
INTVAL valid_handler = 0;
- Parrot_PCCINVOKE(interp, handler, CONST_STRING(interp, "can_handle"),
+ if (handler->vtable->base_type == enum_class_Object)
+ Parrot_pcc_invoke_method_from_c_args(interp, handler, CONST_STRING(interp, "can_handle"),
+ "P->I", task, &valid_handler);
+ else
+ Parrot_PCCINVOKE(interp, handler, CONST_STRING(interp, "can_handle"),
"P->I", task, &valid_handler);
if (valid_handler) {
Modified: branches/context_pmc3/t/pmc/exceptionhandler.t
==============================================================================
--- branches/context_pmc3/t/pmc/exceptionhandler.t Thu Aug 27 22:16:46 2009 (r40834)
+++ branches/context_pmc3/t/pmc/exceptionhandler.t Thu Aug 27 23:46:47 2009 (r40835)
@@ -213,6 +213,7 @@
.sub can_handle :method
.param pmc ex
+ noop
.return(1)
.end
More information about the parrot-commits
mailing list