|
68 | 68 | const perf = process.binding('performance');
|
69 | 69 | const {
|
70 | 70 | NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE,
|
71 |
| - NODE_PERFORMANCE_MILESTONE_THIRD_PARTY_MAIN_START, |
72 |
| - NODE_PERFORMANCE_MILESTONE_THIRD_PARTY_MAIN_END, |
73 |
| - NODE_PERFORMANCE_MILESTONE_CLUSTER_SETUP_START, |
74 |
| - NODE_PERFORMANCE_MILESTONE_CLUSTER_SETUP_END, |
75 |
| - NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START, |
76 |
| - NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_END, |
77 |
| - NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_START, |
78 |
| - NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_END |
79 | 71 | } = perf.constants;
|
80 | 72 |
|
81 | 73 | _process.setup_hrtime(_hrtime);
|
|
189 | 181 | // one to drop a file lib/_third_party_main.js into the build
|
190 | 182 | // directory which will be executed instead of Node's normal loading.
|
191 | 183 | process.nextTick(function() {
|
192 |
| - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_THIRD_PARTY_MAIN_START); |
193 | 184 | NativeModule.require('_third_party_main');
|
194 |
| - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_THIRD_PARTY_MAIN_END); |
195 | 185 | });
|
196 | 186 | } else if (process.argv[1] === 'inspect' || process.argv[1] === 'debug') {
|
197 | 187 | if (process.argv[1] === 'debug') {
|
|
214 | 204 | // channel. This needs to be done before any user code gets executed
|
215 | 205 | // (including preload modules).
|
216 | 206 | if (process.argv[1] && process.env.NODE_UNIQUE_ID) {
|
217 |
| - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_CLUSTER_SETUP_START); |
218 | 207 | const cluster = NativeModule.require('cluster');
|
219 | 208 | cluster._setupWorker();
|
220 |
| - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_CLUSTER_SETUP_END); |
221 | 209 | // Make sure it's not accidentally inherited by child processes.
|
222 | 210 | delete process.env.NODE_UNIQUE_ID;
|
223 | 211 | }
|
224 | 212 |
|
225 | 213 | if (process._eval != null && !process._forceRepl) {
|
226 |
| - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START); |
227 |
| - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_END); |
228 | 214 | // User passed '-e' or '--eval' arguments to Node without '-i' or
|
229 | 215 | // '--interactive'.
|
230 |
| - |
231 |
| - perf.markMilestone( |
232 |
| - NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_START); |
233 | 216 | preloadModules();
|
234 |
| - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_END); |
235 | 217 |
|
236 | 218 | const {
|
237 | 219 | addBuiltinLibsToObject
|
238 | 220 | } = NativeModule.require('internal/modules/cjs/helpers');
|
239 | 221 | addBuiltinLibsToObject(global);
|
240 | 222 | evalScript('[eval]');
|
241 | 223 | } else if (process.argv[1] && process.argv[1] !== '-') {
|
242 |
| - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START); |
243 | 224 | // Make process.argv[1] into a full path.
|
244 | 225 | const path = NativeModule.require('path');
|
245 | 226 | process.argv[1] = path.resolve(process.argv[1]);
|
246 | 227 |
|
247 | 228 | const CJSModule = NativeModule.require('internal/modules/cjs/loader');
|
248 | 229 |
|
249 |
| - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_END); |
250 |
| - perf.markMilestone( |
251 |
| - NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_START); |
252 | 230 | preloadModules();
|
253 |
| - perf.markMilestone( |
254 |
| - NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_END); |
255 | 231 | // Check if user passed `-c` or `--check` arguments to Node.
|
256 | 232 | if (process._syntax_check_only != null) {
|
257 | 233 | const fs = NativeModule.require('fs');
|
|
263 | 239 | }
|
264 | 240 | CJSModule.runMain();
|
265 | 241 | } else {
|
266 |
| - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START); |
267 |
| - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_END); |
268 |
| - perf.markMilestone( |
269 |
| - NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_START); |
270 | 242 | preloadModules();
|
271 |
| - perf.markMilestone( |
272 |
| - NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_END); |
273 | 243 | // If -i or --interactive were passed, or stdin is a TTY.
|
274 | 244 | if (process._forceRepl || NativeModule.require('tty').isatty(0)) {
|
275 | 245 | // REPL
|
|
0 commit comments