Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Some of my tests on unrolling the runloop. Plus my new tool for build…

…ing nci_thunk's. Its not complete, but its underway.
  • Loading branch information...
commit ac87c894c1066b9ebd1220bc5c6a93e9a6445632 1 parent beb5efd
@ashgti authored
View
105 src/pmc/nci.pmc
@@ -1038,7 +1038,7 @@ class, the PMC arguments are shifted down.
else {
PMC *positional, *arg_iter;
STRING *void_return;
- void **values, **middle_man, **pcc_ptr, **pcc_value, **translation_pointers;
+ void **values, **middle_man = NULL, **pcc_ptr, **translation_pointers = NULL, **pcc_val = NULL;
void *return_data;
size_t count, i, j_offset;
char *tmp_sig;
@@ -1055,6 +1055,7 @@ class, the PMC arguments are shifted down.
if (!cif && !func)
Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_INVALID_OPERATION,
+
"attempt to call NULL function");
}
@@ -1070,55 +1071,50 @@ class, the PMC arguments are shifted down.
pcc_values_size = 0;
values_size = 0;
pcc_argc = Parrot_str_length(interp, nci_info->pcc_params_signature);
- /* Add up the size of the pcc arguments */
- for (i = 0; i < pcc_argc; i++) {
- pcc_args[i + 3] = &ffi_type_pointer;
- if (tmp_sig[i] == 'N')
- pcc_values_size += sizeof(FLOATVAL);
- else if (tmp_sig[i] == 'I')
- pcc_values_size += sizeof(INTVAL);
- else if (tmp_sig[i] == 'P' || tmp_sig[i] == 'S')
- pcc_values_size += sizeof(void*);
- }
/* Add up the size of memory needed for the actual call */
for (i = 0; i < (size_t)nci_info->arity; i++) {
values_size += cif->arg_types[i]->size;
}
- if (ffi_prep_cif(&pcc_cif, FFI_DEFAULT_ABI, 3 + pcc_argc,
- &ffi_type_void, pcc_args) != FFI_OK) {
- Parrot_ex_throw_from_c_args(INTERP, NULL,
- EXCEPTION_INVALID_OPERATION,
- "Bad signature generated for Parrot_pcc_fill_params_from_c_args in NCI");
- }
-
- fprintf(stderr, "Allocating... %s %d %d\n", tmp_sig, values_size, pcc_values_size + sizeof(void*));
-
- pcc_ptr = (void**)mem_internal_allocate_n_zeroed_typed(pcc_argc, void*);
- pcc_value = (void**)mem_internal_allocate_zeroed(pcc_values_size + sizeof(void*));
+ pcc_ptr = (void**)mem_internal_allocate_n_zeroed_typed(pcc_argc + 4, void*);
/* Setup Parrot_pcc_fill_params_from_c_args required arguments */
pcc_ptr[0] = &interp;
pcc_ptr[1] = &call_object;
pcc_ptr[2] = &tmp_sig;
+ pcc_val = (void**)mem_internal_allocate_n_zeroed_typed(pcc_argc, void*);
values = (void**)mem_internal_allocate_zeroed(values_size + sizeof(void*));
/* Middle man is used to contain */
middle_man = mem_internal_allocate_n_zeroed_typed(nci_info->arity, void*);
- /* Fill in arg references, J is magically inserted, so we need
- * to offset the other variables if a J is supposed to be used
- */
- pcc_values_offset = 0;
+ /* Add up the size of the pcc arguments */
for (i = 0; i < pcc_argc; i++) {
- pcc_ptr[i + 3] = &pcc_value[i + pcc_values_offset];
+ pcc_args[i + 3] = &ffi_type_pointer;
if (tmp_sig[i] == 'N') {
- pcc_values_offset += 1;
+ pcc_val[i] = malloc(sizeof(FLOATVAL));
+ pcc_ptr[i+3] = &pcc_val[i];
+ }
+ else if (tmp_sig[i] == 'I') {
+ pcc_val[i] = malloc(sizeof(INTVAL));
+ pcc_ptr[i+3] = &pcc_val[i];
+ }
+ else if (tmp_sig[i] == 'P' || tmp_sig[i] == 'S') {
+ pcc_val[i] = malloc(sizeof(void*));
+ pcc_ptr[i+3] = &pcc_val[i];
}
}
+
+ if (ffi_prep_cif(&pcc_cif, FFI_DEFAULT_ABI, 3 + pcc_argc,
+ &ffi_type_void, pcc_args) != FFI_OK) {
+ Parrot_ex_throw_from_c_args(INTERP, NULL,
+ EXCEPTION_INVALID_OPERATION,
+ "Bad signature generated for Parrot_pcc_fill_params_from_c_args in NCI");
+ }
ffi_call(&pcc_cif, FFI_FN(Parrot_pcc_fill_params_from_c_args), NULL, pcc_ptr);
+
Parrot_str_free_cstring(tmp_sig);
/*
@@ -1137,97 +1133,98 @@ class, the PMC arguments are shifted down.
j_offset++;
break;
case 't':
- if (STRING_IS_NULL((STRING*)pcc_value[i - j_offset])) {
+ if (STRING_IS_NULL(*(STRING**)pcc_val[i - j_offset])) {
translation_pointers[i] = (char*) NULL;
}
else {
- translation_pointers[i] = Parrot_str_to_cstring(interp, (STRING*)pcc_value[i - j_offset]);
+ translation_pointers[i] = Parrot_str_to_cstring(interp, *(STRING**)pcc_val[i - j_offset]);
}
values[i] = &translation_pointers[i];
break;
case 'B':
- if (STRING_IS_NULL((STRING*)pcc_value[i - j_offset])) {
+ if (STRING_IS_NULL(*(STRING**)pcc_val[i - j_offset])) {
translation_pointers[i] = (char*) NULL;
}
else {
- translation_pointers[i] = Parrot_str_to_cstring(interp, (STRING*)pcc_value[i - j_offset]);
+ translation_pointers[i] = Parrot_str_to_cstring(interp, *(STRING**)pcc_val[i - j_offset]);
}
middle_man[i] = &translation_pointers[i];
values[i] = &middle_man[i];
break;
case 'b':
- values[i] = &Buffer_bufstart((STRING*)pcc_value[i - j_offset]);
+ values[i] = &Buffer_bufstart(*(STRING**)pcc_val[i - j_offset]);
break;
case 'c':
translation_pointers[i] = mem_internal_allocate_zeroed_typed(char);
- *((char**)translation_pointers)[i] = (char)*(INTVAL*)pcc_ptr[i + 3 - j_offset];
+ *((char**)translation_pointers)[i] = (char)*(INTVAL*)pcc_val[i - j_offset];
values[i] = translation_pointers[i];
break;
case '2':
translation_pointers[i] = mem_internal_allocate_zeroed_typed(pmc_holder_t);
- ((pmc_holder_t*)translation_pointers[i])->p = *(PMC**)pcc_ptr[i - j_offset];
+ ((pmc_holder_t*)translation_pointers[i])->p = *(PMC**)pcc_val[i - j_offset];
((pmc_holder_t*)translation_pointers[i])->ival = (INTVAL*)mem_internal_allocate_zeroed_typed(short);
*((pmc_holder_t*)translation_pointers[i])->ival = (short)VTABLE_get_integer(interp, *(PMC**)pcc_ptr[i - j_offset]);
values[i] = &((pmc_holder_t*)translation_pointers[i])->ival;
break;
case 's':
translation_pointers[i] = mem_internal_allocate_zeroed_typed(short);
- *((short**)translation_pointers)[i] = (short)*(INTVAL*)pcc_ptr[i - j_offset];
+ *((short**)translation_pointers)[i] = (short)*(INTVAL*)pcc_val[i - j_offset];
values[i] = translation_pointers[i];
break;
case '3':
translation_pointers[i] = mem_internal_allocate_zeroed_typed(pmc_holder_t);
- ((pmc_holder_t*)translation_pointers[i])->p = *(PMC**)pcc_ptr[i - j_offset];
+ ((pmc_holder_t*)translation_pointers[i])->p = *(PMC**)pcc_val[i - j_offset];
((pmc_holder_t*)translation_pointers[i])->ival = (INTVAL*)mem_internal_allocate_zeroed_typed(int);
- *((pmc_holder_t*)translation_pointers[i])->ival = (int)VTABLE_get_integer(interp, *(PMC**)pcc_ptr[i - j_offset]);
+ *((pmc_holder_t*)translation_pointers[i])->ival = (int)VTABLE_get_integer(interp, *(PMC**)pcc_val[i - j_offset]);
values[i] = &((pmc_holder_t*)translation_pointers[i])->ival;
break;
case 'i':
translation_pointers[i] = mem_internal_allocate_zeroed_typed(int);
- *((int**)translation_pointers)[i] = (int)*(INTVAL*)pcc_ptr[i - j_offset];
+ *((int**)translation_pointers)[i] = (int)*(INTVAL*)pcc_val[i - j_offset];
values[i] = translation_pointers[i];
break;
case '4':
translation_pointers[i] = mem_internal_allocate_zeroed_typed(pmc_holder_t);
- ((pmc_holder_t*)translation_pointers[i])->p = *(PMC**)pcc_ptr[i - j_offset];
+ ((pmc_holder_t*)translation_pointers[i])->p = *(PMC**)pcc_val[i - j_offset];
((pmc_holder_t*)translation_pointers[i])->ival = (INTVAL*)mem_internal_allocate_zeroed_typed(long);
- *((pmc_holder_t*)translation_pointers[i])->ival = (long)VTABLE_get_integer(interp, *(PMC**)pcc_ptr[i - j_offset]);
+ *((pmc_holder_t*)translation_pointers[i])->ival = (long)VTABLE_get_integer(interp, *(PMC**)pcc_val[i - j_offset]);
values[i] = &((pmc_holder_t*)translation_pointers[i])->ival;
break;
case 'l':
translation_pointers[i] = mem_internal_allocate_zeroed_typed(long);
- *((long**)translation_pointers)[i] = (long)*(INTVAL*)pcc_ptr[i - j_offset];
+ *((long**)translation_pointers)[i] = (long)*(INTVAL*)pcc_val[i - j_offset];
values[i] = translation_pointers[i];
break;
case 'q':
translation_pointers[i] = mem_internal_allocate_zeroed_typed(long long);
- *((long long**)translation_pointers)[i] = (long long)*(INTVAL*)pcc_ptr[i - j_offset];
+ *((long long**)translation_pointers)[i] = (long long)*(INTVAL*)pcc_val[i - j_offset];
values[i] = translation_pointers[i];
break;
case 'V':
translation_pointers[i] = mem_internal_allocate_zeroed_typed(pmc_holder_t);
- ((pmc_holder_t*)translation_pointers[i])->p = *(PMC**)pcc_ptr[i - j_offset];
+ ((pmc_holder_t*)translation_pointers[i])->p = *(PMC**)pcc_val[i - j_offset];
((pmc_holder_t*)translation_pointers[i])->pval = (void**)mem_internal_allocate_zeroed_typed(void*);
- *((pmc_holder_t*)translation_pointers[i])->pval = (void*)VTABLE_get_pointer(interp, *(PMC**)pcc_ptr[i - j_offset]);
+ *((pmc_holder_t*)translation_pointers[i])->pval = PMC_IS_NULL(*(PMC**)pcc_ptr[i - j_offset]) ?
+ (void *)NULL : (void*)VTABLE_get_pointer(interp, *(PMC**)pcc_val[i - j_offset]);
values[i] = &((pmc_holder_t*)translation_pointers[i])->pval;
break;
case 'P':
- translation_pointers[i] = pcc_value[i - j_offset];
+ translation_pointers[i] = *(PMC**)pcc_val[i - j_offset];
values[i] = &translation_pointers[i];
break;
case 'p':
- translation_pointers[i] = PMC_IS_NULL((PMC*)pcc_value[i - j_offset]) ?
- (void *)NULL : VTABLE_get_pointer(interp, (PMC*)pcc_value[i - j_offset]);
+ translation_pointers[i] = PMC_IS_NULL(*(PMC**)pcc_ptr[i - j_offset]) ?
+ (void *)NULL : VTABLE_get_pointer(interp, *(PMC**)pcc_val[i - j_offset]);
values[i] = &translation_pointers[i];
break;
case 'f':
translation_pointers[i] = mem_internal_allocate_zeroed_typed(float);
- *((float**)translation_pointers)[i] = (float)*(FLOATVAL*)pcc_ptr[i - j_offset];
+ *((float**)translation_pointers)[i] = (float)*(FLOATVAL*)pcc_val[i - j_offset];
values[i] = translation_pointers[i];
break;
case 'd':
translation_pointers[i] = mem_internal_allocate_zeroed_typed(double);
- *((double**)translation_pointers)[i] = *(FLOATVAL*)pcc_ptr[i - j_offset];
+ *((double**)translation_pointers)[i] = *(FLOATVAL*)pcc_val[i - j_offset];
values[i] = translation_pointers[i];
break;
case ' ':
@@ -1242,8 +1239,11 @@ class, the PMC arguments are shifted down.
if (pcc_ptr) {
mem_sys_free(pcc_ptr);
}
- if (pcc_value) {
- mem_sys_free(pcc_value);
+ if (pcc_val) {
+ for (i = 0; i < pcc_argc; i++) {
+ mem_sys_free(pcc_val[i]);
+ }
+ mem_sys_free(pcc_val);
}
}
else {
@@ -1500,3 +1500,4 @@ Updates by John Harrison, Summer 2010, GSoC.
*/
+
View
40 test.ll
@@ -0,0 +1,40 @@
+@.LC0 = internal constant [13 x i8] c"Hello World\0A\00"
+
+declare i32 @puts(i8*)
+
+declare i8* @Parrot_new(i8*)
+declare i8* @Parrot_get_params_pc(i8*, i8*)
+declare void @Parrot_init_stacktop(i8*, i8**)
+declare void @Parrot_set_config_hash()
+declare i8* @Parrot_str_new(i8*, i8*, i64)
+declare void @Parrot_set_executable_name(i8*, i8*)
+declare void @Parrot_set_flag(i8*, i64)
+declare i8* @PackFile_new(i8*, i64)
+
+define i32 @main(i32 %argc, i8** nocapture %argv) nounwind ssp {
+ %cast210 = getelementptr [13 x i8]* @.LC0, i64 0, i64 0
+
+ %interp = call i8* @Parrot_new(i8* null)
+
+ %interp.addr = alloca i8*, align 4
+ store i8* %interp, i8** %interp.addr
+ call void @Parrot_init_stacktop(i8* %interp, i8** %interp.addr)
+ call void @Parrot_set_config_hash()
+ %exe_name.addr = load i8** %argv
+ %exe_name = call i8* @Parrot_str_new(i8* %interp, i8* %exe_name.addr, i64 0)
+ call void @Parrot_set_executable_name(i8* %interp, i8* %exe_name)
+ call void @Parrot_set_flag(i8* %interp, i64 512)
+
+ %pf = call i8* @PackFile_new(i8* %interp, i64 0)
+
+ do_sub_progmas(interp )
+
+
+ call i32 @puts(i8* %cast210)
+
+
+ ret i32 0
+}
+
+!1 = metadata !{i32 41}
+!foo = !{!1, null}
View
148 test.o.ll
@@ -0,0 +1,148 @@
+; ModuleID = 'test.o'
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
+target triple = "x86_64-apple-darwin10.0.0"
+
+%struct.GC_Subsystem = type opaque
+%struct.Memory_Pools = type opaque
+%struct.PDB = type { %struct.PDB_file*, %struct.PDB_breakpoint*, %struct.PDB_condition*, i64, i8*, i8*, i64*, i32, %struct.parrot_interp_t*, %struct.parrot_interp_t*, i64, %struct.__sFILE*, i64 }
+%struct.PDB_breakpoint = type { i64*, i64, i64, %struct.PDB_condition*, %struct.PDB_breakpoint*, %struct.PDB_breakpoint* }
+%struct.PDB_condition = type { i16, i8, i8, i8*, %struct.PDB_condition* }
+%struct.PDB_file = type { i8*, i8*, i64, i64, %struct.PDB_line*, %struct.PDB_label*, %struct.PDB_file* }
+%struct.PDB_label = type { i64*, i64, %struct.PDB_label* }
+%struct.PDB_line = type { i64*, i64, i64, %struct.PDB_label*, %struct.PDB_line* }
+%struct.PMC = type { i64, %struct._vtable*, i8*, %struct.PMC* }
+%struct.PackFile = type { %struct.PackFile_Directory, %struct.PackFile_Directory*, i64*, i64, i64, %struct.PackFile_Header*, [7 x %struct.PackFile_funcs], %struct.PackFile_ByteCode*, i64, i64, i64, i64 (i8*)*, i64 (i8*)*, void (i8*, i8*)* }
+%struct.PackFile_Annotations = type { %struct.PackFile_Segment, i64, %struct.PackFile_Annotations_Group*, i64, %struct.PackFile_Annotations_Group*, i64, %struct.PackFile_Annotations_Entry*, %struct.PackFile_ByteCode* }
+%struct.PackFile_Annotations_Entry = type { i64, i64, i64 }
+%struct.PackFile_Annotations_Group = type { i64, i64 }
+%struct.PackFile_ByteCode = type { %struct.PackFile_Segment, %struct.PackFile_Debug*, %struct.PackFile_ConstTable*, %struct.PackFile_FixupTable*, %struct.PackFile_Annotations* }
+%struct.PackFile_ConstTable = type { %struct.PackFile_Segment, i64, %struct.PackFile_Constant**, %struct.PackFile_ByteCode*, %struct.PMC* }
+%struct.PackFile_Constant = type { i64, %union.anon }
+%struct.PackFile_Debug = type { %struct.PackFile_Segment, i64, %struct.PackFile_Annotations_Group*, %struct.PackFile_ByteCode* }
+%struct.PackFile_Directory = type { %struct.PackFile_Segment, i64, %struct.PackFile_Segment** }
+%struct.PackFile_FixupEntry = type { i64, i8*, i64 }
+%struct.PackFile_FixupTable = type { %struct.PackFile_Segment, i64, %struct.PackFile_FixupEntry*, %struct.PackFile_ByteCode* }
+%struct.PackFile_Header = type { [8 x i8], i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8*, i64 }
+%struct.PackFile_Segment = type { %struct.PackFile*, %struct.PackFile_Directory*, i64, %struct.parrot_string_t*, i64, i64, i64, i64, i64, i64* }
+%struct.PackFile_funcs = type { %struct.PackFile_Segment* (%struct.parrot_interp_t*, %struct.PackFile*, %struct.parrot_string_t*, i32)*, void (%struct.parrot_interp_t*, %struct.PackFile_Segment*)*, i64 (%struct.parrot_interp_t*, %struct.PackFile_Segment*)*, i64* (%struct.parrot_interp_t*, %struct.PackFile_Segment*, i64*)*, i64* (%struct.parrot_interp_t*, %struct.PackFile_Segment*, i64*)*, void (%struct.parrot_interp_t*, %struct.PackFile_Segment*)* }
+%struct.QUEUE = type opaque
+%struct._Caches = type { i64, %struct._meth_cache_entry*** }
+%struct._ParrotIOData = type opaque
+%struct._Thread_data = type { %struct._opaque_pthread_t*, i64, i32, i64, %struct.parrot_interp_t*, %struct._opaque_pthread_mutex_t, %struct._opaque_pthread_cond_t, %struct._hash* }
+%struct.__darwin_pthread_handler_rec = type { void (i8*)*, i8*, %struct.__darwin_pthread_handler_rec* }
+%struct.__sFILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
+%struct.__sFILEX = type opaque
+%struct.__sbuf = type { i8*, i32 }
+%struct._charset = type { i8*, %struct.parrot_string_t* (%struct.parrot_interp_t*, %struct.parrot_string_t*, i64, i64)*, %struct.parrot_string_t* (%struct.parrot_interp_t*, %struct.parrot_string_t*)*, %struct.parrot_string_t* (%struct.parrot_interp_t*, %struct.parrot_string_t*)*, %struct.parrot_string_t* (%struct.parrot_interp_t*, %struct.parrot_string_t*)*, %struct.parrot_string_t* (%struct.parrot_interp_t*, %struct.parrot_string_t*)*, %struct.parrot_string_t* (%struct.parrot_interp_t*, %struct.parrot_string_t*)*, %struct.parrot_string_t* (%struct.parrot_interp_t*, %struct.parrot_string_t*)*, %struct.parrot_string_t* (%struct.parrot_interp_t*, %struct.parrot_string_t*)*, %struct.parrot_string_t* (%struct.parrot_interp_t*, %struct.parrot_string_t*)*, %struct.parrot_string_t* (%struct.parrot_interp_t*, %struct.parrot_string_t*)*, i64 (%struct.parrot_interp_t*, %struct.parrot_string_t*, %struct.parrot_string_t*)*, i64 (%struct.parrot_interp_t*, %struct.parrot_string_t*, %struct.parrot_string_t*, i64)*, i64 (%struct.parrot_interp_t*, %struct.parrot_string_t*, %struct.parrot_string_t*, i64)*, i64 (%struct.parrot_interp_t*, %struct.parrot_string_t*)*, i64 (%struct.parrot_interp_t*, i64, %struct.parrot_string_t*, i64)*, i64 (%struct.parrot_interp_t*, i64, %struct.parrot_string_t*, i64, i64)*, i64 (%struct.parrot_interp_t*, i64, %struct.parrot_string_t*, i64, i64)*, %struct.parrot_string_t* (%struct.parrot_interp_t*, i64)*, i64 (%struct.parrot_interp_t*, %struct.parrot_string_t*, i64)*, %struct._encoding* }
+%struct._encoding = type { i8*, i64, %struct.parrot_string_t* (%struct.parrot_interp_t*, %struct.parrot_string_t*)*, i64 (%struct.parrot_interp_t*, %struct.parrot_string_t*, i64)*, i64 (%struct.parrot_interp_t*, %struct.parrot_string_t*, i64)*, void (%struct.parrot_interp_t*, %struct.parrot_string_t*, i64, i64)*, %struct.parrot_string_t* (%struct.parrot_interp_t*, %struct.parrot_string_t*, i64, i64)*, %struct.parrot_string_t* (%struct.parrot_interp_t*, %struct.parrot_string_t*, i64, i64)*, i64 (%struct.parrot_interp_t*, %struct.parrot_string_t*)*, i64 (%struct.parrot_interp_t*, %struct.parrot_string_t*)*, void (%struct.parrot_interp_t*, %struct.parrot_string_t*, %struct.string_iterator_t*)*, i64 (%struct.parrot_interp_t*, %struct.parrot_string_t*, i64*, i64, i64, i64)*, i64 (%struct.parrot_interp_t*, %struct.parrot_string_t*, i64)* }
+%struct._handler_node_t = type { void (%struct.parrot_interp_t*, i32, i8*)*, i8*, %struct._handler_node_t* }
+%struct._hash = type { %struct._hashbucket*, %struct._hashbucket**, %struct._hashbucket*, i64, i64, %struct.PMC*, i32, i32, i64, i32 (%struct.parrot_interp_t*, i8*, i8*)*, i64 (%struct.parrot_interp_t*, i8*, i64)* }
+%struct._hashbucket = type { %struct._hashbucket*, i8*, i8* }
+%struct._imc_info_t = type opaque
+%struct._meth_cache_entry = type { i8*, %struct.PMC*, %struct._meth_cache_entry* }
+%struct._opaque_pthread_cond_t = type { i64, [40 x i8] }
+%struct._opaque_pthread_mutex_t = type { i64, [56 x i8] }
+%struct._opaque_pthread_t = type { i64, %struct.__darwin_pthread_handler_rec*, [1168 x i8] }
+%struct._vtable = type { %struct.PMC*, i64, %struct.parrot_string_t*, i64, %struct.parrot_string_t*, %struct._hash*, %struct.PMC*, %struct.PMC*, i8*, %struct._vtable*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, double, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, i64, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*)*, i64 (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, i64 (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, i64 (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, i64 (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*)*, i64 (%struct.parrot_interp_t*, %struct.PMC*)*, i64 (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, i64 (%struct.parrot_interp_t*, %struct.PMC*, i64)*, i64 (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, i64)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*)*, void (%struct.parrot_interp_t*, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, double, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, i64, %struct.PMC*)*, i64 (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*)*, i64 (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, i64 (%struct.parrot_interp_t*, %struct.PMC*)*, i64 (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, i64 (%struct.parrot_interp_t*, %struct.PMC*, i64)*, i64 (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, double, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, i64, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*, %struct.parrot_string_t*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*)*, i64 (%struct.parrot_interp_t*, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*)*, i64 (%struct.parrot_interp_t*, %struct.PMC*)*, i64 (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, i64 (%struct.parrot_interp_t*, %struct.PMC*, i64)*, i64 (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*)*, double (%struct.parrot_interp_t*, %struct.PMC*)*, double (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, double (%struct.parrot_interp_t*, %struct.PMC*, i64)*, double (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, i64)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*)*, i8* (%struct.parrot_interp_t*, %struct.PMC*)*, i8* (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, i8* (%struct.parrot_interp_t*, %struct.PMC*, i64)*, i8* (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*)*, %struct.parrot_string_t* (%struct.parrot_interp_t*, %struct.PMC*)*, %struct.parrot_string_t* (%struct.parrot_interp_t*, %struct.PMC*)*, %struct.parrot_string_t* (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, %struct.parrot_string_t* (%struct.parrot_interp_t*, %struct.PMC*, i64)*, %struct.parrot_string_t* (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*)*, i64 (%struct.parrot_interp_t*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, double)*, void (%struct.parrot_interp_t*, %struct.PMC*, i64)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, double)*, void (%struct.parrot_interp_t*, %struct.PMC*, i64)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, double)*, void (%struct.parrot_interp_t*, %struct.PMC*, i64)*, void (%struct.parrot_interp_t*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, double)*, void (%struct.parrot_interp_t*, %struct.PMC*, i64)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, double)*, void (%struct.parrot_interp_t*, %struct.PMC*, i64)*, void (%struct.parrot_interp_t*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, i64)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, double)*, void (%struct.parrot_interp_t*, %struct.PMC*, i64)*, void (%struct.parrot_interp_t*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, i64)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, i64* (%struct.parrot_interp_t*, %struct.PMC*, i8*)*, i64 (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, i64 (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, i64 (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, i64 (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, i64 (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*)*, i64 (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, double, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, i64, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, double, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, i64, %struct.PMC*)*, %struct.parrot_string_t* (%struct.parrot_interp_t*, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, double (%struct.parrot_interp_t*, %struct.PMC*)*, i64 (%struct.parrot_interp_t*, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*)*, %struct.parrot_string_t* (%struct.parrot_interp_t*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, double)*, void (%struct.parrot_interp_t*, %struct.PMC*, i64)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, i64, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*, %struct.parrot_string_t*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, i64)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*, i64)*, void (%struct.parrot_interp_t*, %struct.PMC*, i64, i64)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*, i64)*, void (%struct.parrot_interp_t*, %struct.PMC*, i64)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*, double)*, void (%struct.parrot_interp_t*, %struct.PMC*, i64, double)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*, double)*, void (%struct.parrot_interp_t*, %struct.PMC*, double)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, i64, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, i8*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*, i8*)*, void (%struct.parrot_interp_t*, %struct.PMC*, i64, i8*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*, i8*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*, %struct.parrot_string_t*)*, void (%struct.parrot_interp_t*, %struct.PMC*, i64, %struct.parrot_string_t*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*, %struct.parrot_string_t*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*)*, double (%struct.parrot_interp_t*, %struct.PMC*)*, i64 (%struct.parrot_interp_t*, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*)*, %struct.parrot_string_t* (%struct.parrot_interp_t*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*, i64, i64)*, void (%struct.parrot_interp_t*, %struct.PMC*, i64, i64, %struct.PMC*)*, %struct.parrot_string_t* (%struct.parrot_interp_t*, %struct.PMC*, i64, i64)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, double, %struct.PMC*)*, %struct.PMC* (%struct.parrot_interp_t*, %struct.PMC*, i64, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, i64 (%struct.parrot_interp_t*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, double)*, void (%struct.parrot_interp_t*, %struct.PMC*, i64)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.parrot_string_t*)*, void (%struct.parrot_interp_t*, %struct.PMC*, %struct.PMC*)*, i64 }
+%struct.op_info_t = type { i8*, i8*, i8*, i16, i16, [16 x i32], [16 x i32], [16 x i8] }
+%struct.op_lib_t = type { i8*, i8*, i32, i32, i32, i32, i32, i64, %struct.op_info_t*, i64* (i64*, %struct.parrot_interp_t*)**, i32 (%struct.parrot_interp_t*, i8*, i32)* }
+%struct.parrot_interp_t = type { %struct.PMC*, %struct.Memory_Pools*, %struct.GC_Subsystem*, %struct.PMC*, %struct.PMC*, %struct._vtable**, i32, i32, %struct._ParrotIOData*, %struct.op_lib_t*, i64, %struct.op_info_t*, i64* (i64*, %struct.parrot_interp_t*)**, i64* (i64*, %struct.parrot_interp_t*)**, i64* (i64*, %struct.parrot_interp_t*)**, i32, %struct.op_lib_t**, i64, i64, %struct.runcore_t*, %struct.runcore_t**, i64, i64, i64, %struct.PackFile_ByteCode*, %struct.PackFile*, %struct._imc_info_t*, i8*, %struct.PDB*, %struct.PMC*, i8*, %struct.parrot_interp_t*, i64, i64, %struct.PMC*, %struct.PMC*, %struct.PMC*, %struct.PMC*, %struct.PMC*, %struct._hash*, %struct._Caches*, %struct.parrot_string_t**, %struct._hash*, %struct.QUEUE*, %struct._handler_node_t*, i32, %struct.parrot_runloop_t*, %struct.parrot_runloop_t*, i32, i32, %struct._Thread_data*, i64, %struct.PMC* }
+%struct.parrot_runloop_t = type { %struct.parrot_runloop_t*, i64*, i32, [37 x i32] }
+%struct.parrot_string_t = type { i64, i8*, i64, i8*, i64, i64, i64, %struct._encoding*, %struct._charset* }
+%struct.runcore_t = type opaque
+%struct.string_iterator_t = type { %struct.parrot_string_t*, i64, i64, i64 (%struct.parrot_interp_t*, %struct.string_iterator_t*)*, void (%struct.parrot_interp_t*, %struct.string_iterator_t*, i64)*, void (%struct.parrot_interp_t*, %struct.string_iterator_t*, i64)* }
+%union.anon = type { i64 }
+
+@.str = private constant [3137 x i8] c"\FEPBC\0D\0A\1A\0A\08\00\00\02\05\00\06\15\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\80\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\04\00\00\00\00\00\00\00\04\00\00\00\00\00\00\00BYTECODE_test.pir\00\00\00\00\00\00\00$\00\00\00\00\00\00\004\00\00\00\00\00\00\00\02\00\00\00\00\00\00\00FIXUP_test.pir\00\00X\00\00\00\00\00\00\00\0C\00\00\00\00\00\00\00\03\00\00\00\00\00\00\00CONSTANT_test.pir\00\00\00\00\00\00\00d\00\00\00\00\00\00\00\0A\01\00\00\00\00\00\00\05\00\00\00\00\00\00\00BYTECODE_test.pir_DB\00\00\00\00n\01\00\00\00\00\00\00\1A\00\00\00\00\00\00\004\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00/\00\00\00\00\00\00\00!\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00e\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\22\00\00\00\00\00\00\00\03\00\00\00\00\00\00\00\1D\00\00\00\00\00\00\00\AF\02\00\00\00\00\00\00\00\00\00\00\00\00\00\00\0F\00\00\00\00\00\00\00\BC\02\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\15\03\00\00\00\00\00\00\00\00\00\00\00\00\00\00\11\00\00\00\00\00\00\00m\01\00\00\00\00\00\00\01\00\00\00\00\00\00\00 \00\00\00\00\00\00\00\13\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\04\02\00\00\00\00\00\00\01\00\00\00\00\00\00\00\0E\00\00\00\00\00\00\00#\00\00\00\00\00\00\00\0C\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\B2\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\06\00\00\00\00\00\00\00\F6\FF\FF\FF\FF\FF\FF\FF \00\00\00\00\00\00\00\0C\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\C0\02\00\00\00\00\00\00\00\00\00\00\00\00\00\00\09\00\00\00\00\00\00\00\19\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00#\00\00\00\00\00\00\00\03\00\00\00\00\00\00\00\22\00\00\00\00\00\00\00\0A\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\1D\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\0C\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\02\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00foo\00\00\00\00\00\09\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00main\00\00\00\00\15\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\0A\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\16\00\00\00\00\00\00\00p\00\00\00\00\00\00\00\00\02\00\00\00\00\00\00\98\02\00\00\00\00\00\00\FEPBC\0D\0A\1A\0A\08\00\00\02\05\00\06\15\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\04\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00$\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\0C\00\00\00\00\00\00\00 \00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\00\00\00\00\02\00\00\00\00\00\00\00\9F\FF\FF\FF\FF\FF\FF\FF\01\00\00\00\00\00\00\00\06\00\00\00\00\00\00\00parrot\00\00\10\00\00\00\00\00\00\001\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\02\00\00\00\00\00\00\00\011\00\00\00\00\00\00\14\00\00\00\00\00\00\001\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\00\00\00\00\18\00\00\00\00\00\00\00L\00\00\00\00\00\00\00\1C\00\00\00\00\00\00\001\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\15\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\00\00\00\00 \00\00\00\00\00\00\00L\00\00\00\00\00\00\00$\00\00\00\00\00\00\001\00\00\00\00\00\00\00\11\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\06\00\00\00\00\00\00\00parrot\00\00\01\00\00\00\00\00\00\00\04\00\00\00\00\00\00\00(\00\00\00\00\00\00\00L\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00,\00\00\00\00\00\00\00 \00\00\00\00\00\00\000\00\00\00\00\00\00\00J\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\02\00\00\00\00\00\00\00\011\00\00\00\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\00\00\00\00\01\00\00\00\00\00\00\004\00\00\00\00\00\00\00L\00\00\00\00\00\00\00\01\00\00\00\00\00\00\008\00\00\00\00\00\00\00J\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\06\00\00\00\00\00\00\00parrot\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\9C\FF\FF\FF\FF\FF\FF\FF\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\06\00\00\00\00\00\00\00io_ops\00\00\01\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00p\00\00\00\00\00\00\00\00\02\00\00\00\00\00\00H\00\00\00\00\00\00\00\FEPBC\0D\0A\1A\0A\08\00\00\02\05\00\06\15\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\04\00\00\00\00\00\00\00\17\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00s\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00(0x0002)p\00\00\00\00\00\00\00\00\02\00\00\00\00\00\00@\00\00\00\00\00\00\00\FEPBC\0D\0A\1A\0A\08\00\00\02\05\00\06\15\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\04\00\00\00\00\00\00\00\17\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00s\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\02\00\00\00\00\00\00\00()\00\00\00\00\00\00s\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00test.pirs\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\03\00\00\00\00\00\00\00foo\00\00\00\00\00s\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00s\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\06\00\00\00\00\00\00\00parrot\00\00p\00\00\00\00\00\00\00\00\02\00\00\00\00\00\00\C8\00\00\00\00\00\00\00\FEPBC\0D\0A\1A\0A\08\00\00\02\05\00\06\15\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\04\00\00\00\00\00\00\00\0D\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\06\00\00\00\00\00\00\00\07\00\00\00\00\00\00\00\06\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\FF\FF\FF\FF\FF\FF\FF\FF\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\06\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00p\00\00\00\00\00\00\00\00\02\00\00\00\00\00\00H\00\00\00\00\00\00\00\FEPBC\0D\0A\1A\0A\08\00\00\02\05\00\06\15\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\04\00\00\00\00\00\00\00\17\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00s\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00(0x0010)p\00\00\00\00\00\00\00\00\02\00\00\00\00\00\00H\00\00\00\00\00\00\00\FEPBC\0D\0A\1A\0A\08\00\00\02\05\00\06\15\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\04\00\00\00\00\00\00\00\17\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00s\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00(0x0001)s\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\00\00\00\00readline_interactive\00\00\00\00n\00\00\00\00\00\00\00\00\00\00\00\00\C0^@s\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\14\00\00\00\00\00\00\00Please enter \22foo\22: \00\00\00\00s\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\03\00\00\00\00\00\00\00bar\00\00\00\00\00s\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\0F\00\00\00\00\00\00\00(0x0002,0x0011)\00p\00\00\00\00\00\00\00\00\02\00\00\00\00\00\00P\00\00\00\00\00\00\00\FEPBC\0D\0A\1A\0A\08\00\00\02\05\00\06\15\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\04\00\00\00\00\00\00\00\17\00\00\00\00\00\00\00\02\00\00\00\00\00\00\00\02\00\00\00\00\00\00\00\11\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00s\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\04\00\00\00\00\00\00\00main\00\00\00\00p\00\00\00\00\00\00\00\00\02\00\00\00\00\00\00\C8\00\00\00\00\00\00\00\FEPBC\0D\0A\1A\0A\08\00\00\02\05\00\06\15\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\04\00\00\00\00\00\00\00\0D\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00/\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\14\00\00\00\00\00\00\00\07\00\00\00\00\00\00\00\14\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\FF\FF\FF\FF\FF\FF\FF\FF\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\02\00\00\00\00\00\00\00\02\00\00\00\00\00\00\00\14\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\1A\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\13\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\05\00\00\00\00\00\00\00\05\00\00\00\00\00\00\00\05\00\00\00\00\00\00\00\09\00\00\00\00\00\00\00\0A\00\00\00\00\00\00\00\0B\00\00\00\00\00\00\00\0D\00\00\00\00\00\00\00\0F\00\00\00\00\00\00\00\0F\00\00\00\00\00\00\00\0F\00\00\00\00\00\00\00\10\00\00\00\00\00\00\00\11\00\00\00\00\00\00\00\11\00\00\00\00\00\00\00\11\00\00\00\00\00\00\00\11\00\00\00\00\00\00\00\12\00\00\00\00\00\00\00\12\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\05\00\00\00\00\00\00\00\00" ; <[3137 x i8]*> [#uses=1]
+@program_code = global i8* getelementptr inbounds ([3137 x i8]* @.str, i64 0, i64 0), align 8 ; <i8**> [#uses=2]
+@bytecode_size = constant i32 3136, align 4 ; <i32*> [#uses=0]
+
+define i8* @get_program_code() nounwind readonly ssp {
+entry:
+ %tmp = load i8** @program_code ; <i8*> [#uses=1]
+ ret i8* %tmp
+}
+
+define i32 @main(i32 %argc, i8** %argv) nounwind ssp {
+entry:
+ %interp = alloca %struct.parrot_interp_t*, align 8 ; <%struct.parrot_interp_t**> [#uses=12]
+ %tmp.i = load i8** @program_code ; <i8*> [#uses=2]
+ %tobool = icmp eq i8* %tmp.i, null ; <i1> [#uses=1]
+ br i1 %tobool, label %return, label %if.end
+
+if.end: ; preds = %entry
+ call void @Parrot_set_config_hash() nounwind
+ %call1 = call %struct.parrot_interp_t* @Parrot_new(%struct.parrot_interp_t* null) nounwind ; <%struct.parrot_interp_t*> [#uses=3]
+ store %struct.parrot_interp_t* %call1, %struct.parrot_interp_t** %interp
+ %tobool3 = icmp eq %struct.parrot_interp_t* %call1, null ; <i1> [#uses=1]
+ br i1 %tobool3, label %return, label %if.end5
+
+if.end5: ; preds = %if.end
+ %conv = bitcast %struct.parrot_interp_t** %interp to i8* ; <i8*> [#uses=1]
+ call void @Parrot_init_stacktop(%struct.parrot_interp_t* %call1, i8* %conv) nounwind
+ %tmp7 = load %struct.parrot_interp_t** %interp ; <%struct.parrot_interp_t*> [#uses=2]
+ %tmp10 = load i8** %argv ; <i8*> [#uses=1]
+ %call11 = call %struct.parrot_string_t* @Parrot_str_new(%struct.parrot_interp_t* %tmp7, i8* %tmp10, i64 0) nounwind ; <%struct.parrot_string_t*> [#uses=1]
+ call void @Parrot_set_executable_name(%struct.parrot_interp_t* %tmp7, %struct.parrot_string_t* %call11) nounwind
+ %tmp12 = load %struct.parrot_interp_t** %interp ; <%struct.parrot_interp_t*> [#uses=1]
+ call void @Parrot_set_flag(%struct.parrot_interp_t* %tmp12, i64 512) nounwind
+ %tmp13 = load %struct.parrot_interp_t** %interp ; <%struct.parrot_interp_t*> [#uses=1]
+ %call14 = call %struct.PackFile* @PackFile_new(%struct.parrot_interp_t* %tmp13, i64 0) nounwind ; <%struct.PackFile*> [#uses=4]
+ %tobool16 = icmp eq %struct.PackFile* %call14, null ; <i1> [#uses=1]
+ br i1 %tobool16, label %return, label %if.end18
+
+if.end18: ; preds = %if.end5
+ %tmp19 = load %struct.parrot_interp_t** %interp ; <%struct.parrot_interp_t*> [#uses=1]
+ %0 = bitcast i8* %tmp.i to i64* ; <i64*> [#uses=1]
+ %call22 = call i64 @PackFile_unpack(%struct.parrot_interp_t* %tmp19, %struct.PackFile* %call14, i64* %0, i64 3136) nounwind ; <i64> [#uses=1]
+ %tobool23 = icmp eq i64 %call22, 0 ; <i1> [#uses=1]
+ br i1 %tobool23, label %return, label %if.end25
+
+if.end25: ; preds = %if.end18
+ %tmp26 = load %struct.parrot_interp_t** %interp ; <%struct.parrot_interp_t*> [#uses=1]
+ %tmp28 = getelementptr inbounds %struct.PackFile* %call14, i64 0, i32 7 ; <%struct.PackFile_ByteCode**> [#uses=1]
+ %tmp29 = load %struct.PackFile_ByteCode** %tmp28 ; <%struct.PackFile_ByteCode*> [#uses=1]
+ call void @do_sub_pragmas(%struct.parrot_interp_t* %tmp26, %struct.PackFile_ByteCode* %tmp29, i32 4, %struct.PMC* null) nounwind
+ %tmp30 = load %struct.parrot_interp_t** %interp ; <%struct.parrot_interp_t*> [#uses=1]
+ call void @Parrot_pbc_load(%struct.parrot_interp_t* %tmp30, %struct.PackFile* %call14) nounwind
+ %tmp32 = load %struct.parrot_interp_t** %interp ; <%struct.parrot_interp_t*> [#uses=1]
+ call void @PackFile_fixup_subs(%struct.parrot_interp_t* %tmp32, i32 1, %struct.PMC* null) nounwind
+ %tmp33 = load %struct.parrot_interp_t** %interp ; <%struct.parrot_interp_t*> [#uses=1]
+ ; call void @Parrot_runcode(%struct.parrot_interp_t* %tmp33, i32 %argc, i8** %argv) nounwind
+ %tmp36 = load %struct.parrot_interp_t** %interp ; <%struct.parrot_interp_t*> [#uses=1]
+ call void @Parrot_destroy(%struct.parrot_interp_t* %tmp36) nounwind
+ %tmp37 = load %struct.parrot_interp_t** %interp ; <%struct.parrot_interp_t*> [#uses=1]
+ call void @Parrot_exit(%struct.parrot_interp_t* %tmp37, i32 0) nounwind
+ ret i32 0
+
+return: ; preds = %if.end18, %if.end5, %if.end, %entry
+ ret i32 1
+}
+
+declare void @Parrot_set_config_hash()
+
+declare %struct.parrot_interp_t* @Parrot_new(%struct.parrot_interp_t*)
+
+declare void @Parrot_init_stacktop(%struct.parrot_interp_t*, i8*)
+
+declare void @Parrot_set_executable_name(%struct.parrot_interp_t*, %struct.parrot_string_t*)
+
+declare %struct.parrot_string_t* @Parrot_str_new(%struct.parrot_interp_t*, i8*, i64)
+
+declare void @Parrot_set_flag(%struct.parrot_interp_t*, i64)
+
+declare %struct.PackFile* @PackFile_new(%struct.parrot_interp_t*, i64)
+
+declare i64 @PackFile_unpack(%struct.parrot_interp_t*, %struct.PackFile*, i64*, i64)
+
+declare void @do_sub_pragmas(%struct.parrot_interp_t*, %struct.PackFile_ByteCode*, i32, %struct.PMC*)
+
+declare void @Parrot_pbc_load(%struct.parrot_interp_t*, %struct.PackFile*)
+
+declare void @PackFile_fixup_subs(%struct.parrot_interp_t*, i32, %struct.PMC*)
+
+declare void @Parrot_runcode(%struct.parrot_interp_t*, i32, i8**)
+
+declare void @Parrot_destroy(%struct.parrot_interp_t*)
+
+declare void @Parrot_exit(%struct.parrot_interp_t*, i32)
View
8 test.pasm
@@ -0,0 +1,8 @@
+ loadlib P1, ""
+#dlfunc P0, P1, "nci_tB", "tB"
+# set S5, "ko\n"
+#set_args "0", S5
+#invokecc P0
+#get_results "0", S5
+#print S5
+ end
View
19 test.pir
@@ -0,0 +1,19 @@
+.loadlib 'io_ops'
+
+.sub 'foo'
+ .param pmc bar
+ say bar
+.end
+
+.sub 'main' :main
+ $I0 = 123.0
+ $S0 = $I0
+ $S0 .= 'bar'
+
+ $P0 = getstdin
+readstuff:
+ $S1 = $P0.'readline_interactive'('Please enter "foo": ')
+ ne $S1, 'foo', readstuff
+ 'foo'($S0)
+ .return(0)
+.end
View
24 test.s
@@ -0,0 +1,24 @@
+ .section __TEXT,__text,regular,pure_instructions
+ .globl _main
+ .align 4, 0x90
+_main: ## @main
+## BB#0:
+ subq $8, %rsp
+ xorl %edi, %edi
+ callq _Parrot_new
+ movq %rax, (%rsp)
+ leaq (%rsp), %rsi
+ movq %rax, %rdi
+ callq _Parrot_init_stack
+ leaq _.LC0(%rip), %rdi
+ callq _puts
+ xorl %eax, %eax
+ addq $8, %rsp
+ ret
+
+ .section __TEXT,__cstring,cstring_literals
+_.LC0: ## @.LC0
+ .asciz "Hello World\n"
+
+
+.subsections_via_symbols
View
276 tools/dev/nci_thunk_gen.nqp
@@ -0,0 +1,276 @@
+pir::load_bytecode('nqp-setting.pbc');
+
+my $test := 1;
+
+grammar NCI-Thunk::Grammar {
+ token TOP { [\n? <signature> | [\#\N*] ]* }
+
+ token signature { <return> <args> }
+
+ token return { <identifer> }
+
+ token args { <identifer>* }
+
+ token identifer { <prefix> <symbol> }
+
+ token symbol { <[vpfdDbcsilqPV]> }
+
+ token prefix { <[*]>? <[u]>? }
+};
+
+=begin
+
+Sample NCI Thunk:
+
+static void
+pcf_d_JOd(PARROT_INTERP, PMC *nci, SHIM(PMC *self))
+{
+ typedef double(* func_t)(PARROT_INTERP, PMC *, double);
+ func_t fn_pointer;
+ void *orig_func;
+ PMC * ctx = CURRENT_CONTEXT(interp);
+ PMC * const call_object = Parrot_pcc_get_signature(interp, ctx);
+ PMC * ret_object = PMCNULL;
+ FLOATVAL return_data;
+
+ PMC * t_1;
+ FLOATVAL t_2;
+ UNUSED(return_data); /* Potentially unused, at least */
+ Parrot_pcc_fill_params_from_c_args(interp, call_object, "PiN", &t_1, &t_2);
+
+ GETATTR_NCI_orig_func(interp, nci, orig_func);
+ fn_pointer = (func_t)D2FPTR(orig_func);
+ return_data = (double)(*fn_pointer)(interp, t_1, t_2);
+ ret_object = Parrot_pcc_build_call_from_c_args(interp, call_object, "N", return_data);
+
+
+
+}
+=end
+
+class NCI-Thunk {
+ has $!sig;
+ has $!return;
+ has $!args;
+
+ method init($sig, $return, $args) {
+ my $r := NCI-Thunk.new;
+ $r.BUILD($sig, $return, $args);
+ return $r;
+ }
+
+ method BUILD($sig, $return, $args) {
+ $!sig := $sig;
+ $!return := $return;
+ $!args := $args;
+ say('args: ', $args);
+ }
+
+ class C-Type {
+ has $!pointer;
+ has $!size;
+ method set-pointer($p = 1) {
+ $!pointer := $p;
+ }
+ }
+
+ class C-Int is C-Type {
+ has $!signed;
+
+ my sub init_sizes() {
+ my %r;
+ %r<8> := 'char';
+ %r<c> := 'char';
+ %r<16> := 'short';
+ %r<s> := 'short';
+ %r<32> := 'int';
+ %r<i> := 'int';
+ %r<l> := 'long';
+ %r<64> := 'long long';
+ %r<q> := 'long long';
+ return %r;
+ }
+
+ our %sizes := init_sizes();
+
+ method set-signed() {
+ $!signed := 1;
+ }
+
+ method set-size(:$size!) {
+ # validate size:
+ # 8 - char
+ # 16 - short
+ # 32 - i int
+ # 32/64 - l long
+ # 64 - long long
+ $!size := %sizes{"$size"};
+ }
+
+ method Str() {
+ my $result;
+
+ if $!pointer {
+ $result := "* ";
+ }
+
+
+ }
+ }
+
+ class C-Num is C-Type {
+ method set-size(:$float, :$double, :$long-doule) {
+ if $float {
+ $!size := 'float';
+ }
+ elsif $double {
+ $!size := 'double';
+ }
+ elsif $long-double {
+ $!size := 'long double';
+ }
+ }
+
+ method Str() {
+ return $!state;
+ }
+ }
+
+ class C-Struct is C-Type {
+ }
+
+ our %type := hash(:i<int>, :q<long long>, :c<char>, );
+
+ my sub build_prototype($key) {
+ if $key ~~ /\{/ {
+ say('structure');
+ }
+ else {
+ say($key<prefix>);
+ say('normal type');
+ }
+
+
+ return %type{"$key"};
+ }
+
+ method Str() {
+ my $thunk := "
+static void
+pcf_" ~ $!return ~ '_' ~ $!args ~ '(PARROT_INTERP, PMC *nci, SHIM(PMC *self)) \{'; # add in proto types for all vars;
+ $thunk := $thunk ~ "
+ func_t fn_pointer;
+ void *orig_func;
+ PMC * ctx = CURRENT_CONTEXT(interp);
+ PMC * const call_object = Parrot_pcc_get_signature(interp, ctx);
+ PMC * ret_object = PMCNULL;
+ ";
+
+ if $!return ne 'v' {
+ $thunk := $thunk ~ build_prototype($!return) ~ " result;\n ";
+ }
+
+ $thunk := $thunk ~ "yo";
+
+ my $obj_count := 0;
+ for $!args<identifer> -> $a {
+ say($a);
+ }
+ say($!args<identifer>[0], 'and');
+ for $!args<identifer> -> $arg {
+ say("tes");
+ $thunk := $thunk ~ build_prototype($arg) ~ "\n";
+ }
+
+ if $!return ne 'v' {
+ $thunk := $thunk ~ 'grab result';
+ }
+ else {
+ $thunk := $thunk ~ 'ignore result';
+ }
+
+ $thunk := $thunk ~ "\n return;\n}";
+ return $thunk;
+ }
+}
+
+class NCI-Thunk::Actions {
+ has @!thunks;
+
+ method init() {
+ my $r := NCI-Thunk::Actions.new;
+ $r.BUILD();
+ return $r;
+ }
+
+ method BUILD() {
+ @!thunks := ();
+ }
+
+ method TOP($/) {
+ }
+ method return($/) {
+ }
+ method signature($/) {
+ my $sig := $/;
+ say('Sig is: ', $sig, ' and ', $<return>, ' arg: ', $<args>[0]);
+ @!thunks.push(NCI-Thunk.init($/, $<return>, $<args>));
+ }
+
+ method print_signature() {
+ for @!thunks -> $thunk {
+ say($thunk.Str);
+ }
+ return 'stuff' ~ +@!thunks;
+ }
+};
+
+
+sub tests() {
+ plan(11);
+
+ my $/;
+
+ $/ := NCI-Thunk::Grammar.parse("v");
+
+ ok($/<signature>[0]<return> eq 'v', 'Void with no args');
+
+ $/ := NCI-Thunk::Grammar.parse('vv');
+
+ ok($/<signature>[0]<return> eq 'v', 'Void with void args, return parsed');
+ ok($/<signature>[0]<args> eq 'v', 'Void with void args, args parsed');
+
+ $/ := NCI-Thunk::Grammar.parse('*v');
+
+ ok($/<signature>[0]<return><identifer><symbol> eq 'v', 'Still parses the symbol correctly');
+ ok($/<signature>[0]<return><identifer><prefix> eq '*', 'A void* works');
+
+ $/ := NCI-Thunk::Grammar.parse('iis');
+
+ ok($/<signature>[0]<args>, 'Parsed with multipe args correctly');
+ ok($/<signature>[0]<args><identifer>[0] eq 'i', 'First param is correct.');
+ ok($/<signature>[0]<args><identifer>[1] eq 's', 'Second param is correct.');
+
+ $/ := NCI-Thunk::Grammar.parse("vi\nvs\nis");
+
+ ok($/<signature>[0]<return> eq 'v' && $/<signature>[2]<return> eq 'i', "Multi-line Sig's parse");
+
+ $/ := NCI-Thunk::Grammar.parse("fi# comment is not parsed\nvi# foo");
+
+ ok($/<signature>[1]<return> eq 'v', "Comments parse correctly");
+
+ my $b := NCI-Thunk::Actions.init();
+
+ $/ := NCI-Thunk::Grammar.parse("vi*i", :actions($b));
+
+ my $c := pir::inspect__p_p($/);
+ say($c);
+ say($b.print_signature);
+ say($/.ast);
+}
+
+if $test {
+ tests();
+}
+
+# vim: ft=perl6
Please sign in to comment.
Something went wrong with that request. Please try again.