Commit 0810be4
committed
builder: emitAnyCall full PURE conversion (W27c) + Phase A.5 wrap
Per supervisor 21:23:07Z + theologian 21:23:08Z + theologian P7 audit
20:53:51Z. Moves emitAnyCall from PARTIAL Cat-B to PURE-CONVERTED
(Phase 3D 98/100 → 99/100). One PARTIAL Cat-B remains: emitLoadMethodStatic
(blocked on VTableByteOffset wrapper, landed in push 58).
CHANGES:
C body (Python/jit/hir/builder_emit_c.c hir_builder_emit_any_call_c):
- New signature: drop call_kind/is_kw_arg/is_awaited/const_arg params;
add opcode (raw int) and BcByteOffset base_offset (P5 wrapper).
- Move opcode→PhxCallKind switch into C body. CALL/CALL_FUNCTION_EX
from Include/opcode.h; CALL_FUNCTION/_KW/CALL_KW/CALL_METHOD from
Python/jit_common/opcode_stubs.h (stubbed >255 in 3.12 but kept for
forward compat).
- INVOKE_FUNCTION/NATIVE/METHOD opcode constants local-#define'd in C
body (209/216/185 from Python/jit_interp/3.12/cinder_opcode_ids.h).
Local-define avoids pulling cinder_opcode.h which would shadow
Include/opcode.h's BINARY_OP_ADD_INT and break BINARY_OP
specialization #ifdef (per existing comment at builder_emit_c.c:30).
Guarded with #ifndef so future direct cinder_opcode_ids.h include
doesn't conflict.
- is_awaited hardcoded 0 for 3.12 with #if PY_VERSION_HEX guard +
#error fallback for older Python (Phoenix targets 3.12 exclusively).
Older-Python path would need C-side bc_it/bc_instr accessors (out-
of-scope; covered by existing C++ stub history in git log).
- const_arg = PyTuple_GET_ITEM(code->co_consts, oparg) for INVOKE_*.
Per HIRBuilder::constArg @ builder.cpp pre-conversion: borrowed ref,
no GC trigger, no refcount. Lifetime = code object = compile duration.
Theologian 20:53:51Z P7 audit confirmed safe to extract on C side.
- base_offset.v unwrap at the one boundary
(hir_builder_emit_call_method_exception_handler_inline_c, raw-int API).
C++ stub (Python/jit/hir/builder.cpp HIRBuilder::emitAnyCall):
- Shrinks from 67 lines to 12 lines: pure type marshaling delegation.
- Wraps base_offset via bc_byte_offset_from_int factory (Phase A.5).
- Added bytecode_c.h include for BcByteOffset visibility.
P6 EXECUTION-PATH COVERAGE:
- PHX_CALL_KIND_CALL_METHOD (CALL/CALL_METHOD/CALL_KW): EXERCISED by
test_exc_raise_catch (CALL ValueError(...)) + 4 W-2A-DISPATCH-COVERAGE
sentinels (try/else, try/finally with raise, nested try, raise-in-handler)
+ 4 W-2B-RECONVERT sentinels (raise/catch, BINARY_SUBSCR_DICT-in-try,
continue-in-loop, multi-except-in-loop) + test_multiple_exceptions_in_loop.
- PHX_CALL_KIND_CALL_EX (CALL_FUNCTION_EX): EXERCISED indirectly by any
test using *args/**kwargs unpacking; covered by Phoenix CPython suite.
- PHX_CALL_KIND_VECTOR_CALL (CALL_FUNCTION/_KW): DEAD in 3.12 (stubbed
>255). Switch case kept for forward compat with older Python builds.
- PHX_CALL_KIND_INVOKE_FUNCTION/NATIVE/METHOD: COVERAGE GAP. INVOKE_*
opcodes are Cinder static-Python only; vanilla CPython 3.12 compiler
does NOT emit them. Pure Python sentinel cannot exercise these
branches without Cinder static-Python infrastructure (not available
in this build per theologian 21:32:27Z + supervisor 21:32:42Z
fallback). Conversion is mechanical (PyTuple_GET_ITEM extraction +
delegate to existing emit functions); structural test exists at
Lib/test/test_phoenix_partial_conversions.py:52. Execution-level
coverage queued as W-CINDERX-INVOKE-COVERAGE workstream
(cinderx_dev integration post-Phoenix-integration).
Phase 0' HIR-DIFF planned (theologian step 4): test_exc_raise_catch +
4 W-2A sentinels + Phoenix suite — pre/post conversion HIR comparison
to detect any divergence.
Verification pending: testkeeper rebuild + 30x all 8 W-2A+W-2B-RECONVERT
sentinels + 30x test_multiple_exceptions_in_loop + Phoenix suite +
ABBA + dual-arch.
Per supervisor 21:32:42Z (post pythia python#140 python#2): full 24-bench ABBA
between push 59 (this) and push 60 (emitLoadMethodStatic conversion)
— single-commit bisect window for cap-clock at 73 commits since last
24-bench (cbb9453 2026-04-23).1 parent c5d2edd commit 0810be4
2 files changed
Lines changed: 98 additions & 73 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
2852 | 2853 | | |
2853 | 2854 | | |
2854 | 2855 | | |
2855 | | - | |
2856 | | - | |
2857 | | - | |
2858 | | - | |
| 2856 | + | |
| 2857 | + | |
2859 | 2858 | | |
| 2859 | + | |
| 2860 | + | |
| 2861 | + | |
| 2862 | + | |
2860 | 2863 | | |
2861 | 2864 | | |
2862 | 2865 | | |
2863 | 2866 | | |
2864 | 2867 | | |
2865 | 2868 | | |
2866 | | - | |
2867 | | - | |
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 | 2869 | | |
2920 | 2870 | | |
2921 | 2871 | | |
2922 | 2872 | | |
2923 | | - | |
2924 | | - | |
2925 | | - | |
| 2873 | + | |
| 2874 | + | |
| 2875 | + | |
2926 | 2876 | | |
2927 | 2877 | | |
2928 | 2878 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3695 | 3695 | | |
3696 | 3696 | | |
3697 | 3697 | | |
3698 | | - | |
| 3698 | + | |
3699 | 3699 | | |
3700 | | - | |
3701 | | - | |
3702 | | - | |
| 3700 | + | |
3703 | 3701 | | |
3704 | | - | |
3705 | | - | |
3706 | | - | |
| 3702 | + | |
| 3703 | + | |
| 3704 | + | |
| 3705 | + | |
| 3706 | + | |
| 3707 | + | |
| 3708 | + | |
| 3709 | + | |
| 3710 | + | |
| 3711 | + | |
| 3712 | + | |
| 3713 | + | |
| 3714 | + | |
| 3715 | + | |
| 3716 | + | |
| 3717 | + | |
3707 | 3718 | | |
3708 | | - | |
3709 | | - | |
3710 | | - | |
3711 | | - | |
| 3719 | + | |
| 3720 | + | |
| 3721 | + | |
| 3722 | + | |
| 3723 | + | |
| 3724 | + | |
| 3725 | + | |
| 3726 | + | |
| 3727 | + | |
| 3728 | + | |
| 3729 | + | |
| 3730 | + | |
| 3731 | + | |
| 3732 | + | |
| 3733 | + | |
| 3734 | + | |
| 3735 | + | |
| 3736 | + | |
| 3737 | + | |
| 3738 | + | |
| 3739 | + | |
| 3740 | + | |
| 3741 | + | |
| 3742 | + | |
| 3743 | + | |
| 3744 | + | |
| 3745 | + | |
| 3746 | + | |
| 3747 | + | |
| 3748 | + | |
| 3749 | + | |
| 3750 | + | |
| 3751 | + | |
| 3752 | + | |
| 3753 | + | |
| 3754 | + | |
| 3755 | + | |
| 3756 | + | |
| 3757 | + | |
| 3758 | + | |
| 3759 | + | |
| 3760 | + | |
| 3761 | + | |
| 3762 | + | |
| 3763 | + | |
| 3764 | + | |
| 3765 | + | |
| 3766 | + | |
| 3767 | + | |
| 3768 | + | |
| 3769 | + | |
| 3770 | + | |
| 3771 | + | |
| 3772 | + | |
| 3773 | + | |
| 3774 | + | |
| 3775 | + | |
| 3776 | + | |
| 3777 | + | |
| 3778 | + | |
| 3779 | + | |
| 3780 | + | |
| 3781 | + | |
| 3782 | + | |
| 3783 | + | |
3712 | 3784 | | |
3713 | 3785 | | |
3714 | 3786 | | |
| |||
3773 | 3845 | | |
3774 | 3846 | | |
3775 | 3847 | | |
3776 | | - | |
| 3848 | + | |
| 3849 | + | |
| 3850 | + | |
| 3851 | + | |
3777 | 3852 | | |
3778 | | - | |
| 3853 | + | |
3779 | 3854 | | |
3780 | 3855 | | |
3781 | 3856 | | |
| |||
0 commit comments