Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

make nci thunk lookup work with signature arrays, not strings

  • Loading branch information...
commit c74300b7fcfa0276f739d992fe961d57b540aedd 1 parent f3c2cd1
@plobsing plobsing authored
View
6 include/parrot/nci.h
@@ -13,7 +13,7 @@
#include "parrot/parrot.h"
-typedef PMC *(*nci_fb_func_t)(PARROT_INTERP, PMC *user_data, STRING *signature);
+typedef PMC *(*nci_fb_func_t)(PARROT_INTERP, PMC *user_data, PMC *signature);
typedef void (*nci_thunk_t)(PARROT_INTERP, PMC *, PMC *);
typedef void (*native_pcc_method_t)(PARROT_INTERP);
@@ -54,13 +54,13 @@ void Parrot_nci_load_extra_thunks(PARROT_INTERP);
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
PARROT_CANNOT_RETURN_NULL
-PMC * build_call_func(PARROT_INTERP, ARGIN(STRING *signature))
+PMC * build_call_func(PARROT_INTERP, ARGIN(PMC *sig))
__attribute__nonnull__(1)
__attribute__nonnull__(2);
#define ASSERT_ARGS_build_call_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
- , PARROT_ASSERT_ARG(signature))
+ , PARROT_ASSERT_ARG(sig))
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: src/nci/api.c */
View
1  src/global_setup.c
@@ -209,6 +209,7 @@ init_world(PARROT_INTERP)
VTABLE_set_pmc_keyed_int(interp, iglobals, IGLOBALS_DYN_LIBS, pmc);
pmc = Parrot_pmc_new(interp, enum_class_Hash);
+ VTABLE_set_pointer(interp, pmc, Parrot_hash_create(interp, enum_type_PMC, Hash_key_type_PMC));
VTABLE_set_pmc_keyed_int(interp, iglobals, IGLOBALS_NCI_FUNCS, pmc);
#if PARROT_HAS_CORE_NCI_THUNKS
Parrot_nci_load_core_thunks(interp);
View
21 src/nci/api.c
@@ -26,7 +26,7 @@ which builds parrot to C call frames.
/*
-=item C<PMC * build_call_func(PARROT_INTERP, STRING *signature)>
+=item C<PMC * build_call_func(PARROT_INTERP, PMC *sig)>
This function serves a single purpose. It takes the function signature for a
C function we want to call and returns a PMC with a pointer to a function
@@ -38,17 +38,14 @@ that can call it.
PARROT_CANNOT_RETURN_NULL
PMC *
-build_call_func(PARROT_INTERP, ARGIN(STRING *signature))
+build_call_func(PARROT_INTERP, ARGIN(PMC *sig))
{
ASSERT_ARGS(build_call_func)
- PMC * const iglobals = interp->iglobals;
- PMC *nci_funcs;
- PMC *thunk;
-
- /* fixup empty signatures */
- if (STRING_IS_EMPTY(signature))
- signature = CONST_STRING(interp, "v");
+ PMC * const iglobals = interp->iglobals;
+ PMC *nci_funcs;
+ PMC *thunk;
+ INTVAL hv;
if (PMC_IS_NULL(iglobals))
PANIC(interp, "iglobals isn't created yet");
@@ -57,7 +54,7 @@ build_call_func(PARROT_INTERP, ARGIN(STRING *signature))
if (PMC_IS_NULL(nci_funcs))
PANIC(interp, "iglobals.nci_funcs isn't created_yet");
- thunk = VTABLE_get_pmc_keyed_str(interp, nci_funcs, signature);
+ thunk = VTABLE_get_pmc_keyed(interp, nci_funcs, sig);
if (PMC_IS_NULL(thunk)) {
/* try to dynamically build a thunk */
@@ -67,7 +64,7 @@ build_call_func(PARROT_INTERP, ARGIN(STRING *signature))
nci_fb_func_t cb = (nci_fb_func_t)D2FPTR(cb_ptr);
if (cb_ptr) {
PMC *nci_fb_ud = VTABLE_get_pmc_keyed_int(interp, iglobals, IGLOBALS_NCI_FB_UD);
- thunk = cb(interp, nci_fb_ud, signature);
+ thunk = cb(interp, nci_fb_ud, sig);
}
}
}
@@ -79,7 +76,7 @@ build_call_func(PARROT_INTERP, ARGIN(STRING *signature))
Parrot_ex_throw_from_c_args(interp, NULL,
EXCEPTION_UNIMPLEMENTED,
- "No NCI thunk available for signature '%S'", signature);
+ "No NCI thunk available for signature '%Ss'", VTABLE_get_repr(interp, sig));
}
/*
View
220 src/nci/core_thunks.c
@@ -50,6 +50,7 @@ pcf_d_JOd(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
FLOATVAL t_2;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PiN", &t_1, &t_2);
@@ -74,6 +75,7 @@ pcf_I_JOS(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
STRING * t_2;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PiS", &t_1, &t_2);
@@ -98,6 +100,7 @@ pcf_P_JOl(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
INTVAL t_2;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PiI", &t_1, &t_2);
@@ -121,6 +124,7 @@ pcf_P_Jt(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * return_data;
char *t_1; STRING *ts_1;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "S", &ts_1);
t_1 = STRING_IS_NULL(ts_1) ? (char *)NULL : Parrot_str_to_cstring(interp, ts_1);
@@ -144,6 +148,7 @@ pcf_S_JOS(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
STRING * t_2;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PiS", &t_1, &t_2);
@@ -167,6 +172,7 @@ pcf_I_JI(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
INTVAL return_data;
INTVAL t_1;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "I", &t_1);
@@ -191,6 +197,7 @@ pcf_v_JOSP(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
STRING * t_2;
PMC * t_3;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PiSP", &t_1, &t_2, &t_3);
@@ -216,6 +223,7 @@ pcf_v_JOS(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
STRING * t_2;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PiS", &t_1, &t_2);
@@ -240,6 +248,7 @@ pcf_P_JOS(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
STRING * t_2;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PiS", &t_1, &t_2);
@@ -264,6 +273,7 @@ pcf_I_JOI(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
INTVAL t_2;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PiI", &t_1, &t_2);
@@ -288,6 +298,7 @@ pcf_P_JOP(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
PMC * t_2;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PiP", &t_1, &t_2);
@@ -313,6 +324,7 @@ pcf_P_JOPS(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
PMC * t_2;
STRING * t_3;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PiPS", &t_1, &t_2, &t_3);
@@ -340,6 +352,7 @@ pcf_v_JOPSP(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_2;
STRING * t_3;
PMC * t_4;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PiPSP", &t_1, &t_2, &t_3, &t_4);
@@ -367,6 +380,7 @@ pcf_v_JPPP(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
PMC * t_2;
PMC * t_3;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PPP", &t_1, &t_2, &t_3);
@@ -393,6 +407,7 @@ pcf_v_JPIP(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
INTVAL t_2;
PMC * t_3;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PIP", &t_1, &t_2, &t_3);
@@ -419,6 +434,7 @@ pcf_v_JPSP(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
STRING * t_2;
PMC * t_3;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PSP", &t_1, &t_2, &t_3);
@@ -445,6 +461,7 @@ pcf_v_JPNP(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
FLOATVAL t_2;
PMC * t_3;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PNP", &t_1, &t_2, &t_3);
@@ -470,6 +487,7 @@ pcf_v_JPP(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
PMC * t_2;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PP", &t_1, &t_2);
@@ -494,6 +512,7 @@ pcf_v_JPI(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
INTVAL t_2;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PI", &t_1, &t_2);
@@ -518,6 +537,7 @@ pcf_v_JPS(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
STRING * t_2;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PS", &t_1, &t_2);
@@ -542,6 +562,7 @@ pcf_v_JPN(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
FLOATVAL t_2;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PN", &t_1, &t_2);
@@ -567,6 +588,7 @@ pcf_P_JPPP(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
PMC * t_2;
PMC * t_3;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PPP", &t_1, &t_2, &t_3);
@@ -593,6 +615,7 @@ pcf_P_JPIP(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
INTVAL t_2;
PMC * t_3;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PIP", &t_1, &t_2, &t_3);
@@ -619,6 +642,7 @@ pcf_P_JPSP(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
STRING * t_2;
PMC * t_3;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PSP", &t_1, &t_2, &t_3);
@@ -645,6 +669,7 @@ pcf_P_JPNP(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
FLOATVAL t_2;
PMC * t_3;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PNP", &t_1, &t_2, &t_3);
@@ -670,6 +695,7 @@ pcf_I_JPP(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
PMC * t_2;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PP", &t_1, &t_2);
@@ -694,6 +720,7 @@ pcf_I_JPS(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
STRING * t_2;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PS", &t_1, &t_2);
@@ -718,6 +745,7 @@ pcf_I_JPN(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
FLOATVAL t_2;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PN", &t_1, &t_2);
@@ -741,6 +769,7 @@ pcf_i_JP(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
INTVAL return_data;
PMC * t_1;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "P", &t_1);
@@ -763,6 +792,7 @@ pcf_v_JP(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
void * return_data;
PMC * t_1;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "P", &t_1);
@@ -786,6 +816,7 @@ pcf_i_JPi(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
INTVAL t_2;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PI", &t_1, &t_2);
@@ -811,6 +842,7 @@ pcf_i_JPii(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
INTVAL t_2;
INTVAL t_3;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PII", &t_1, &t_2, &t_3);
@@ -838,6 +870,7 @@ pcf_i_JPiii(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
INTVAL t_2;
INTVAL t_3;
INTVAL t_4;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PIII", &t_1, &t_2, &t_3, &t_4);
@@ -864,6 +897,7 @@ pcf_i_JPt(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
char *t_2; STRING *ts_2;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PS", &t_1, &ts_2);
t_2 = STRING_IS_NULL(ts_2) ? (char *)NULL : Parrot_str_to_cstring(interp, ts_2);
@@ -890,6 +924,7 @@ pcf_P_JOSSS(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
STRING * t_2;
STRING * t_3;
STRING * t_4;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PiSSS", &t_1, &t_2, &t_3, &t_4);
@@ -917,6 +952,7 @@ pcf_v_JOSS(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
STRING * t_2;
STRING * t_3;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PiSS", &t_1, &t_2, &t_3);
@@ -942,6 +978,7 @@ pcf_S_JOI(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
INTVAL t_2;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PiI", &t_1, &t_2);
@@ -966,6 +1003,7 @@ pcf_v_JOb(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
STRING *t_2;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PiS", &t_1, &t_2);
@@ -991,6 +1029,7 @@ pcf_i_JOPxAT_(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
PMC * t_2;
PMC * t_3;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PiPPs", &t_1, &t_2, &t_3);
@@ -1017,6 +1056,7 @@ pcf_I_JOPxAT_(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
PMC * t_2;
PMC * t_3;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PiPPs", &t_1, &t_2, &t_3);
@@ -1044,6 +1084,7 @@ pcf_I_JOIPxAT_(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
INTVAL t_2;
PMC * t_3;
PMC * t_4;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PiIPPs", &t_1, &t_2, &t_3, &t_4);
@@ -1069,6 +1110,7 @@ pcf_P_JO(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * return_data;
PMC * t_1;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "Pi", &t_1);
@@ -1092,6 +1134,7 @@ pcf_v_JOP(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * t_1;
PMC * t_2;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "PiP", &t_1, &t_2);
@@ -1115,6 +1158,7 @@ pcf_P_Ji(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
PMC * return_data;
INTVAL t_1;
+ UNUSED(ret_object);
UNUSED(return_data); /* Potentially unused, at least */
Parrot_pcc_fill_params_from_c_args(interp, call_object, "I", &t_1);
@@ -1140,179 +1184,267 @@ Parrot_nci_load_core_thunks(PARROT_INTERP)
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_d_JOd);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "dJOd"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "dJOd")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_I_JOS);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "IJOS"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "IJOS")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_P_JOl);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "PJOl"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "PJOl")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_P_Jt);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "PJt"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "PJt")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_S_JOS);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "SJOS"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "SJOS")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_I_JI);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "IJI"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "IJI")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_v_JOSP);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "vJOSP"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "vJOSP")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_v_JOS);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "vJOS"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "vJOS")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_P_JOS);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "PJOS"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "PJOS")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_I_JOI);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "IJOI"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "IJOI")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_P_JOP);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "PJOP"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "PJOP")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_P_JOPS);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "PJOPS"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "PJOPS")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_v_JOPSP);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "vJOPSP"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "vJOPSP")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_v_JPPP);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "vJPPP"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "vJPPP")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_v_JPIP);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "vJPIP"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "vJPIP")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_v_JPSP);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "vJPSP"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "vJPSP")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_v_JPNP);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "vJPNP"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "vJPNP")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_v_JPP);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "vJPP"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "vJPP")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_v_JPI);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "vJPI"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "vJPI")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_v_JPS);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "vJPS"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "vJPS")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_v_JPN);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "vJPN"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "vJPN")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_P_JPPP);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "PJPPP"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "PJPPP")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_P_JPIP);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "PJPIP"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "PJPIP")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_P_JPSP);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "PJPSP"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "PJPSP")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_P_JPNP);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "PJPNP"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "PJPNP")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_I_JPP);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "IJPP"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "IJPP")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_I_JPS);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "IJPS"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "IJPS")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_I_JPN);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "IJPN"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "IJPN")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_i_JP);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "iJP"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "iJP")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_v_JP);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "vJP"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "vJP")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_i_JPi);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "iJPi"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "iJPi")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_i_JPii);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "iJPii"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "iJPii")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_i_JPiii);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "iJPiii"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "iJPiii")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_i_JPt);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "iJPt"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "iJPt")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_P_JOSSS);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "PJOSSS"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "PJOSSS")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_v_JOSS);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "vJOSS"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "vJOSS")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_S_JOI);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "SJOI"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "SJOI")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_v_JOb);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "vJOb"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "vJOb")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_i_JOPxAT_);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "iJOP@"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "iJOP@")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_I_JOPxAT_);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "IJOP@"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "IJOP@")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_I_JOIPxAT_);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "IJOIP@"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "IJOIP@")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_P_JO);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "PJO"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "PJO")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_v_JOP);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "vJOP"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "vJOP")),
+ temp_pmc);
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)pcf_P_Ji);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "PJi"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "PJi")),
+ temp_pmc);
}
View
1,270 src/nci/extra_thunks.c
1,016 additions, 254 deletions not shown
View
2  src/nci/signatures.c
@@ -45,7 +45,7 @@ Parrot_nci_parse_signature(PARROT_INTERP, ARGIN(STRING *sig_str))
size_t i;
- PMC * const sig_pmc = Parrot_pmc_new(interp, enum_class_ResizableIntegerArray);
+ PMC *sig_pmc = Parrot_pmc_new(interp, enum_class_ResizableIntegerArray);
for (i = 0; i < sig_length; ++i) {
const INTVAL c = Parrot_str_indexed(interp, sig_str, i);
View
2  src/pmc/nci.pmc
@@ -65,7 +65,7 @@ build_func(PARROT_INTERP, ARGIN(PMC *obj), ARGMOD(Parrot_NCI_attributes *nci))
nci->arity = VTABLE_elements(interp, nci->signature) - 1;
/* Build call function. */
- nci->fb_info = build_call_func(interp, nci->sig_str);
+ nci->fb_info = build_call_func(interp, nci->signature);
nci->func = F2DPTR(VTABLE_get_pointer(interp, nci->fb_info));
PARROT_GC_WRITE_BARRIER(interp, obj);
View
4 tools/dev/nci_thunk_gen.pir
@@ -458,7 +458,9 @@ HEADER
$S0 = 'sprintf'(<<'TEMPLATE', fn_name, key)
temp_pmc = Parrot_pmc_new(interp, enum_class_UnManagedStruct);
VTABLE_set_pointer(interp, temp_pmc, (void *)%s);
- VTABLE_set_pmc_keyed_str(interp, nci_funcs, CONST_STRING(interp, "%s"), temp_pmc);
+ VTABLE_set_pmc_keyed(interp, nci_funcs,
+ Parrot_nci_parse_signature(interp, string_from_literal(interp, "%s")),
+ temp_pmc);
TEMPLATE
code = concat code, $S0
Please sign in to comment.
Something went wrong with that request. Please try again.