OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 this.deserializedEntriesNames_[addr] = | 338 this.deserializedEntriesNames_[addr] = |
339 this.snapshotLogProcessor_.getSerializedEntryName(pos); | 339 this.snapshotLogProcessor_.getSerializedEntryName(pos); |
340 } | 340 } |
341 }; | 341 }; |
342 | 342 |
343 | 343 |
344 TickProcessor.prototype.includeTick = function(vmState) { | 344 TickProcessor.prototype.includeTick = function(vmState) { |
345 return this.stateFilter_ == null || this.stateFilter_ == vmState; | 345 return this.stateFilter_ == null || this.stateFilter_ == vmState; |
346 }; | 346 }; |
347 | 347 |
348 | |
349 TickProcessor.prototype.processTick = function(pc, | 348 TickProcessor.prototype.processTick = function(pc, |
350 sp, | 349 sp, |
351 is_external_callback, | 350 is_external_callback, |
352 tos_or_external_callback, | 351 tos_or_external_callback, |
353 vmState, | 352 vmState, |
354 stack) { | 353 stack) { |
355 this.ticks_.total++; | 354 this.ticks_.total++; |
356 if (vmState == TickProcessor.VmStates.GC) this.ticks_.gc++; | 355 if (vmState == TickProcessor.VmStates.GC) this.ticks_.gc++; |
357 if (!this.includeTick(vmState)) { | 356 if (!this.includeTick(vmState)) { |
358 this.ticks_.excluded++; | 357 this.ticks_.excluded++; |
359 return; | 358 return; |
360 } | 359 } |
361 if (is_external_callback) { | 360 if (is_external_callback) { |
362 // Don't use PC when in external callback code, as it can point | 361 // Don't use PC when in external callback code, as it can point |
363 // inside callback's code, and we will erroneously report | 362 // inside callback's code, and we will erroneously report |
364 // that a callback calls itself. | 363 // that a callback calls itself. Instead we use tos_or_external_callback, |
365 pc = 0; | 364 // as simply resetting PC will produce unaccounted ticks. |
| 365 pc = tos_or_external_callback; |
| 366 tos_or_external_callback = 0; |
366 } else if (tos_or_external_callback) { | 367 } else if (tos_or_external_callback) { |
367 // Find out, if top of stack was pointing inside a JS function | 368 // Find out, if top of stack was pointing inside a JS function |
368 // meaning that we have encountered a frameless invocation. | 369 // meaning that we have encountered a frameless invocation. |
369 var funcEntry = this.profile_.findEntry(tos_or_external_callback); | 370 var funcEntry = this.profile_.findEntry(tos_or_external_callback); |
370 if (!funcEntry || !funcEntry.isJSFunction || !funcEntry.isJSFunction()) { | 371 if (!funcEntry || !funcEntry.isJSFunction || !funcEntry.isJSFunction()) { |
371 tos_or_external_callback = 0; | 372 tos_or_external_callback = 0; |
372 } | 373 } |
373 } | 374 } |
374 | 375 |
375 this.profile_.recordTick(this.processStack(pc, tos_or_external_callback, stack
)); | 376 this.profile_.recordTick(this.processStack(pc, tos_or_external_callback, stack
)); |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 if (arg !== synArg && dispatch === this.argsDispatch_[synArg]) { | 868 if (arg !== synArg && dispatch === this.argsDispatch_[synArg]) { |
868 synonims.push(synArg); | 869 synonims.push(synArg); |
869 delete this.argsDispatch_[synArg]; | 870 delete this.argsDispatch_[synArg]; |
870 } | 871 } |
871 } | 872 } |
872 print(' ' + padRight(synonims.join(', '), 20) + dispatch[2]); | 873 print(' ' + padRight(synonims.join(', '), 20) + dispatch[2]); |
873 } | 874 } |
874 quit(2); | 875 quit(2); |
875 }; | 876 }; |
876 | 877 |
OLD | NEW |