Ticket #551: pointerref.patch
File pointerref.patch, 4.9 KB (added by rg, 13 years ago) |
---|
-
src/vtable.tbl
63 63 void* get_pointer_keyed(PMC* key) 64 64 void* get_pointer_keyed_int(INTVAL key) 65 65 void* get_pointer_keyed_str(STRING* key) 66 void** get_pointerref() 66 67 67 68 [STORE] :write 68 69 void set_integer_native(INTVAL value) -
src/pmc/pointer.pmc
121 121 122 122 /* 123 123 124 =item C<void **get_pointerref()> 125 126 Returns the pointer address. 127 128 =cut 129 130 */ 131 132 VTABLE void **get_pointerref() { 133 return &PARROT_POINTER(SELF)->pointer; 134 } 135 136 /* 137 124 138 =item C<INTVAL get_integer()> 125 139 126 140 Returns the pointer value as an integer. -
src/jit/i386/jit_defs.c
2268 2268 case 'V': 2269 2269 emitm_call_cfunc(pc, get_nci_P); 2270 2270 emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 4); 2271 /* Call the get_pointer VTABLE on the Pointer PMC to get the returned pointer*/2271 /* Call the get_pointer VTABLE on the Pointer PMC to get the pointer address */ 2272 2272 emitm_movl_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1, offsetof(PMC, vtable)); 2273 emitm_movl_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1, offsetof(VTABLE, get_pointer ));2273 emitm_movl_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1, offsetof(VTABLE, get_pointerref)); 2274 2274 emitm_callr(pc, emit_EAX); 2275 2275 emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, args_offset); 2276 /* reset ESP(4) */ 2277 emitm_lea_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, st_offset); 2278 emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 4); 2276 2279 break; 2277 2280 case 'b': /* buffer (void*) pass PObj_bufstart(SReg) */ 2278 2281 emitm_call_cfunc(pc, get_nci_S); -
tools/build/nativecall.pl
353 353 }; 354 354 /V/ && do { 355 355 push @{$temps_ref}, "PMC *t_$temp_num;"; 356 push @{$temps_ref}, "void * v_$temp_num;";356 push @{$temps_ref}, "void **v_$temp_num;"; 357 357 push @{$extra_preamble_ref}, "t_$temp_num = GET_NCI_P($reg_num);"; 358 push @{$extra_preamble_ref}, "v_$temp_num = VTABLE_get_pointer (interp, t_$temp_num);";359 push @{$extra_postamble_ref}, "VTABLE_set_pointer(interp, t_$temp_num, v_$temp_num);";360 return " &v_$temp_num";358 push @{$extra_preamble_ref}, "v_$temp_num = VTABLE_get_pointerref(interp, t_$temp_num);"; 359 # push @{$extra_postamble_ref}, "VTABLE_set_pointer(interp, t_$temp_num, v_$temp_num);"; 360 return "v_$temp_num"; 361 361 }; 362 362 /[ilIscfdNS]/ && do { 363 363 my $ret_type = $sig_table{$_}{return_type}; -
lib/Parrot/Vtable.pm
398 398 my %typemap = ( 399 399 'STRING*' => 'Parrot_String', 400 400 'void*' => 'void*', 401 'void**' => 'void**', 401 402 'INTVAL' => 'Parrot_Int', 402 403 'PMC*' => 'Parrot_PMC', 403 404 'FLOATVAL' => 'Parrot_Float', -
lib/Parrot/Pmc2c/Parser.pm
213 213 214 214 my $returntype = ''; 215 215 216 if ($methodname =~ /(.*\s+\* ?)(\w+)/) {216 if ($methodname =~ /(.*\s+\*{0,2})(\w+)/) { 217 217 ($returntype, $methodname) = ($1, $2); 218 218 } 219 219 -
t/pmc/nci.t
2647 2647 3 2648 2648 OUTPUT 2649 2649 2650 {2651 local $TODO = 0;2652 if ($PConfig{jitcapable}){2653 $TODO = "TT #551 - jitted NCI sig with V is broken";2654 }2655 2650 pir_output_is( << 'CODE', << 'OUTPUT', "nci_vVi - void** out parameter" ); 2656 2651 .sub test :main 2657 2652 .local string library_name … … 2674 2669 CODE 2675 2670 got 10 2676 2671 OUTPUT 2677 }2678 2672 2679 2673 pir_output_is( << 'CODE', << 'OUTPUT', "nci_ttt - t_tt parameter" ); 2680 2674 .sub test :main … … 2712 2706 1 2713 2707 OUTPUT 2714 2708 2715 {2716 local $TODO = 0;2717 if ($PConfig{jitcapable}){2718 $TODO = "TT #551 - jitted NCI sig with V is broken";2719 }2720 2709 pir_output_is( << 'CODE', << 'OUTPUT', "nci_vV - char** out parameter" ); 2721 2710 .sub test :main 2722 2711 .local string library_name … … 2764 2753 It is a beautiful day! 2765 2754 Go suck a lemon. 2766 2755 OUTPUT 2767 }2768 2756 2769 2757 # Local Variables: 2770 2758 # mode: cperl