Commit 0e2fbe4
process: specialize building and storage of process.config
Instead of treating config.gypi as a JavaScript file, specialize
the processing in js2c and make the serialized result a real JSON
string (with 'true' and 'false' converted to boolean values) so
we don't have to use a custom deserializer during bootstrap.
In addition, store the JSON string separately in NativeModuleLoader,
and keep it separate from the map of the builtin source code, so
we don't have to put it onto `NativeModule._source` and delete it
later, though we still preserve it in `process.binding('natives')`,
which we don't use anymore.
This patch also makes the map of builtin source code and the
config.gypi string available through side-effect-free getters
in C++.
PR-URL: #24816
Reviewed-By: Gus Caplan <me@gus.host>1 parent 6528ce6 commit 0e2fbe4Copy full SHA for 0e2fbe4
File tree
Expand file treeCollapse file tree
11 files changed
+114
-42
lines changedOpen diff view settings
Filter options
- lib/internal
- bootstrap
- process
- src
- test/parallel
- tools
Expand file treeCollapse file tree
11 files changed
+114
-42
lines changedOpen diff view settings
Collapse file
lib/internal/bootstrap/cache.js
Copy file name to clipboardExpand all lines: lib/internal/bootstrap/cache.js+1-3Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
6 | 6 | |
7 | 7 | |
8 | 8 | |
9 | | - |
| 9 | + |
10 | 10 | |
11 | 11 | |
12 | | - |
13 | 12 | |
14 | 13 | |
15 | 14 | |
16 | 15 | |
17 | 16 | |
18 | 17 | |
19 | 18 | |
20 | | - |
21 | 19 | |
22 | 20 | |
23 | 21 | |
|
Collapse file
lib/internal/bootstrap/loaders.js
Copy file name to clipboardExpand all lines: lib/internal/bootstrap/loaders.js+7-3Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
169 | 169 | |
170 | 170 | |
171 | 171 | |
172 | | - |
| 172 | + |
| 173 | + |
| 174 | + |
| 175 | + |
| 176 | + |
| 177 | + |
173 | 178 | |
174 | 179 | |
175 | | - |
| 180 | + |
176 | 181 | |
177 | 182 | |
178 | 183 | |
| ||
323 | 328 | |
324 | 329 | |
325 | 330 | |
326 | | - |
327 | 331 | |
328 | 332 | |
329 | 333 | |
|
Collapse file
lib/internal/bootstrap/node.js
Copy file name to clipboardExpand all lines: lib/internal/bootstrap/node.js+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
59 | 59 | |
60 | 60 | |
61 | 61 | |
62 | | - |
| 62 | + |
63 | 63 | |
64 | 64 | |
65 | 65 | |
|
Collapse file
lib/internal/process/per_thread.js
Copy file name to clipboardExpand all lines: lib/internal/process/per_thread.js+3-11Lines changed: 3 additions & 11 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
143 | 143 | |
144 | 144 | |
145 | 145 | |
146 | | - |
147 | | - |
148 | | - |
149 | | - |
150 | | - |
151 | | - |
152 | | - |
153 | | - |
154 | | - |
155 | | - |
156 | | - |
| 146 | + |
| 147 | + |
| 148 | + |
157 | 149 | |
158 | 150 | |
159 | 151 | |
|
Collapse file
+2-1Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
140 | 140 | |
141 | 141 | |
142 | 142 | |
| 143 | + |
143 | 144 | |
144 | 145 | |
145 | 146 | |
| ||
312 | 313 | |
313 | 314 | |
314 | 315 | |
315 | | - |
| 316 | + |
316 | 317 | |
317 | 318 | |
318 | 319 | |
|
Collapse file
+7Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
390 | 390 | |
391 | 391 | |
392 | 392 | |
| 393 | + |
| 394 | + |
| 395 | + |
| 396 | + |
| 397 | + |
| 398 | + |
| 399 | + |
393 | 400 | |
394 | 401 | |
395 | 402 | |
|
Collapse file
+41-7Lines changed: 41 additions & 7 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
9 | 9 | |
10 | 10 | |
11 | 11 | |
| 12 | + |
12 | 13 | |
13 | 14 | |
14 | 15 | |
| ||
19 | 20 | |
20 | 21 | |
21 | 22 | |
| 23 | + |
| 24 | + |
22 | 25 | |
| 26 | + |
23 | 27 | |
24 | 28 | |
25 | 29 | |
26 | 30 | |
| 31 | + |
27 | 32 | |
28 | 33 | |
29 | 34 | |
| ||
70 | 75 | |
71 | 76 | |
72 | 77 | |
73 | | - |
74 | | - |
75 | | - |
76 | | - |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | + |
77 | 88 | |
78 | 89 | |
79 | 90 | |
80 | 91 | |
81 | 92 | |
82 | 93 | |
83 | 94 | |
| 95 | + |
| 96 | + |
| 97 | + |
| 98 | + |
84 | 99 | |
85 | 100 | |
86 | 101 | |
87 | 102 | |
88 | 103 | |
89 | 104 | |
90 | 105 | |
91 | | - |
| 106 | + |
92 | 107 | |
93 | 108 | |
94 | 109 | |
| ||
321 | 336 | |
322 | 337 | |
323 | 338 | |
324 | | - |
325 | | - |
| 339 | + |
| 340 | + |
| 341 | + |
| 342 | + |
| 343 | + |
| 344 | + |
| 345 | + |
| 346 | + |
| 347 | + |
| 348 | + |
| 349 | + |
| 350 | + |
| 351 | + |
| 352 | + |
| 353 | + |
| 354 | + |
| 355 | + |
| 356 | + |
| 357 | + |
| 358 | + |
| 359 | + |
326 | 360 | |
327 | 361 | |
328 | 362 | |
|
Collapse file
+15-3Lines changed: 15 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
40 | 40 | |
41 | 41 | |
42 | 42 | |
| 43 | + |
| 44 | + |
| 45 | + |
43 | 46 | |
44 | 47 | |
45 | 48 | |
| ||
56 | 59 | |
57 | 60 | |
58 | 61 | |
59 | | - |
60 | | - |
61 | | - |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
62 | 71 | |
63 | 72 | |
64 | 73 | |
| ||
67 | 76 | |
68 | 77 | |
69 | 78 | |
| 79 | + |
70 | 80 | |
71 | 81 | |
72 | 82 | |
| ||
94 | 104 | |
95 | 105 | |
96 | 106 | |
| 107 | + |
| 108 | + |
97 | 109 | |
98 | 110 | |
99 | 111 | |
|
Collapse file
+10Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
55 | 55 | |
56 | 56 | |
57 | 57 | |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + |
58 | 64 | |
59 | 65 | |
60 | 66 | |
| 67 | + |
61 | 68 | |
62 | 69 | |
63 | 70 | |
64 | 71 | |
| 72 | + |
65 | 73 | |
66 | 74 | |
67 | 75 | |
68 | 76 | |
| 77 | + |
69 | 78 | |
70 | 79 | |
71 | 80 | |
72 | 81 | |
| 82 | + |
73 | 83 | |
74 | 84 | |
75 | 85 | |
|
Collapse file
test/parallel/test-bootstrap-modules.js
Copy file name to clipboardExpand all lines: test/parallel/test-bootstrap-modules.js+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
9 | 9 | |
10 | 10 | |
11 | 11 | |
12 | | - |
| 12 | + |
13 | 13 | |
14 | 14 | |
15 | 15 | |
|
0 commit comments