restore a fast path for a procedure chaperone
When the representation of a redirect changed, the fast path wasn't updated.
This commit is contained in:
parent
c73bcceafe
commit
e8073e699e
|
@ -3750,7 +3750,20 @@ Scheme_Object *scheme_apply_chaperone(Scheme_Object *o, int argc, Scheme_Object
|
||||||
/* communicate `self_proc` to the next layer: */
|
/* communicate `self_proc` to the next layer: */
|
||||||
scheme_current_thread->self_for_proc_chaperone = self_proc;
|
scheme_current_thread->self_for_proc_chaperone = self_proc;
|
||||||
}
|
}
|
||||||
return _scheme_tail_apply(px->prev, argc, argv);
|
if (checks) {
|
||||||
|
/* cannot return a tail call */
|
||||||
|
MZ_CONT_MARK_POS -= 2;
|
||||||
|
if (checks & 0x1) {
|
||||||
|
v = _scheme_apply(px->prev, argc, argv);
|
||||||
|
} else if (SAME_TYPE(SCHEME_TYPE(px->prev), scheme_native_closure_type)) {
|
||||||
|
v = _apply_native(px->prev, argc, argv);
|
||||||
|
} else {
|
||||||
|
v = _scheme_apply_multi(px->prev, argc, argv);
|
||||||
|
}
|
||||||
|
MZ_CONT_MARK_POS += 2;
|
||||||
|
return v;
|
||||||
|
} else
|
||||||
|
return _scheme_tail_apply(px->prev, argc, argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ensure that the original procedure accepts `argc' arguments: */
|
/* Ensure that the original procedure accepts `argc' arguments: */
|
||||||
|
|
|
@ -62,8 +62,9 @@ Scheme_Object *PRIM_APPLY_NAME(Scheme_Object *rator,
|
||||||
|
|
||||||
if (t == scheme_prim_type) {
|
if (t == scheme_prim_type) {
|
||||||
return PRIM_APPLY_NAME_FAST(rator, argc, argv);
|
return PRIM_APPLY_NAME_FAST(rator, argc, argv);
|
||||||
} if ((t == scheme_proc_chaperone_type)
|
} else if ((t == scheme_proc_chaperone_type)
|
||||||
&& SCHEME_MPAIRP(((Scheme_Chaperone *)rator)->redirects)) {
|
&& SCHEME_VECTORP(((Scheme_Chaperone *)rator)->redirects)
|
||||||
|
&& (SCHEME_VEC_SIZE(((Scheme_Chaperone *)rator)->redirects) & 0x1)) {
|
||||||
return scheme_apply_chaperone(rator, argc, argv, NULL, PRIM_CHECK_MULTI | (PRIM_CHECK_VALUE << 1));
|
return scheme_apply_chaperone(rator, argc, argv, NULL, PRIM_CHECK_MULTI | (PRIM_CHECK_VALUE << 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user