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