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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/mjsunit/tools/tickprocessor-test-func-info.log ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 'code-move': { parsers: [parseInt, parseInt], 163 'code-move': { parsers: [parseInt, parseInt],
164 processor: this.processCodeMove }, 164 processor: this.processCodeMove },
165 'code-delete': { parsers: [parseInt], 165 'code-delete': { parsers: [parseInt],
166 processor: this.processCodeDelete }, 166 processor: this.processCodeDelete },
167 'sfi-move': { parsers: [parseInt, parseInt], 167 'sfi-move': { parsers: [parseInt, parseInt],
168 processor: this.processFunctionMove }, 168 processor: this.processFunctionMove },
169 'snapshot-pos': { parsers: [parseInt, parseInt], 169 'snapshot-pos': { parsers: [parseInt, parseInt],
170 processor: this.processSnapshotPosition }, 170 processor: this.processSnapshotPosition },
171 'tick': { 171 'tick': {
172 parsers: [parseInt, parseInt, parseInt, parseInt, 172 parsers: [parseInt, parseInt, parseInt, parseInt,
173 parseInt, 'var-args'], 173 parseInt, parseInt, 'var-args'],
174 processor: this.processTick }, 174 processor: this.processTick },
175 'heap-sample-begin': { parsers: [null, null, parseInt], 175 'heap-sample-begin': { parsers: [null, null, parseInt],
176 processor: this.processHeapSampleBegin }, 176 processor: this.processHeapSampleBegin },
177 'heap-sample-end': { parsers: [null, null], 177 'heap-sample-end': { parsers: [null, null],
178 processor: this.processHeapSampleEnd }, 178 processor: this.processHeapSampleEnd },
179 'timer-event-start' : { parsers: [null, null, null], 179 'timer-event-start' : { parsers: [null, null, null],
180 processor: this.advanceDistortion }, 180 processor: this.advanceDistortion },
181 'timer-event-end' : { parsers: [null, null, null], 181 'timer-event-end' : { parsers: [null, null, null],
182 processor: this.advanceDistortion }, 182 processor: this.advanceDistortion },
183 // Ignored events. 183 // Ignored events.
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 }; 361 };
362 362
363 363
364 TickProcessor.prototype.includeTick = function(vmState) { 364 TickProcessor.prototype.includeTick = function(vmState) {
365 return this.stateFilter_ == null || this.stateFilter_ == vmState; 365 return this.stateFilter_ == null || this.stateFilter_ == vmState;
366 }; 366 };
367 367
368 TickProcessor.prototype.processTick = function(pc, 368 TickProcessor.prototype.processTick = function(pc,
369 sp, 369 sp,
370 ns_since_start, 370 ns_since_start,
371 external_callback, 371 is_external_callback,
372 tos_or_external_callback,
372 vmState, 373 vmState,
373 stack) { 374 stack) {
374 this.distortion += this.distortion_per_entry; 375 this.distortion += this.distortion_per_entry;
375 ns_since_start -= this.distortion; 376 ns_since_start -= this.distortion;
376 if (ns_since_start < this.range_start || ns_since_start > this.range_end) { 377 if (ns_since_start < this.range_start || ns_since_start > this.range_end) {
377 return; 378 return;
378 } 379 }
379 this.ticks_.total++; 380 this.ticks_.total++;
380 if (vmState == TickProcessor.VmStates.GC) this.ticks_.gc++; 381 if (vmState == TickProcessor.VmStates.GC) this.ticks_.gc++;
381 if (!this.includeTick(vmState)) { 382 if (!this.includeTick(vmState)) {
382 this.ticks_.excluded++; 383 this.ticks_.excluded++;
383 return; 384 return;
384 } 385 }
385 if (external_callback) { 386 if (is_external_callback) {
386 // Don't use PC when in external callback code, as it can point 387 // Don't use PC when in external callback code, as it can point
387 // inside callback's code, and we will erroneously report 388 // inside callback's code, and we will erroneously report
388 // that a callback calls itself. Instead we use tos_or_external_callback, 389 // that a callback calls itself. Instead we use tos_or_external_callback,
389 // as simply resetting PC will produce unaccounted ticks. 390 // as simply resetting PC will produce unaccounted ticks.
390 pc = 0; 391 pc = tos_or_external_callback;
391 } 392 tos_or_external_callback = 0;
393 } else if (tos_or_external_callback) {
394 // Find out, if top of stack was pointing inside a JS function
395 // meaning that we have encountered a frameless invocation.
396 var funcEntry = this.profile_.findEntry(tos_or_external_callback);
397 if (!funcEntry || !funcEntry.isJSFunction || !funcEntry.isJSFunction()) {
398 tos_or_external_callback = 0;
399 }
400 }
392 401
393 this.profile_.recordTick(this.processStack(pc, external_callback, stack)); 402 this.profile_.recordTick(this.processStack(pc, tos_or_external_callback, stack ));
394 }; 403 };
395 404
396 405
397 TickProcessor.prototype.advanceDistortion = function() { 406 TickProcessor.prototype.advanceDistortion = function() {
398 this.distortion += this.distortion_per_entry; 407 this.distortion += this.distortion_per_entry;
399 } 408 }
400 409
401 410
402 TickProcessor.prototype.processHeapSampleBegin = function(space, state, ticks) { 411 TickProcessor.prototype.processHeapSampleBegin = function(space, state, ticks) {
403 if (space != 'Heap') return; 412 if (space != 'Heap') return;
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 if (arg !== synArg && dispatch === this.argsDispatch_[synArg]) { 905 if (arg !== synArg && dispatch === this.argsDispatch_[synArg]) {
897 synonims.push(synArg); 906 synonims.push(synArg);
898 delete this.argsDispatch_[synArg]; 907 delete this.argsDispatch_[synArg];
899 } 908 }
900 } 909 }
901 print(' ' + padRight(synonims.join(', '), 20) + dispatch[2]); 910 print(' ' + padRight(synonims.join(', '), 20) + dispatch[2]);
902 } 911 }
903 quit(2); 912 quit(2);
904 }; 913 };
905 914
OLDNEW
« 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