Commit 6ae900e
authored
embind: Fix method pointers for AOT JS generation. (#21168)
Previously, AOT JS glue code for method pointers used the address of the
method pointer as a unique ID to match JS glue with the binding. However,
sometimes static initializers malloc different sizes when running
the AOT generation code versus when the code is run normally. This caused
the method pointer address to be different and the binding didn't match up.
Instead of using the function pointer or the method pointer address we now
use a generated signature for the invoker to match up the glue code. This
works for both types of pointers and also has the advantage that many
of the glue code functions are nearly identical and can be reusued (closure
arguments make them behave differently).
Fixes #209941 parent 8635504 commit 6ae900e
File tree
5 files changed
+85
-13
lines changed- src/embind
- test
- other
5 files changed
+85
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
781 | 781 | | |
782 | 782 | | |
783 | 783 | | |
| 784 | + | |
784 | 785 | | |
785 | 786 | | |
786 | 787 | | |
| |||
884 | 885 | | |
885 | 886 | | |
886 | 887 | | |
887 | | - | |
| 888 | + | |
888 | 889 | | |
889 | 890 | | |
890 | 891 | | |
| |||
903 | 904 | | |
904 | 905 | | |
905 | 906 | | |
906 | | - | |
| 907 | + | |
| 908 | + | |
907 | 909 | | |
908 | | - | |
| 910 | + | |
909 | 911 | | |
910 | 912 | | |
911 | 913 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
43 | | - | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| |||
105 | 107 | | |
106 | 108 | | |
107 | 109 | | |
108 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
109 | 116 | | |
110 | 117 | | |
111 | | - | |
| 118 | + | |
112 | 119 | | |
113 | 120 | | |
114 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
182 | 207 | | |
183 | | - | |
| 208 | + | |
184 | 209 | | |
185 | 210 | | |
186 | 211 | | |
| |||
193 | 218 | | |
194 | 219 | | |
195 | 220 | | |
196 | | - | |
| 221 | + | |
197 | 222 | | |
198 | 223 | | |
199 | 224 | | |
200 | | - | |
| 225 | + | |
201 | 226 | | |
202 | 227 | | |
203 | 228 | | |
204 | 229 | | |
205 | 230 | | |
206 | 231 | | |
207 | 232 | | |
208 | | - | |
| 233 | + | |
209 | 234 | | |
210 | 235 | | |
211 | 236 | | |
| |||
216 | 241 | | |
217 | 242 | | |
218 | 243 | | |
219 | | - | |
| 244 | + | |
220 | 245 | | |
221 | 246 | | |
222 | 247 | | |
| |||
240 | 265 | | |
241 | 266 | | |
242 | 267 | | |
243 | | - | |
| 268 | + | |
244 | 269 | | |
245 | 270 | | |
246 | 271 | | |
| |||
269 | 294 | | |
270 | 295 | | |
271 | 296 | | |
272 | | - | |
| 297 | + | |
273 | 298 | | |
274 | 299 | | |
275 | 300 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3130 | 3130 | | |
3131 | 3131 | | |
3132 | 3132 | | |
| 3133 | + | |
| 3134 | + | |
| 3135 | + | |
| 3136 | + | |
| 3137 | + | |
| 3138 | + | |
3133 | 3139 | | |
3134 | 3140 | | |
3135 | 3141 | | |
| |||
0 commit comments