Commit 57f29b7
bootstrap: use different scripts to setup different configurations
This patch splits the handling of `isMainThread` and
`ownsProcessState` from conditionals in
`lib/internal/bootstrap/node.js` into different scripts under
`lib/internal/bootstrap/switches/`, and call them accordingly
from C++ after `node.js` is run.
This:
- Creates a common denominator of the main thread and the worker
thread bootstrap that can be snapshotted and shared by
both.
- Makes it possible to override the configurations on-the-fly.
PR-URL: #30862
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>1 parent 1c17f42 commit 57f29b7Copy full SHA for 57f29b7
File tree
Expand file treeCollapse file tree
14 files changed
+568
-545
lines changedOpen diff view settings
Filter options
- lib/internal
- bootstrap
- switches
- process
- src
- test/parallel
Expand file treeCollapse file tree
14 files changed
+568
-545
lines changedOpen diff view settings
Collapse file
lib/internal/bootstrap/node.js
Copy file name to clipboardExpand all lines: lib/internal/bootstrap/node.js+18-99Lines changed: 18 additions & 99 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
3 | 3 | |
4 | 4 | |
5 | 5 | |
6 | | - |
7 | | - |
8 | | - |
| 6 | + |
9 | 7 | |
10 | 8 | |
11 | 9 | |
| ||
22 | 20 | |
23 | 21 | |
24 | 22 | |
25 | | - |
26 | | - |
27 | | - |
28 | | - |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
29 | 32 | |
30 | 33 | |
31 | 34 | |
32 | 35 | |
33 | 36 | |
34 | | - |
| 37 | + |
35 | 38 | |
36 | 39 | |
37 | 40 | |
| ||
54 | 57 | |
55 | 58 | |
56 | 59 | |
57 | | - |
58 | | - |
59 | | - |
60 | | - |
61 | | - |
62 | | - |
63 | | - |
64 | | - |
65 | | - |
66 | | - |
67 | | - |
68 | | - |
69 | | - |
70 | | - |
71 | | - |
72 | | - |
73 | 60 | |
74 | 61 | |
75 | 62 | |
| 63 | + |
| 64 | + |
76 | 65 | |
77 | | - |
78 | | - |
79 | | - |
80 | | - |
81 | | - |
82 | | - |
83 | | - |
84 | | - |
85 | | - |
86 | | - |
87 | | - |
88 | | - |
89 | | - |
90 | | - |
91 | | - |
92 | | - |
93 | | - |
94 | | - |
95 | | - |
96 | | - |
97 | | - |
98 | | - |
99 | 66 | |
100 | 67 | |
101 | 68 | |
| ||
119 | 86 | |
120 | 87 | |
121 | 88 | |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | + |
122 | 94 | |
123 | 95 | |
124 | 96 | |
| ||
128 | 100 | |
129 | 101 | |
130 | 102 | |
131 | | - |
132 | | - |
133 | | - |
134 | | - |
135 | | - |
136 | | - |
137 | | - |
138 | | - |
139 | | - |
140 | | - |
141 | | - |
142 | | - |
143 | | - |
144 | | - |
145 | | - |
146 | | - |
147 | | - |
148 | | - |
149 | | - |
150 | | - |
151 | | - |
152 | | - |
153 | | - |
154 | | - |
155 | | - |
156 | | - |
157 | | - |
158 | | - |
159 | 103 | |
160 | 104 | |
161 | 105 | |
| ||
343 | 287 | |
344 | 288 | |
345 | 289 | |
346 | | - |
347 | | - |
348 | | - |
349 | | - |
350 | | - |
351 | | - |
352 | | - |
353 | | - |
354 | | - |
355 | | - |
356 | | - |
357 | | - |
358 | | - |
359 | | - |
360 | | - |
361 | | - |
362 | | - |
363 | | - |
364 | | - |
365 | | - |
366 | | - |
367 | | - |
368 | | - |
369 | | - |
370 | | - |
371 | 290 | |
372 | 291 | |
373 | 292 | |
|
Collapse file
lib/internal/bootstrap/pre_execution.js
Copy file name to clipboardExpand all lines: lib/internal/bootstrap/pre_execution.js+1-17Lines changed: 1 addition & 17 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
37 | 37 | |
38 | 38 | |
39 | 39 | |
40 | | - |
41 | | - |
42 | | - |
43 | 40 | |
44 | 41 | |
45 | 42 | |
| ||
175 | 172 | |
176 | 173 | |
177 | 174 | |
178 | | - |
179 | | - |
180 | | - |
181 | | - |
182 | | - |
183 | | - |
184 | | - |
185 | | - |
186 | | - |
187 | | - |
188 | | - |
189 | | - |
190 | | - |
191 | | - |
| 175 | + |
192 | 176 | |
193 | 177 | |
194 | 178 | |
|
Collapse file
lib/internal/bootstrap/switches/does_not_own_process_state.js
Copy file name to clipboard+18Lines changed: 18 additions & 0 deletions
| 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 | + |
Collapse file
lib/internal/bootstrap/switches/does_own_process_state.js
Copy file name to clipboard+96Lines changed: 96 additions & 0 deletions
| 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 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | + |
| 94 | + |
| 95 | + |
| 96 | + |
0 commit comments