|
158 | 158 | // To allow people to extend Node in different ways, this hook allows
|
159 | 159 | // one to drop a file lib/_third_party_main.js into the build
|
160 | 160 | // directory which will be executed instead of Node's normal loading.
|
| 161 | + perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE); |
161 | 162 | process.nextTick(function() {
|
162 | 163 | perf.markMilestone(NODE_PERFORMANCE_MILESTONE_THIRD_PARTY_MAIN_START);
|
163 | 164 | NativeModule.require('_third_party_main');
|
164 | 165 | perf.markMilestone(NODE_PERFORMANCE_MILESTONE_THIRD_PARTY_MAIN_END);
|
165 | 166 | });
|
166 |
| - |
167 | 167 | } else if (process.argv[1] === 'inspect' || process.argv[1] === 'debug') {
|
168 | 168 | if (process.argv[1] === 'debug') {
|
169 | 169 | process.emitWarning(
|
|
172 | 172 | }
|
173 | 173 |
|
174 | 174 | // Start the debugger agent.
|
| 175 | + perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE); |
175 | 176 | process.nextTick(function() {
|
176 | 177 | NativeModule.require('internal/deps/node-inspect/lib/_inspect').start();
|
177 | 178 | });
|
178 | 179 |
|
179 | 180 | } else if (process.profProcess) {
|
| 181 | + perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE); |
180 | 182 | NativeModule.require('internal/v8_prof_processor');
|
181 |
| - |
182 | 183 | } else {
|
183 | 184 | // There is user code to be run.
|
184 | 185 |
|
|
209 | 210 | addBuiltinLibsToObject
|
210 | 211 | } = NativeModule.require('internal/modules/cjs/helpers');
|
211 | 212 | addBuiltinLibsToObject(global);
|
| 213 | + perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE); |
212 | 214 | evalScript('[eval]');
|
213 | 215 | } else if (process.argv[1] && process.argv[1] !== '-') {
|
214 | 216 | perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START);
|
|
233 | 235 | checkScriptSyntax(source, filename);
|
234 | 236 | process.exit(0);
|
235 | 237 | }
|
| 238 | + perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE); |
236 | 239 | CJSModule.runMain();
|
237 | 240 | } else {
|
238 | 241 | perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START);
|
|
263 | 266 |
|
264 | 267 | if (process._eval != null) {
|
265 | 268 | // User passed '-e' or '--eval'
|
| 269 | + perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE); |
266 | 270 | evalScript('[eval]');
|
267 | 271 | }
|
268 | 272 | } else {
|
|
279 | 283 | checkScriptSyntax(code, '[stdin]');
|
280 | 284 | } else {
|
281 | 285 | process._eval = code;
|
| 286 | + perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE); |
282 | 287 | evalScript('[stdin]');
|
283 | 288 | }
|
284 | 289 | });
|
|
0 commit comments