| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 var suffix = kV8BinarySuffixes[i]; | 330 var suffix = kV8BinarySuffixes[i]; |
| 331 if (name.indexOf(suffix, name.length - suffix.length) >= 0) { | 331 if (name.indexOf(suffix, name.length - suffix.length) >= 0) { |
| 332 code_entry.kind = -1; // V8 runtime code kind. | 332 code_entry.kind = -1; // V8 runtime code kind. |
| 333 break; | 333 break; |
| 334 } | 334 } |
| 335 } | 335 } |
| 336 code_map.addLibrary(start, code_entry); | 336 code_map.addLibrary(start, code_entry); |
| 337 }; | 337 }; |
| 338 | 338 |
| 339 var processTickEvent = function( | 339 var processTickEvent = function( |
| 340 pc, sp, timer, unused_x, unused_y, vmstate, stack) { | 340 pc, timer, unused_x, unused_y, vmstate, stack) { |
| 341 var tick = new Tick(timer); | 341 var tick = new Tick(timer); |
| 342 | 342 |
| 343 var entry = code_map.findEntry(pc); | 343 var entry = code_map.findEntry(pc); |
| 344 if (entry) FindCodeKind(entry.kind).in_execution.push(tick); | 344 if (entry) FindCodeKind(entry.kind).in_execution.push(tick); |
| 345 | 345 |
| 346 for (var i = 0; i < kStackFrames; i++) { | 346 for (var i = 0; i < kStackFrames; i++) { |
| 347 if (!stack[i]) break; | 347 if (!stack[i]) break; |
| 348 var entry = code_map.findEntry(stack[i]); | 348 var entry = code_map.findEntry(stack[i]); |
| 349 if (entry) FindCodeKind(entry.kind).stack_frames[i].push(tick); | 349 if (entry) FindCodeKind(entry.kind).stack_frames[i].push(tick); |
| 350 } | 350 } |
| 351 }; | 351 }; |
| 352 // Collect data from log. | 352 // Collect data from log. |
| 353 var logreader = new LogReader( | 353 var logreader = new LogReader( |
| 354 { 'timer-event-start': { parsers: [null, parseTimeStamp], | 354 { 'timer-event-start': { parsers: [null, parseTimeStamp], |
| 355 processor: processTimerEventStart }, | 355 processor: processTimerEventStart }, |
| 356 'timer-event-end': { parsers: [null, parseTimeStamp], | 356 'timer-event-end': { parsers: [null, parseTimeStamp], |
| 357 processor: processTimerEventEnd }, | 357 processor: processTimerEventEnd }, |
| 358 'shared-library': { parsers: [null, parseInt, parseInt], | 358 'shared-library': { parsers: [null, parseInt, parseInt], |
| 359 processor: processSharedLibrary }, | 359 processor: processSharedLibrary }, |
| 360 'code-creation': { parsers: [null, parseInt, parseInt, parseInt, null], | 360 'code-creation': { parsers: [null, parseInt, parseInt, parseInt, null], |
| 361 processor: processCodeCreateEvent }, | 361 processor: processCodeCreateEvent }, |
| 362 'code-move': { parsers: [parseInt, parseInt], | 362 'code-move': { parsers: [parseInt, parseInt], |
| 363 processor: processCodeMoveEvent }, | 363 processor: processCodeMoveEvent }, |
| 364 'code-delete': { parsers: [parseInt], | 364 'code-delete': { parsers: [parseInt], |
| 365 processor: processCodeDeleteEvent }, | 365 processor: processCodeDeleteEvent }, |
| 366 'code-deopt': { parsers: [parseTimeStamp, parseInt], | 366 'code-deopt': { parsers: [parseTimeStamp, parseInt], |
| 367 processor: processCodeDeoptEvent }, | 367 processor: processCodeDeoptEvent }, |
| 368 'tick': { parsers: [parseInt, parseInt, parseTimeStamp, | 368 'tick': { parsers: [parseInt, parseTimeStamp, |
| 369 null, null, parseInt, 'var-args'], | 369 null, null, parseInt, 'var-args'], |
| 370 processor: processTickEvent } | 370 processor: processTickEvent } |
| 371 }); | 371 }); |
| 372 | 372 |
| 373 var line; | 373 var line; |
| 374 while (line = input()) { | 374 while (line = input()) { |
| 375 logreader.processLogLine(line); | 375 logreader.processLogLine(line); |
| 376 } | 376 } |
| 377 | 377 |
| 378 // Collect execution pauses. | 378 // Collect execution pauses. |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 output("plot '-' using 1:2 axes x1y2 with impulses ls 1"); | 571 output("plot '-' using 1:2 axes x1y2 with impulses ls 1"); |
| 572 for (var i = 0; i < execution_pauses.length; i++) { | 572 for (var i = 0; i < execution_pauses.length; i++) { |
| 573 var pause = execution_pauses[i]; | 573 var pause = execution_pauses[i]; |
| 574 output(pause.end + " " + pause.duration()); | 574 output(pause.end + " " + pause.duration()); |
| 575 obj_index++; | 575 obj_index++; |
| 576 } | 576 } |
| 577 output("e"); | 577 output("e"); |
| 578 return obj_index; | 578 return obj_index; |
| 579 }; | 579 }; |
| 580 } | 580 } |
| OLD | NEW |