Commit 8b7b935
committed
builder: emitUnpackSequence → C (99/144 → 100/144 = 69.4%)
Convert HIRBuilder::emitUnpackSequence (UNPACK_SEQUENCE handler with
specialized-opcode dispatch + 5-block + multi-path type narrowing) to
a thin delegation stub. New C function hir_builder_emit_unpack_sequence_c
(178 lines, 7 phases) handles the largest non-exception multi-block
conversion in the remaining set.
Tier 5 milestone: crossed the 100/144 = 69.4% line. 4 emit methods
remain (emitInlineExceptionMatch, emitCallExceptionHandler, emitAnyCall
plus any I haven't enumerated).
W25-defer-aware A1 design (theologian chat 2026-04-22 14:30:30Z
pre-audit): ZERO new bridges. Pre-audit bridge-count gate per supervisor
chat 14:16:55Z policy (>1 new bridges → HALT for Option B reconsideration);
this method passed at 0 ≤ 1.
7 phases per pre-audit:
P0: specialized-opcode dispatch (UNPACK_SEQUENCE_LIST →
GuardType(TListExact); _TUPLE/_TWO_TUPLE → GuardType(TTupleExact))
Skipped if specialized_op = -1 (passed from C++ stub when
jit_get_config()->specialized_opcodes is false)
P1: deopt_path setup with frame copy BEFORE pop, Snapshot+Deopt with
setGuiltyReg(seq) + setDescr("UNPACK_SEQUENCE")
P2: 5 block allocations (fast_path, list_check_path, list_fast_path,
tuple_fast_path) + list_mem temp + POP seq
P3: 3 mutually-exclusive type-narrowing paths via hir_type_is_subtype
static-narrow checks (TTupleExact / TListExact / runtime
CondBranchCheckType chain)
P4: tuple_fast_path — LoadConst(ob_item offset) + LoadFieldAddress
P5: list_fast_path — LoadField(ob_item, TCPtr)
P6: fast_path size check — LoadVarObjectSize + LoadConst(target_size)
+ PrimitiveCompare(Equal) + RE-ALLOC fast_path_extract_loop
(distinct from P2's fast_path per pitfall PB) + CondBranch
P7: item extraction loop — for idx = oparg-1 down to 0, LoadConst
idx + LoadArrayItem + push to stack
Pitfalls addressed inline:
PA: deopt_path frame_state_copy BEFORE pop (preserves pre-pop stack
with seq for interpreter resume on deopt)
PB: fast_path RE-ALLOCATED at P6 distinct from P2's initial fast_path
(semantically "fast path 1" vs "fast path 2", named
fast_path_extract_loop in C body for clarity)
PC: emitGuardType in-place SSA-rename: GuardType(seq, type, seq) with
seq as both input and output operand (matches
emitLoadMethodOrAttrSuper precedent push 52)
PD: Py_GIL_DISABLED branches DROPPED for 3.12-only project (3.13+
would need re-introduction; documented inline in C body)
PE: phx_frame_state_destroy on deopt_tc at function end (RAII →
manual)
C++ stub passes (tc, current_func_, this, oparg, baseOffset.value(),
specialized_op) — 6 args. CFG& cfg unused (C uses
hir_cfg_alloc_block(func)). specialized_op = -1 sentinel signals C
body to skip P0 dispatch entirely.
Carrying-cost validation extending to n=3 zero-bridge methods (push 56
1-bridge + push 57 0-bridge + this 0-bridge). A1 stub-heavy strategy
holds across the 122-line largest-multi-block conversion in remaining 4.
testkeeper pre-commit verify (chat 2026-04-22 14:35:08Z):
JIT_BUILD_EXIT=0, full --clean BUILD_EXIT=0, 7/7 phoenix-jit tests
PASS at HEAD+uncommitted. W26 gate-hardening not triggered (clean
build path). ZERO new bridges held.1 parent 6c154a9 commit 8b7b935
2 files changed
Lines changed: 196 additions & 118 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4753 | 4753 | | |
4754 | 4754 | | |
4755 | 4755 | | |
| 4756 | + | |
| 4757 | + | |
| 4758 | + | |
| 4759 | + | |
4756 | 4760 | | |
4757 | | - | |
| 4761 | + | |
4758 | 4762 | | |
4759 | 4763 | | |
4760 | | - | |
4761 | | - | |
4762 | | - | |
4763 | | - | |
4764 | | - | |
4765 | | - | |
4766 | | - | |
4767 | | - | |
4768 | | - | |
4769 | | - | |
4770 | | - | |
4771 | | - | |
4772 | | - | |
4773 | | - | |
4774 | | - | |
4775 | | - | |
4776 | | - | |
4777 | | - | |
4778 | | - | |
4779 | | - | |
4780 | | - | |
4781 | | - | |
4782 | | - | |
4783 | | - | |
4784 | | - | |
4785 | | - | |
4786 | | - | |
4787 | | - | |
4788 | | - | |
4789 | | - | |
4790 | | - | |
4791 | | - | |
4792 | | - | |
4793 | | - | |
4794 | | - | |
4795 | | - | |
4796 | | - | |
4797 | | - | |
4798 | | - | |
4799 | | - | |
4800 | | - | |
4801 | | - | |
4802 | | - | |
4803 | | - | |
4804 | | - | |
4805 | | - | |
4806 | | - | |
4807 | | - | |
4808 | | - | |
4809 | | - | |
4810 | | - | |
4811 | | - | |
4812 | | - | |
4813 | | - | |
4814 | | - | |
4815 | | - | |
4816 | | - | |
4817 | | - | |
4818 | | - | |
4819 | | - | |
4820 | | - | |
4821 | | - | |
4822 | | - | |
4823 | | - | |
4824 | | - | |
4825 | | - | |
4826 | | - | |
4827 | | - | |
4828 | | - | |
4829 | | - | |
4830 | | - | |
4831 | | - | |
4832 | | - | |
4833 | | - | |
4834 | | - | |
4835 | | - | |
4836 | | - | |
4837 | | - | |
4838 | | - | |
4839 | | - | |
4840 | | - | |
4841 | | - | |
4842 | | - | |
4843 | | - | |
4844 | | - | |
4845 | | - | |
4846 | | - | |
4847 | | - | |
4848 | | - | |
4849 | | - | |
4850 | | - | |
4851 | | - | |
4852 | | - | |
4853 | | - | |
4854 | | - | |
4855 | | - | |
4856 | | - | |
4857 | | - | |
4858 | | - | |
4859 | | - | |
4860 | | - | |
4861 | | - | |
4862 | | - | |
4863 | | - | |
4864 | | - | |
4865 | | - | |
4866 | | - | |
4867 | | - | |
4868 | | - | |
4869 | | - | |
4870 | | - | |
4871 | | - | |
4872 | | - | |
4873 | | - | |
4874 | | - | |
4875 | | - | |
4876 | | - | |
| 4764 | + | |
| 4765 | + | |
| 4766 | + | |
| 4767 | + | |
| 4768 | + | |
| 4769 | + | |
| 4770 | + | |
| 4771 | + | |
| 4772 | + | |
| 4773 | + | |
| 4774 | + | |
| 4775 | + | |
| 4776 | + | |
4877 | 4777 | | |
4878 | 4778 | | |
4879 | 4779 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2836 | 2836 | | |
2837 | 2837 | | |
2838 | 2838 | | |
| 2839 | + | |
| 2840 | + | |
| 2841 | + | |
| 2842 | + | |
| 2843 | + | |
| 2844 | + | |
| 2845 | + | |
| 2846 | + | |
| 2847 | + | |
| 2848 | + | |
| 2849 | + | |
| 2850 | + | |
| 2851 | + | |
| 2852 | + | |
| 2853 | + | |
| 2854 | + | |
| 2855 | + | |
| 2856 | + | |
| 2857 | + | |
| 2858 | + | |
| 2859 | + | |
| 2860 | + | |
| 2861 | + | |
| 2862 | + | |
| 2863 | + | |
| 2864 | + | |
| 2865 | + | |
| 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 | + | |
| 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 | + | |
| 3013 | + | |
| 3014 | + | |
| 3015 | + | |
| 3016 | + | |
0 commit comments