|
174 | 174 | } |
175 | 175 | } |
176 | 176 |
|
| 177 | + perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE); |
| 178 | + |
177 | 179 | // There are various modes that Node can run in. The most common two |
178 | 180 | // are running from a script and running the REPL - but there are a few |
179 | 181 | // others like the debugger or running --eval arguments. Here we decide |
|
186 | 188 | // To allow people to extend Node in different ways, this hook allows |
187 | 189 | // one to drop a file lib/_third_party_main.js into the build |
188 | 190 | // directory which will be executed instead of Node's normal loading. |
189 | | - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE); |
190 | 191 | process.nextTick(function() { |
191 | 192 | perf.markMilestone(NODE_PERFORMANCE_MILESTONE_THIRD_PARTY_MAIN_START); |
192 | 193 | NativeModule.require('_third_party_main'); |
|
200 | 201 | } |
201 | 202 |
|
202 | 203 | // Start the debugger agent. |
203 | | - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE); |
204 | 204 | process.nextTick(function() { |
205 | 205 | NativeModule.require('internal/deps/node-inspect/lib/_inspect').start(); |
206 | 206 | }); |
207 | 207 |
|
208 | 208 | } else if (process.profProcess) { |
209 | | - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE); |
210 | 209 | NativeModule.require('internal/v8_prof_processor'); |
211 | 210 | } else { |
212 | 211 | // There is user code to be run. |
|
238 | 237 | addBuiltinLibsToObject |
239 | 238 | } = NativeModule.require('internal/modules/cjs/helpers'); |
240 | 239 | addBuiltinLibsToObject(global); |
241 | | - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE); |
242 | 240 | evalScript('[eval]'); |
243 | 241 | } else if (process.argv[1] && process.argv[1] !== '-') { |
244 | 242 | perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START); |
|
263 | 261 | checkScriptSyntax(source, filename); |
264 | 262 | process.exit(0); |
265 | 263 | } |
266 | | - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE); |
267 | 264 | CJSModule.runMain(); |
268 | 265 | } else { |
269 | 266 | perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START); |
|
294 | 291 |
|
295 | 292 | if (process._eval != null) { |
296 | 293 | // User passed '-e' or '--eval' |
297 | | - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE); |
298 | 294 | evalScript('[eval]'); |
299 | 295 | } |
300 | 296 | } else { |
|
311 | 307 | checkScriptSyntax(code, '[stdin]'); |
312 | 308 | } else { |
313 | 309 | process._eval = code; |
314 | | - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE); |
315 | 310 | evalScript('[stdin]'); |
316 | 311 | } |
317 | 312 | }); |
318 | 313 | } |
319 | 314 | } |
320 | 315 | } |
321 | | - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE); |
322 | 316 | } |
323 | 317 |
|
324 | 318 | function setupProcessObject() { |
|
0 commit comments