Merge V8 at 3.9.24.28

Bug: 6519007 / 6517949 / 6518772
Change-Id: Idc3e1297aeafa0274fa9fc321e91b774091d1b50
diff --git a/src/objects-printer.cc b/src/objects-printer.cc
index 2353a95..a12b813 100644
--- a/src/objects-printer.cc
+++ b/src/objects-printer.cc
@@ -328,14 +328,16 @@
     }
     case FAST_DOUBLE_ELEMENTS: {
       // Print in array notation for non-sparse arrays.
-      FixedDoubleArray* p = FixedDoubleArray::cast(elements());
-      for (int i = 0; i < p->length(); i++) {
-        if (p->is_the_hole(i)) {
-          PrintF(out, "   %d: <the hole>", i);
-        } else {
-          PrintF(out, "   %d: %g", i, p->get_scalar(i));
+      if (elements()->length() > 0) {
+        FixedDoubleArray* p = FixedDoubleArray::cast(elements());
+        for (int i = 0; i < p->length(); i++) {
+          if (p->is_the_hole(i)) {
+            PrintF(out, "   %d: <the hole>", i);
+          } else {
+            PrintF(out, "   %d: %g", i, p->get_scalar(i));
+          }
+          PrintF(out, "\n");
         }
-        PrintF(out, "\n");
       }
       break;
     }