Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(231)

Unified Diff: tools/tickprocessor.js

Issue 14367020: Revert r14252 as it broke --prof for some cases (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/tools/tickprocessor-test-func-info.log ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/tickprocessor.js
diff --git a/tools/tickprocessor.js b/tools/tickprocessor.js
index 0ffe7342a998846fcb940308537b96bcb26a930f..c9ee1011f066abfc1aae9353ac589e65cce03fcd 100644
--- a/tools/tickprocessor.js
+++ b/tools/tickprocessor.js
@@ -170,7 +170,7 @@ function TickProcessor(
processor: this.processSnapshotPosition },
'tick': {
parsers: [parseInt, parseInt, parseInt, parseInt,
- parseInt, 'var-args'],
+ parseInt, parseInt, 'var-args'],
processor: this.processTick },
'heap-sample-begin': { parsers: [null, null, parseInt],
processor: this.processHeapSampleBegin },
@@ -368,7 +368,8 @@ TickProcessor.prototype.includeTick = function(vmState) {
TickProcessor.prototype.processTick = function(pc,
sp,
ns_since_start,
- external_callback,
+ is_external_callback,
+ tos_or_external_callback,
vmState,
stack) {
this.distortion += this.distortion_per_entry;
@@ -382,15 +383,23 @@ TickProcessor.prototype.processTick = function(pc,
this.ticks_.excluded++;
return;
}
- if (external_callback) {
+ if (is_external_callback) {
// Don't use PC when in external callback code, as it can point
// inside callback's code, and we will erroneously report
// that a callback calls itself. Instead we use tos_or_external_callback,
// as simply resetting PC will produce unaccounted ticks.
- pc = 0;
- }
+ pc = tos_or_external_callback;
+ tos_or_external_callback = 0;
+ } else if (tos_or_external_callback) {
+ // Find out, if top of stack was pointing inside a JS function
+ // meaning that we have encountered a frameless invocation.
+ var funcEntry = this.profile_.findEntry(tos_or_external_callback);
+ if (!funcEntry || !funcEntry.isJSFunction || !funcEntry.isJSFunction()) {
+ tos_or_external_callback = 0;
+ }
+ }
- this.profile_.recordTick(this.processStack(pc, external_callback, stack));
+ this.profile_.recordTick(this.processStack(pc, tos_or_external_callback, stack));
};
« no previous file with comments | « test/mjsunit/tools/tickprocessor-test-func-info.log ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698