Commit 95c9f9b
committed
W26 Step B: emitAnyCall full conversion + 149b7e2 PartialConversion REABSORB
Per docs/w26-emitanycall-full-conversion.md (push 82) + theologian L2462
+ L2466 ((B) folded LITE SPECs design + iterator-bridge architecture).
Changes:
- Python/jit/hir/builder_emit_c.c: new C body
hir_builder_emit_any_call_c (~150 lines). Handles all 5 opcode paths
(CALL_FUNCTION/CALL_FUNCTION_KW, CALL_FUNCTION_EX, CALL/CALL_KW/
CALL_METHOD, INVOKE_FUNCTION, INVOKE_NATIVE, INVOKE_METHOD) plus the
await-tail dispatch INLINED (149b7e2 PartialConversion bridge body
REABSORBED into this C body — the bridge function and REABSORB-WHEN
comment block are REMOVED).
- Added cinder_opcode.h include BEFORE opcode.h (header-guard ordering
issue: both use Py_OPCODE_H, so cinder must come first to define
INVOKE_FUNCTION/_NATIVE/_METHOD).
- Added opcode_stubs.h for CALL_FUNCTION/CALL_FUNCTION_KW/CALL_KW/
CALL_METHOD/YIELD_FROM (3.10/3.11 opcodes stubbed at >=40000 in 3.12
so case labels remain valid but unreachable on 3.12 codepath).
- Python/jit/hir/builder.cpp: HIRBuilder::emitAnyCall becomes a
~30-line C++ stub that:
- Extracts opcode/oparg/baseOffset upfront (int values)
- Computes is_awaited via in-stub iterator peek + PY_VERSION_HEX
conditional
- Pre-extracts const_arg for INVOKE_* paths (NULL otherwise)
- Delegates to hir_builder_emit_any_call_c with opaque iterator +
bytecode block pointers (for in-C-body iterator advancement)
Adds 4 NEW C bridges (W26 inventory per theologian L2466):
- hir_builder_emit_call_method_exception_handler_inline_c: combined
findExceptionHandler + getSimpleExceptInfo + emitCallExceptionHandler
(folded per (B) decision; NULL-safe internally)
- hir_builder_check_async_with_error_c: bridges static checkAsyncWithError
via opaque iterator pointer
- hir_builder_bc_it_advance_and_opcode_c: combined ++bc_it + opcode read
for await-tail JIT_CHECK sequence
- hir_builder_bc_it_oparg_c: read bc_it->oparg() (used once for
load_const_oparg)
REMOVES: hir_builder_emit_awaited_call_tail_c declaration (was at
builder.cpp:2861-2867 with PartialConversion comment); body fully
inlined into the await-tail section of hir_builder_emit_any_call_c.
- Python/jit/hir/builder.h: extern "C" forward decls for the 4 new
bridges + 1 new friend declaration (combined exception-handler bridge
needs access to private findExceptionHandler/getSimpleExceptInfo/
emitCallExceptionHandler/code_).
W25c-mini compliance per supervisor L2441 refined invariant:
- Combined exception-handler bridge: opaque void* params (builder/tc/
cfg/call_instr/result_reg are opaque handles; base_offset is int).
- Iterator bridges: opaque void* bc_it/bc_instrs + int return.
- All NEW bridges typed at boundaries-with-typed-destinations; void*
intermediates allowed within all-void* call chains.
Empirical scope-reduction from spec §3 5-bridge estimate to 4 actual
NEW bridges (theologian L2466 confirmed): emitVariadic<VectorCall>,
emitCallMethod, kwnames_ all covered by EXISTING C primitives
(hir_c_create_vectorcall_reg, hir_c_create_call_method_reg,
hir_builder_get_kwnames/hir_builder_set_kwnames respectively).
Verification: cmake --build target jit/phoenix_jit clean (BUILD_EXIT=0).
PartialConversion artifact verified REMOVED:
grep "hir_builder_emit_awaited_call_tail_c" Python/jit/hir/*.{c,cpp,h}
→ 0 declarations + 0 implementations remain (only historical comments
explaining the reabsorb action are left).1 parent 0fdb658 commit 95c9f9b
3 files changed
Lines changed: 291 additions & 180 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2854 | 2854 | | |
2855 | 2855 | | |
2856 | 2856 | | |
2857 | | - | |
2858 | | - | |
2859 | | - | |
2860 | | - | |
2861 | | - | |
2862 | | - | |
2863 | | - | |
2864 | | - | |
2865 | | - | |
2866 | | - | |
2867 | | - | |
2868 | | - | |
2869 | | - | |
2870 | | - | |
2871 | | - | |
| 2857 | + | |
| 2858 | + | |
| 2859 | + | |
| 2860 | + | |
| 2861 | + | |
| 2862 | + | |
| 2863 | + | |
| 2864 | + | |
| 2865 | + | |
2872 | 2866 | | |
2873 | 2867 | | |
2874 | 2868 | | |
| 2869 | + | |
| 2870 | + | |
| 2871 | + | |
| 2872 | + | |
| 2873 | + | |
| 2874 | + | |
| 2875 | + | |
| 2876 | + | |
| 2877 | + | |
| 2878 | + | |
| 2879 | + | |
| 2880 | + | |
| 2881 | + | |
| 2882 | + | |
| 2883 | + | |
| 2884 | + | |
| 2885 | + | |
| 2886 | + | |
| 2887 | + | |
| 2888 | + | |
| 2889 | + | |
| 2890 | + | |
| 2891 | + | |
| 2892 | + | |
| 2893 | + | |
| 2894 | + | |
| 2895 | + | |
| 2896 | + | |
| 2897 | + | |
| 2898 | + | |
| 2899 | + | |
| 2900 | + | |
| 2901 | + | |
| 2902 | + | |
| 2903 | + | |
| 2904 | + | |
| 2905 | + | |
| 2906 | + | |
| 2907 | + | |
| 2908 | + | |
| 2909 | + | |
| 2910 | + | |
| 2911 | + | |
| 2912 | + | |
| 2913 | + | |
| 2914 | + | |
| 2915 | + | |
| 2916 | + | |
| 2917 | + | |
| 2918 | + | |
| 2919 | + | |
| 2920 | + | |
2875 | 2921 | | |
2876 | 2922 | | |
2877 | 2923 | | |
2878 | 2924 | | |
2879 | 2925 | | |
2880 | 2926 | | |
2881 | | - | |
| 2927 | + | |
| 2928 | + | |
| 2929 | + | |
| 2930 | + | |
| 2931 | + | |
2882 | 2932 | | |
2883 | | - | |
| 2933 | + | |
2884 | 2934 | | |
2885 | | - | |
| 2935 | + | |
2886 | 2936 | | |
2887 | 2937 | | |
2888 | 2938 | | |
2889 | 2939 | | |
2890 | 2940 | | |
2891 | | - | |
| 2941 | + | |
2892 | 2942 | | |
2893 | | - | |
2894 | | - | |
2895 | 2943 | | |
2896 | | - | |
2897 | | - | |
2898 | | - | |
2899 | | - | |
2900 | | - | |
2901 | | - | |
2902 | | - | |
2903 | | - | |
2904 | | - | |
2905 | | - | |
2906 | | - | |
2907 | | - | |
2908 | | - | |
2909 | | - | |
2910 | | - | |
2911 | | - | |
2912 | | - | |
2913 | | - | |
2914 | | - | |
2915 | | - | |
2916 | | - | |
2917 | | - | |
2918 | | - | |
2919 | | - | |
2920 | | - | |
2921 | | - | |
2922 | | - | |
2923 | | - | |
2924 | | - | |
2925 | | - | |
2926 | | - | |
2927 | | - | |
2928 | | - | |
2929 | | - | |
2930 | | - | |
2931 | | - | |
2932 | | - | |
2933 | | - | |
2934 | | - | |
2935 | | - | |
2936 | | - | |
2937 | | - | |
2938 | | - | |
2939 | | - | |
2940 | | - | |
2941 | | - | |
2942 | | - | |
2943 | | - | |
2944 | | - | |
2945 | | - | |
2946 | | - | |
2947 | | - | |
2948 | | - | |
2949 | | - | |
2950 | | - | |
2951 | | - | |
2952 | | - | |
2953 | | - | |
2954 | | - | |
2955 | | - | |
2956 | | - | |
2957 | | - | |
2958 | | - | |
2959 | | - | |
2960 | | - | |
2961 | | - | |
2962 | | - | |
2963 | | - | |
2964 | | - | |
2965 | | - | |
2966 | | - | |
2967 | | - | |
2968 | | - | |
2969 | | - | |
2970 | | - | |
2971 | | - | |
2972 | | - | |
2973 | | - | |
2974 | | - | |
2975 | | - | |
2976 | | - | |
2977 | | - | |
2978 | | - | |
2979 | | - | |
2980 | | - | |
2981 | | - | |
2982 | | - | |
2983 | | - | |
2984 | | - | |
2985 | | - | |
2986 | | - | |
2987 | | - | |
2988 | | - | |
2989 | | - | |
2990 | | - | |
2991 | | - | |
2992 | | - | |
2993 | | - | |
2994 | | - | |
2995 | | - | |
2996 | | - | |
2997 | | - | |
2998 | | - | |
2999 | | - | |
3000 | | - | |
3001 | | - | |
3002 | | - | |
3003 | | - | |
3004 | | - | |
3005 | | - | |
3006 | | - | |
3007 | | - | |
3008 | | - | |
3009 | | - | |
3010 | | - | |
3011 | | - | |
3012 | | - | |
| 2944 | + | |
| 2945 | + | |
| 2946 | + | |
| 2947 | + | |
| 2948 | + | |
| 2949 | + | |
3013 | 2950 | | |
| 2951 | + | |
| 2952 | + | |
| 2953 | + | |
| 2954 | + | |
| 2955 | + | |
| 2956 | + | |
| 2957 | + | |
| 2958 | + | |
3014 | 2959 | | |
3015 | 2960 | | |
3016 | 2961 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
44 | 57 | | |
45 | 58 | | |
46 | 59 | | |
| |||
169 | 182 | | |
170 | 183 | | |
171 | 184 | | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
172 | 190 | | |
173 | 191 | | |
174 | 192 | | |
| |||
0 commit comments