diff options
author | Timothy J Fontaine <tjfontaine@gmail.com> | 2013-10-22 15:14:25 -0700 |
---|---|---|
committer | Timothy J Fontaine <tjfontaine@gmail.com> | 2013-10-23 09:17:31 -0700 |
commit | a53c763c16eeabb0901a05dbcf38a72fa96d2f26 (patch) | |
tree | 309bf250e1521cedf0e945d7a7629db511e64498 /deps/v8/tools/profviz | |
parent | 54910044b33a6405c72ad085915a55c575c027fc (diff) | |
download | android-node-v8-a53c763c16eeabb0901a05dbcf38a72fa96d2f26.tar.gz android-node-v8-a53c763c16eeabb0901a05dbcf38a72fa96d2f26.tar.bz2 android-node-v8-a53c763c16eeabb0901a05dbcf38a72fa96d2f26.zip |
v8: upgrade 3.21.18.3
Diffstat (limited to 'deps/v8/tools/profviz')
-rw-r--r-- | deps/v8/tools/profviz/composer.js | 75 | ||||
-rw-r--r-- | deps/v8/tools/profviz/profviz.html | 7 | ||||
-rw-r--r-- | deps/v8/tools/profviz/profviz.js | 22 | ||||
-rw-r--r-- | deps/v8/tools/profviz/stdio.js | 6 | ||||
-rw-r--r-- | deps/v8/tools/profviz/worker.js | 8 |
5 files changed, 40 insertions, 78 deletions
diff --git a/deps/v8/tools/profviz/composer.js b/deps/v8/tools/profviz/composer.js index cdfc0b7b39..44dd7639de 100644 --- a/deps/v8/tools/profviz/composer.js +++ b/deps/v8/tools/profviz/composer.js @@ -31,7 +31,7 @@ Array.prototype.top = function() { } -function PlotScriptComposer(kResX, kResY) { +function PlotScriptComposer(kResX, kResY, error_output) { // Constants. var kV8BinarySuffixes = ["/d8", "/libv8.so"]; var kStackFrames = 8; // Stack frames to display in the plot. @@ -101,7 +101,7 @@ function PlotScriptComposer(kResX, kResY) { new TimerEvent("compile unopt", "#CC0000", true, 0), 'V8.RecompileSynchronous': new TimerEvent("recompile sync", "#CC0044", true, 0), - 'V8.RecompileParallel': + 'V8.RecompileConcurrent': new TimerEvent("recompile async", "#CC4499", false, 1), 'V8.CompileEval': new TimerEvent("compile eval", "#CC4400", true, 0), @@ -149,7 +149,10 @@ function PlotScriptComposer(kResX, kResY) { // Utility functions. function assert(something, message) { - if (!something) print(new Error(message).stack); + if (!something) { + var error = new Error(message); + error_output(error.stack); + } } function FindCodeKind(kind) { @@ -208,10 +211,15 @@ function PlotScriptComposer(kResX, kResY) { // Public methods. this.collectData = function(input, distortion_per_entry) { + var last_timestamp = 0; + // Parse functions. var parseTimeStamp = function(timestamp) { + int_timestamp = parseInt(timestamp); + assert(int_timestamp >= last_timestamp, "Inconsistent timestamps."); + last_timestamp = int_timestamp; distortion += distortion_per_entry; - return parseInt(timestamp) / 1000 - distortion; + return int_timestamp / 1000 - distortion; } var processTimerEventStart = function(name, start) { @@ -260,65 +268,6 @@ function PlotScriptComposer(kResX, kResY) { code_map.deleteCode(address); }; - var processSharedLibrary = function(name, start, end) { - var code_entry = new CodeMap.CodeEntry(end - start, name); - code_entry.kind = -2; // External code kind. - for (var i = 0; i < kV8BinarySuffixes.length; i++) { - var suffix = kV8BinarySuffixes[i]; - if (name.indexOf(suffix, name.length - suffix.length) >= 0) { - code_entry.kind = -1; // V8 runtime code kind. - break; - } - } - code_map.addLibrary(start, code_entry); - }; - - var processTimerEventStart = function(name, start) { - // Find out the thread id. - var new_event = TimerEvents[name]; - if (new_event === undefined) return; - var thread_id = new_event.thread_id; - - start = Math.max(last_time_stamp[thread_id] + kMinRangeLength, start); - - // Last event on this thread is done with the start of this event. - var last_event = event_stack[thread_id].top(); - if (last_event !== undefined) { - var new_range = new Range(last_time_stamp[thread_id], start); - last_event.ranges.push(new_range); - } - event_stack[thread_id].push(new_event); - last_time_stamp[thread_id] = start; - }; - - var processTimerEventEnd = function(name, end) { - // Find out about the thread_id. - var finished_event = TimerEvents[name]; - var thread_id = finished_event.thread_id; - assert(finished_event === event_stack[thread_id].pop(), - "inconsistent event stack"); - - end = Math.max(last_time_stamp[thread_id] + kMinRangeLength, end); - - var new_range = new Range(last_time_stamp[thread_id], end); - finished_event.ranges.push(new_range); - last_time_stamp[thread_id] = end; - }; - - var processCodeCreateEvent = function(type, kind, address, size, name) { - var code_entry = new CodeMap.CodeEntry(size, name); - code_entry.kind = kind; - code_map.addCode(address, code_entry); - }; - - var processCodeMoveEvent = function(from, to) { - code_map.moveCode(from, to); - }; - - var processCodeDeleteEvent = function(address) { - code_map.deleteCode(address); - }; - var processCodeDeoptEvent = function(time, size) { deopts.push(new Deopt(time, size)); } diff --git a/deps/v8/tools/profviz/profviz.html b/deps/v8/tools/profviz/profviz.html index 30494f80fe..d7dd9cb950 100644 --- a/deps/v8/tools/profviz/profviz.html +++ b/deps/v8/tools/profviz/profviz.html @@ -96,7 +96,7 @@ your computer's performance."> or alternatively,<br/> Chrome with <span class="tt"> - --no-sandbox --js-flags="--prof --noprof-lazy --log-timer-events + --no-sandbox --js-flags="--prof --log-timer-events" </span> to produce <span class="tt">v8.log</span>. </li> <li> @@ -117,6 +117,11 @@ your computer's performance."> command-line utility </a> instead. </li> + </ol> + If you expect multiple V8 instances to run concurrently, for example + with several tabs in Chrome,<br/> + add the V8 flag <span class="tt">--logfile=v8.%p.log</span> + so that each instance writes to its own log file. </div> </div> diff --git a/deps/v8/tools/profviz/profviz.js b/deps/v8/tools/profviz/profviz.js index 7af12adc7e..8ac0881eb6 100644 --- a/deps/v8/tools/profviz/profviz.js +++ b/deps/v8/tools/profviz/profviz.js @@ -42,15 +42,6 @@ var worker_scripts = [ function plotWorker() { var worker = null; - var delegateList = { - "log" : log, - "error" : logError, - "displayplot" : displayplot, - "displayprof" : displayprof, - "range" : setRange, - "script" : scriptLoaded - } - function initialize() { ui.freeze(); worker = new Worker("worker.js"); @@ -89,6 +80,16 @@ function plotWorker() { if (worker) worker.terminate(); initialize(); } + + var delegateList = { + "log" : log, + "error" : logError, + "displayplot" : displayplot, + "displayprof" : displayprof, + "range" : setRange, + "script" : scriptLoaded, + "reset" : this.reset + } } @@ -233,9 +234,6 @@ function start(event) { function getSelectedFile() { var file = ui.file.files[0]; if (!file) throw Error("No valid file selected."); - if (!file.type.toString().match(/text/)) { - throw Error("'" + escape(file.name) + "' is not a text file."); - } return file; } diff --git a/deps/v8/tools/profviz/stdio.js b/deps/v8/tools/profviz/stdio.js index e8001494c9..db38f042a7 100644 --- a/deps/v8/tools/profviz/stdio.js +++ b/deps/v8/tools/profviz/stdio.js @@ -44,7 +44,11 @@ if (!isNaN(range_end)) range_end_override = range_end; var kResX = 1600; var kResY = 600; -var psc = new PlotScriptComposer(kResX, kResY); +function log_error(text) { + print(text); + quit(1); +} +var psc = new PlotScriptComposer(kResX, kResY, log_error); psc.collectData(readline, distortion_per_entry); psc.findPlotRange(range_start_override, range_end_override); print("set terminal pngcairo size " + kResX + "," + kResY + diff --git a/deps/v8/tools/profviz/worker.js b/deps/v8/tools/profviz/worker.js index 60a557f982..b17ca29f58 100644 --- a/deps/v8/tools/profviz/worker.js +++ b/deps/v8/tools/profviz/worker.js @@ -72,6 +72,12 @@ function load_scripts(scripts) { } +function log_error(text) { + self.postMessage({"call": "error", "args": text}); + self.postMessage({"call": "reset"}); +} + + function run(args) { var file = args["file"]; var resx = args["resx"]; @@ -121,7 +127,7 @@ function run(args) { var input_file_name = "input_temp"; var output_file_name = "output.svg"; - var psc = new PlotScriptComposer(resx, resy); + var psc = new PlotScriptComposer(resx, resy, log_error); var objects = 0; time("Collecting events (" + content_lines.length + " entries)", |