Fix bug in tools/plot-timer-events
authoryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 6 Jun 2014 08:15:05 +0000 (08:15 +0000)
committeryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 6 Jun 2014 08:15:05 +0000 (08:15 +0000)
Bug was introduced in r21338.

R=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/314143004

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21707 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/bootstrapper.cc
tools/plot-timer-events
tools/profviz/composer.js

index 9f59bcd..69aff08 100644 (file)
@@ -1071,7 +1071,7 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
     native_context()->set_json_object(*json_object);
   }
 
-  { // -- A r r a y B u f f e r
+  {  // -- A r r a y B u f f e r
     Handle<JSFunction> array_buffer_fun =
         InstallFunction(
             global, "ArrayBuffer", JS_ARRAY_BUFFER_TYPE,
@@ -1081,7 +1081,7 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
     native_context()->set_array_buffer_fun(*array_buffer_fun);
   }
 
-  { // -- T y p e d A r r a y s
+  {  // -- T y p e d A r r a y s
 #define INSTALL_TYPED_ARRAY(Type, type, TYPE, ctype, size)                    \
     {                                                                         \
       Handle<JSFunction> fun;                                                 \
index 87ae0a0..15f28ac 100755 (executable)
@@ -15,7 +15,7 @@ if test ! "$D8_PATH"; then
   if test -x "$d8_public"; then D8_PATH=$(dirname "$d8_public"); fi
 fi
 
-if test -n "$D8_PATH"; then
+if test -n "$D8_PATH"; then
   D8_PATH=$tools_path/..
 fi
 
index 0c9437f..f9b3f2e 100644 (file)
@@ -502,7 +502,8 @@ function PlotScriptComposer(kResX, kResY, error_output) {
     execution_pauses.sort(
         function(a, b) { return b.duration() - a.duration(); });
 
-    var max_pause_time = execution_pauses[0].duration();
+    var max_pause_time = execution_pauses.length > 0
+        ? execution_pauses[0].duration() : 0;
     padding = kPauseLabelPadding * (range_end - range_start) / kResX;
     var y_scale = kY1Offset / max_pause_time / 2;
     for (var i = 0; i < execution_pauses.length && i < kNumPauseLabels; i++) {