Author: leo
Date: Tue Jan 17 08:14:28 2006
New Revision: 11223
Modified:
trunk/compilers/imcc/pbc.c
trunk/src/inter_call.c
Log:
Calling conventions 2 - allow named constants
* named constants enabled on receiver site
* add some XXX comments
Modified: trunk/compilers/imcc/pbc.c
==============================================================================
--- trunk/compilers/imcc/pbc.c (original)
+++ trunk/compilers/imcc/pbc.c Tue Jan 17 08:14:28 2006
@@ -1059,11 +1059,12 @@ verify_signature(Interp *interpreter, In
n = VTABLE_elements(interpreter, sig_arr);
for (i = 0; i < n; ++i) {
r = ins->r[i + 1];
- if (no_consts && (r->type & VTCONST))
- IMCC_fatal(interpreter, 1, "e_pbc_emit: "
- "constant argument '%s' in get param/result\n",
- r->name);
sig = VTABLE_get_integer_keyed_int(interpreter, sig_arr, i);
+ if (! (sig & PARROT_ARG_NAME) &&
+ no_consts && (r->type & VTCONST))
+ IMCC_fatal(interpreter, 1, "e_pbc_emit: "
+ "constant argument '%s' in get param/result\n",
+ r->name);
if ((r->type & VTCONST) && !(sig & PARROT_ARG_CONSTANT)) {
if (!changed_sig)
changed_sig = VTABLE_clone(interpreter, sig_arr);
Modified: trunk/src/inter_call.c
==============================================================================
--- trunk/src/inter_call.c (original)
+++ trunk/src/inter_call.c Tue Jan 17 08:14:28 2006
@@ -669,8 +669,10 @@ parrot_pass_args(Interp *interpreter, p
}
interpreter->current_args = NULL;
}
- if (!dst_pc)
+ if (!dst_pc) {
+ /* XXX error checking */
return NULL;
+ }
todo = Parrot_init_arg_op(interpreter, dest_ctx, dst_pc, &st.dest);
Parrot_init_arg_op(interpreter, src_ctx, src_pc, &st.src);
st.opt_so_far = 0; /* XXX */
@@ -725,6 +727,9 @@ parrot_pass_args(Interp *interpreter, p
int i;
/* allow for optionals. */
for (i = 0; i < st.dest.n; i++) {
+ /* XXX this is wrong - dest.sig isn't fetched, it's
+ * just the last one
+ */
if (st.dest.sig & (PARROT_ARG_OPTIONAL|PARROT_ARG_OPT_FLAG))
min_expected_args--;
}