Index: src/vtable.tbl =================================================================== --- src/vtable.tbl (revision 38199) +++ src/vtable.tbl (working copy) @@ -63,6 +63,7 @@ void* get_pointer_keyed(PMC* key) void* get_pointer_keyed_int(INTVAL key) void* get_pointer_keyed_str(STRING* key) +void** get_pointerref() [STORE] :write void set_integer_native(INTVAL value) Index: src/pmc/pointer.pmc =================================================================== --- src/pmc/pointer.pmc (revision 38199) +++ src/pmc/pointer.pmc (working copy) @@ -121,6 +121,20 @@ /* +=item C + +Returns the pointer address. + +=cut + +*/ + + VTABLE void **get_pointerref() { + return &PARROT_POINTER(SELF)->pointer; + } + +/* + =item C Returns the pointer value as an integer. Index: src/jit/i386/jit_defs.c =================================================================== --- src/jit/i386/jit_defs.c (revision 38199) +++ src/jit/i386/jit_defs.c (working copy) @@ -2268,11 +2268,14 @@ case 'V': emitm_call_cfunc(pc, get_nci_P); emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 4); - /* Call the get_pointer VTABLE on the Pointer PMC to get the returned pointer */ + /* Call the get_pointer VTABLE on the Pointer PMC to get the pointer address */ emitm_movl_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1, offsetof(PMC, vtable)); - emitm_movl_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1, offsetof(VTABLE, get_pointer)); + emitm_movl_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1, offsetof(VTABLE, get_pointerref)); emitm_callr(pc, emit_EAX); emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, args_offset); + /* reset ESP(4) */ + emitm_lea_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, st_offset); + emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 4); break; case 'b': /* buffer (void*) pass PObj_bufstart(SReg) */ emitm_call_cfunc(pc, get_nci_S); Index: tools/build/nativecall.pl =================================================================== --- tools/build/nativecall.pl (revision 38199) +++ tools/build/nativecall.pl (working copy) @@ -353,11 +353,11 @@ }; /V/ && do { push @{$temps_ref}, "PMC *t_$temp_num;"; - push @{$temps_ref}, "void *v_$temp_num;"; + push @{$temps_ref}, "void **v_$temp_num;"; push @{$extra_preamble_ref}, "t_$temp_num = GET_NCI_P($reg_num);"; - push @{$extra_preamble_ref}, "v_$temp_num = VTABLE_get_pointer(interp, t_$temp_num);"; - push @{$extra_postamble_ref}, "VTABLE_set_pointer(interp, t_$temp_num, v_$temp_num);"; - return "&v_$temp_num"; + push @{$extra_preamble_ref}, "v_$temp_num = VTABLE_get_pointerref(interp, t_$temp_num);"; +# push @{$extra_postamble_ref}, "VTABLE_set_pointer(interp, t_$temp_num, v_$temp_num);"; + return "v_$temp_num"; }; /[ilIscfdNS]/ && do { my $ret_type = $sig_table{$_}{return_type}; Index: lib/Parrot/Vtable.pm =================================================================== --- lib/Parrot/Vtable.pm (revision 38199) +++ lib/Parrot/Vtable.pm (working copy) @@ -398,6 +398,7 @@ my %typemap = ( 'STRING*' => 'Parrot_String', 'void*' => 'void*', + 'void**' => 'void**', 'INTVAL' => 'Parrot_Int', 'PMC*' => 'Parrot_PMC', 'FLOATVAL' => 'Parrot_Float', Index: lib/Parrot/Pmc2c/Parser.pm =================================================================== --- lib/Parrot/Pmc2c/Parser.pm (revision 38199) +++ lib/Parrot/Pmc2c/Parser.pm (working copy) @@ -213,7 +213,7 @@ my $returntype = ''; - if ($methodname =~ /(.*\s+\*?)(\w+)/) { + if ($methodname =~ /(.*\s+\*{0,2})(\w+)/) { ($returntype, $methodname) = ($1, $2); } Index: t/pmc/nci.t =================================================================== --- t/pmc/nci.t (revision 38199) +++ t/pmc/nci.t (working copy) @@ -2647,11 +2647,6 @@ 3 OUTPUT -{ - local $TODO = 0; - if ($PConfig{jitcapable}){ - $TODO = "TT #551 - jitted NCI sig with V is broken"; - } pir_output_is( << 'CODE', << 'OUTPUT', "nci_vVi - void** out parameter" ); .sub test :main .local string library_name @@ -2674,7 +2669,6 @@ CODE got 10 OUTPUT -} pir_output_is( << 'CODE', << 'OUTPUT', "nci_ttt - t_tt parameter" ); .sub test :main @@ -2712,11 +2706,6 @@ 1 OUTPUT -{ - local $TODO = 0; - if ($PConfig{jitcapable}){ - $TODO = "TT #551 - jitted NCI sig with V is broken"; - } pir_output_is( << 'CODE', << 'OUTPUT', "nci_vV - char** out parameter" ); .sub test :main .local string library_name @@ -2764,7 +2753,6 @@ It is a beautiful day! Go suck a lemon. OUTPUT -} # Local Variables: # mode: cperl