Author: Whiteknight
Date: Sat Nov 8 16:59:40 2008
New Revision: 32458
Modified:
branches/calling_conventions/include/parrot/enums.h
branches/calling_conventions/src/inter_call.c
branches/calling_conventions/src/multidispatch.c
Log:
[calling_conventions] make sure to add the invocant to the front of the call
signature. Added an adverb modifier "i" for invocants. Causes segfault.
Modified: branches/calling_conventions/include/parrot/enums.h
==============================================================================
--- branches/calling_conventions/include/parrot/enums.h (original)
+++ branches/calling_conventions/include/parrot/enums.h Sat Nov 8 16:59:40 2008
@@ -58,7 +58,8 @@
/* unused - 0x040 */
PARROT_ARG_OPTIONAL = 0x080, /* 128 */
PARROT_ARG_OPT_FLAG = 0x100, /* 256 prev optional was set */
- PARROT_ARG_NAME = 0x200 /* 512 this String is an arg name */
+ PARROT_ARG_NAME = 0x200, /* 512 this String is an arg name */
+ PARROT_ARG_INVOCANT = 0x400 /* 1024 this PMC is an invocant */
/* more to come soon */
} Call_bits_enum_t;
@@ -77,6 +78,7 @@
#define PARROT_ARG_OPTIONAL_ISSET(o) ((o) & PARROT_ARG_OPTIONAL)
#define PARROT_ARG_OPT_FLAG_ISSET(o) ((o) & PARROT_ARG_OPT_FLAG)
#define PARROT_ARG_NAME_ISSET(o) ((o) & PARROT_ARG_NAME)
+#define PARROT_ARG_INVOCANT(o) ((o) & PARROT_ARG_INVOCANT)
#endif /* PARROT_ENUMS_H_GUARD */
Modified: branches/calling_conventions/src/inter_call.c
==============================================================================
--- branches/calling_conventions/src/inter_call.c (original)
+++ branches/calling_conventions/src/inter_call.c Sat Nov 8 16:59:40 2008
@@ -2311,6 +2311,7 @@
case 's': cur |= PARROT_ARG_SLURPY_ARRAY; break;
case 'o': cur |= PARROT_ARG_OPTIONAL; break;
case 'p': cur |= PARROT_ARG_OPT_FLAG; break;
+ case 'i': cur |= PARROT_ARG_INVOCANT; break;
default:
Parrot_ex_throw_from_c_args(interp, NULL,
EXCEPTION_INVALID_OPERATION,
@@ -2387,6 +2388,7 @@
s slurpy
o optional
p opt flag
+ i invocant on a method
-> is the separator between args and results, similar to type theory
notation.
@@ -2421,7 +2423,7 @@
/* Set this flag to 1 if we are using the "new" unified version of this
function. The new version breaks the build and all sorts of tests,
so turn it off when you're done with it. */
-#define PARROT_PCCINVOKE_UNIFIED_FLAG 0
+#define PARROT_PCCINVOKE_UNIFIED_FLAG 1
#if PARROT_PCCINVOKE_UNIFIED_FLAG
Modified: branches/calling_conventions/src/multidispatch.c
==============================================================================
--- branches/calling_conventions/src/multidispatch.c (original)
+++ branches/calling_conventions/src/multidispatch.c Sat Nov 8 16:59:40 2008
@@ -588,9 +588,9 @@
if (PMC_IS_NULL(obj))
string_sig = s_sig;
else {
- STRING *invocant_sig = CONST_STRING(interp, "Pi");
+ STRING *invocant_sig = CONST_STRING(interp, "P");
string_sig = string_concat(interp, invocant_sig, s_sig, 0);
- sig_len = sig_len + 2;
+ sig_len = sig_len + 1;
has_invocant = 1;
}