Commit cfafe43
src: make AliasedBuffers in the binding data weak
The binding data holds references to the AliasedBuffers directly
from their wrappers which already ensures that the AliasedBuffers
won't be accessed when the wrappers are GC'ed. So we can just
make the global references to the AliasedBuffers weak. This way
we can simply deserialize the typed arrays when deserialize the
binding data and avoid the extra Object::Set() calls. It also
eliminates the caveat in the JS land where aliased buffers must
be dynamically read from the binding.
PR-URL: #47354
Refs: #47353
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>1 parent 568256d commit cfafe43Copy full SHA for cfafe43
File tree
Expand file treeCollapse file tree
13 files changed
+230
-101
lines changedOpen diff view settings
Filter options
- lib
- internal
- src
Expand file treeCollapse file tree
13 files changed
+230
-101
lines changedOpen diff view settings
Collapse file
+8-8Lines changed: 8 additions & 8 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
59 | 59 | |
60 | 60 | |
61 | 61 | |
62 | | - |
63 | | - |
64 | | - |
65 | 62 | |
66 | 63 | |
67 | 64 | |
| ||
78 | 75 | |
79 | 76 | |
80 | 77 | |
81 | | - |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | + |
82 | 82 | |
83 | 83 | |
84 | 84 | |
| ||
2569 | 2569 | |
2570 | 2570 | |
2571 | 2571 | |
2572 | | - |
2573 | | - |
| 2572 | + |
| 2573 | + |
2574 | 2574 | |
2575 | 2575 | |
2576 | 2576 | |
| ||
2727 | 2727 | |
2728 | 2728 | |
2729 | 2729 | |
2730 | | - |
2731 | | - |
| 2730 | + |
| 2731 | + |
2732 | 2732 | |
2733 | 2733 | |
2734 | 2734 | |
|
Collapse file
+2-1Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
51 | 51 | |
52 | 52 | |
53 | 53 | |
| 54 | + |
54 | 55 | |
55 | 56 | |
56 | 57 | |
| ||
341 | 342 | |
342 | 343 | |
343 | 344 | |
344 | | - |
| 345 | + |
345 | 346 | |
346 | 347 | |
347 | 348 | |
|
Collapse file
+7-3Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
139 | 139 | |
140 | 140 | |
141 | 141 | |
| 142 | + |
| 143 | + |
| 144 | + |
| 145 | + |
142 | 146 | |
143 | 147 | |
144 | 148 | |
| ||
170 | 174 | |
171 | 175 | |
172 | 176 | |
173 | | - |
| 177 | + |
174 | 178 | |
175 | 179 | |
176 | 180 | |
| ||
204 | 208 | |
205 | 209 | |
206 | 210 | |
207 | | - |
| 211 | + |
208 | 212 | |
209 | 213 | |
210 | 214 | |
| ||
230 | 234 | |
231 | 235 | |
232 | 236 | |
233 | | - |
| 237 | + |
234 | 238 | |
235 | 239 | |
236 | 240 | |
|
Collapse file
+29-9Lines changed: 29 additions & 9 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
70 | 70 | |
71 | 71 | |
72 | 72 | |
73 | | - |
| 73 | + |
74 | 74 | |
75 | 75 | |
76 | 76 | |
77 | 77 | |
78 | 78 | |
79 | 79 | |
80 | | - |
| 80 | + |
81 | 81 | |
82 | 82 | |
83 | 83 | |
| ||
100 | 100 | |
101 | 101 | |
102 | 102 | |
103 | | - |
| 103 | + |
104 | 104 | |
105 | 105 | |
106 | 106 | |
| ||
116 | 116 | |
117 | 117 | |
118 | 118 | |
119 | | - |
| 119 | + |
120 | 120 | |
121 | 121 | |
122 | 122 | |
| ||
126 | 126 | |
127 | 127 | |
128 | 128 | |
| 129 | + |
| 130 | + |
| 131 | + |
| 132 | + |
| 133 | + |
| 134 | + |
| 135 | + |
| 136 | + |
| 137 | + |
| 138 | + |
| 139 | + |
| 140 | + |
| 141 | + |
| 142 | + |
| 143 | + |
129 | 144 | |
130 | 145 | |
131 | 146 | |
| ||
134 | 149 | |
135 | 150 | |
136 | 151 | |
137 | | - |
| 152 | + |
138 | 153 | |
139 | 154 | |
140 | 155 | |
| ||
147 | 162 | |
148 | 163 | |
149 | 164 | |
150 | | - |
| 165 | + |
151 | 166 | |
152 | 167 | |
153 | 168 | |
154 | 169 | |
155 | 170 | |
156 | 171 | |
157 | | - |
| 172 | + |
158 | 173 | |
159 | 174 | |
160 | 175 | |
161 | 176 | |
162 | 177 | |
163 | 178 | |
164 | 179 | |
165 | | - |
| 180 | + |
166 | 181 | |
167 | 182 | |
168 | 183 | |
| ||
178 | 193 | |
179 | 194 | |
180 | 195 | |
181 | | - |
| 196 | + |
182 | 197 | |
183 | 198 | |
184 | 199 | |
| ||
206 | 221 | |
207 | 222 | |
208 | 223 | |
| 224 | + |
| 225 | + |
| 226 | + |
| 227 | + |
| 228 | + |
209 | 229 | |
210 | 230 | |
211 | 231 | |
|
Collapse file
+12Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
117 | 117 | |
118 | 118 | |
119 | 119 | |
| 120 | + |
| 121 | + |
| 122 | + |
| 123 | + |
| 124 | + |
| 125 | + |
| 126 | + |
| 127 | + |
120 | 128 | |
121 | 129 | |
122 | 130 | |
| ||
164 | 172 | |
165 | 173 | |
166 | 174 | |
| 175 | + |
| 176 | + |
| 177 | + |
167 | 178 | |
168 | 179 | |
169 | 180 | |
170 | 181 | |
171 | 182 | |
| 183 | + |
172 | 184 | |
173 | 185 | |
174 | 186 | |
|
Collapse file
+26-13Lines changed: 26 additions & 13 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
28 | 28 | |
29 | 29 | |
30 | 30 | |
31 | | - |
| 31 | + |
| 32 | + |
| 33 | + |
32 | 34 | |
33 | | - |
34 | | - |
35 | | - |
36 | | - |
37 | | - |
38 | | - |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
39 | 49 | |
40 | 50 | |
41 | 51 | |
42 | 52 | |
43 | | - |
44 | | - |
45 | | - |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
46 | 57 | |
47 | 58 | |
48 | 59 | |
49 | 60 | |
50 | 61 | |
51 | 62 | |
52 | 63 | |
53 | | - |
54 | | - |
| 64 | + |
| 65 | + |
55 | 66 | |
56 | 67 | |
57 | 68 | |
| ||
63 | 74 | |
64 | 75 | |
65 | 76 | |
66 | | - |
| 77 | + |
| 78 | + |
| 79 | + |
67 | 80 | |
68 | 81 | |
69 | 82 | |
|
Collapse file
+7-3Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
14 | 14 | |
15 | 15 | |
16 | 16 | |
17 | | - |
18 | | - |
19 | | - |
| 17 | + |
| 18 | + |
| 19 | + |
20 | 20 | |
| 21 | + |
| 22 | + |
| 23 | + |
21 | 24 | |
22 | 25 | |
23 | 26 | |
| ||
39 | 42 | |
40 | 43 | |
41 | 44 | |
| 45 | + |
42 | 46 | |
43 | 47 | |
44 | 48 | |
|
0 commit comments