Commit 50fcbb2
ffi: remove receiver-strip stub emitter and JIT memory
With v8 fast-call patched to support HasReceiver=kNo (previous commit),
the dlsym'd target function pointer is registered directly with v8 as
the C function address — no JIT'd receiver-strip trampoline is needed.
This removes the entire stub-emitter and JIT-memory infrastructure,
along with the platform-specific argument-cap logic (v8's own 8-arg
fast-call cap takes over) and the boot-time self-test that verified
JIT pages were executable.
Deleted: src/ffi/fastcall/jit_memory.{h,cc}, stub_emitter.h, the four
per-platform stub_emitter_*.cc files (aarch64, arm, x64_sysv, x64_win),
test/cctest/test_ffi_fastcall_{emitter,jit}.cc, and the related node.gyp
/ config.gypi entries. The CFunctionInfoBundle drops its arg_classes
and result_class members (they only existed to feed the stub emitters).
IsFastCallEligible loses the per-platform GP/FP/Win64 caps and the
AArch32 i64-arg rejection — v8 now handles those uniformly. FastCall-
State drops stub_entry/stub_alloc_size; its destructor no longer needs
to free JIT pages. Net change: ~2000 lines deleted across src/ and
test/cctest/.
Functional behavior is unchanged: all 15 FFI tests and the FFI cctests
still pass. The benchmark gain over the prior shipping wrapper is
+2-24% on AArch64 macOS (largest on many-args at +24% — saved register-
shifts in the deleted stub).
Signed-off-by: Bryan English <bryan@bryanenglish.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 0cc89a6 commit 50fcbb2
17 files changed
Lines changed: 55 additions & 1520 deletions
File tree
- src
- ffi
- fastcall
- test/cctest
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
474 | 474 | | |
475 | 475 | | |
476 | 476 | | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | 477 | | |
481 | 478 | | |
482 | 479 | | |
| |||
1021 | 1018 | | |
1022 | 1019 | | |
1023 | 1020 | | |
1024 | | - | |
1025 | | - | |
1026 | | - | |
1027 | | - | |
1028 | | - | |
1029 | | - | |
1030 | | - | |
1031 | | - | |
1032 | | - | |
1033 | | - | |
1034 | | - | |
1035 | | - | |
1036 | | - | |
1037 | | - | |
1038 | 1021 | | |
1039 | 1022 | | |
1040 | 1023 | | |
| |||
1106 | 1089 | | |
1107 | 1090 | | |
1108 | 1091 | | |
1109 | | - | |
1110 | | - | |
1111 | | - | |
1112 | | - | |
1113 | | - | |
1114 | | - | |
1115 | | - | |
1116 | | - | |
1117 | | - | |
1118 | | - | |
1119 | | - | |
1120 | | - | |
1121 | | - | |
1122 | | - | |
1123 | 1092 | | |
1124 | 1093 | | |
1125 | 1094 | | |
| |||
1460 | 1429 | | |
1461 | 1430 | | |
1462 | 1431 | | |
1463 | | - | |
1464 | | - | |
1465 | 1432 | | |
1466 | 1433 | | |
1467 | 1434 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
| 12 | + | |
25 | 13 | | |
26 | 14 | | |
27 | 15 | | |
28 | | - | |
| 16 | + | |
29 | 17 | | |
30 | | - | |
31 | | - | |
32 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
33 | 21 | | |
34 | | - | |
35 | | - | |
36 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
37 | 25 | | |
38 | 26 | | |
39 | 27 | | |
40 | 28 | | |
41 | 29 | | |
42 | | - | |
| 30 | + | |
43 | 31 | | |
44 | | - | |
| 32 | + | |
45 | 33 | | |
46 | 34 | | |
47 | | - | |
| 35 | + | |
48 | 36 | | |
49 | | - | |
50 | | - | |
51 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
52 | 40 | | |
53 | | - | |
54 | | - | |
55 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
56 | 44 | | |
57 | 45 | | |
58 | 46 | | |
| |||
66 | 54 | | |
67 | 55 | | |
68 | 56 | | |
69 | | - | |
70 | | - | |
71 | | - | |
| 57 | + | |
72 | 58 | | |
73 | 59 | | |
74 | | - | |
75 | 60 | | |
76 | 61 | | |
77 | 62 | | |
| |||
81 | 66 | | |
82 | 67 | | |
83 | 68 | | |
84 | | - | |
85 | | - | |
86 | 69 | | |
87 | 70 | | |
88 | | - | |
89 | 71 | | |
90 | 72 | | |
91 | 73 | | |
| |||
104 | 86 | | |
105 | 87 | | |
106 | 88 | | |
107 | | - | |
108 | 89 | | |
109 | | - | |
110 | | - | |
111 | | - | |
| 90 | + | |
112 | 91 | | |
113 | 92 | | |
114 | 93 | | |
115 | | - | |
116 | | - | |
117 | | - | |
| 94 | + | |
118 | 95 | | |
119 | 96 | | |
120 | 97 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | 6 | | |
10 | 7 | | |
11 | 8 | | |
12 | 9 | | |
13 | 10 | | |
14 | 11 | | |
15 | | - | |
16 | | - | |
| 12 | + | |
17 | 13 | | |
18 | 14 | | |
19 | 15 | | |
20 | | - | |
21 | | - | |
22 | 16 | | |
23 | 17 | | |
24 | 18 | | |
| |||
28 | 22 | | |
29 | 23 | | |
30 | 24 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
35 | 29 | | |
36 | 30 | | |
37 | 31 | | |
| |||
0 commit comments