Index: tools/profviz/stdio.js |
diff --git a/src/marking-thread.h b/tools/profviz/stdio.js |
similarity index 61% |
copy from src/marking-thread.h |
copy to tools/profviz/stdio.js |
index 9efa3af13262165972abf179defac6f83fed4ac9..e8001494c9df641ffbb0cfce90f618ca729339f0 100644 |
--- a/src/marking-thread.h |
+++ b/tools/profviz/stdio.js |
@@ -25,47 +25,28 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-#ifndef V8_MARKING_THREAD_H_ |
-#define V8_MARKING_THREAD_H_ |
- |
-#include "atomicops.h" |
-#include "flags.h" |
-#include "platform.h" |
-#include "v8utils.h" |
- |
-#include "spaces.h" |
- |
-#include "heap.h" |
- |
-namespace v8 { |
-namespace internal { |
- |
-class MarkingThread : public Thread { |
- public: |
- explicit MarkingThread(Isolate* isolate); |
- |
- void Run(); |
- void Stop(); |
- void StartMarking(); |
- void WaitForMarkingThread(); |
- |
- ~MarkingThread() { |
- delete start_marking_semaphore_; |
- delete end_marking_semaphore_; |
- delete stop_semaphore_; |
- } |
- |
- private: |
- Isolate* isolate_; |
- Heap* heap_; |
- Semaphore* start_marking_semaphore_; |
- Semaphore* end_marking_semaphore_; |
- Semaphore* stop_semaphore_; |
- volatile AtomicWord stop_thread_; |
- int id_; |
- static Atomic32 id_counter_; |
-}; |
- |
-} } // namespace v8::internal |
- |
-#endif // V8_MARKING_THREAD_H_ |
+var processor = new ArgumentsProcessor(arguments); |
+var distortion_per_entry = 0; |
+var range_start_override = undefined; |
+var range_end_override = undefined; |
+ |
+if (!processor.parse()) processor.printUsageAndExit();; |
+var result = processor.result(); |
+var distortion = parseInt(result.distortion); |
+if (isNaN(distortion)) processor.printUsageAndExit();; |
+// Convert picoseconds to milliseconds. |
+distortion_per_entry = distortion / 1000000; |
+var rangelimits = result.range.split(","); |
+var range_start = parseInt(rangelimits[0]); |
+var range_end = parseInt(rangelimits[1]); |
+if (!isNaN(range_start)) range_start_override = range_start; |
+if (!isNaN(range_end)) range_end_override = range_end; |
+ |
+var kResX = 1600; |
+var kResY = 600; |
+var psc = new PlotScriptComposer(kResX, kResY); |
+psc.collectData(readline, distortion_per_entry); |
+psc.findPlotRange(range_start_override, range_end_override); |
+print("set terminal pngcairo size " + kResX + "," + kResY + |
+ " enhanced font 'Helvetica,10'"); |
+psc.assembleOutput(print); |