OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 FixedArray* p = FixedArray::cast(elements()); | 324 FixedArray* p = FixedArray::cast(elements()); |
325 for (int i = 0; i < p->length(); i++) { | 325 for (int i = 0; i < p->length(); i++) { |
326 PrintF(out, " %d: ", i); | 326 PrintF(out, " %d: ", i); |
327 p->get(i)->ShortPrint(out); | 327 p->get(i)->ShortPrint(out); |
328 PrintF(out, "\n"); | 328 PrintF(out, "\n"); |
329 } | 329 } |
330 break; | 330 break; |
331 } | 331 } |
332 case FAST_DOUBLE_ELEMENTS: { | 332 case FAST_DOUBLE_ELEMENTS: { |
333 // Print in array notation for non-sparse arrays. | 333 // Print in array notation for non-sparse arrays. |
334 FixedDoubleArray* p = FixedDoubleArray::cast(elements()); | 334 if (elements()->length() > 0) { |
335 for (int i = 0; i < p->length(); i++) { | 335 FixedDoubleArray* p = FixedDoubleArray::cast(elements()); |
336 if (p->is_the_hole(i)) { | 336 for (int i = 0; i < p->length(); i++) { |
337 PrintF(out, " %d: <the hole>", i); | 337 if (p->is_the_hole(i)) { |
338 } else { | 338 PrintF(out, " %d: <the hole>", i); |
339 PrintF(out, " %d: %g", i, p->get_scalar(i)); | 339 } else { |
| 340 PrintF(out, " %d: %g", i, p->get_scalar(i)); |
| 341 } |
| 342 PrintF(out, "\n"); |
340 } | 343 } |
341 PrintF(out, "\n"); | |
342 } | 344 } |
343 break; | 345 break; |
344 } | 346 } |
345 case EXTERNAL_PIXEL_ELEMENTS: { | 347 case EXTERNAL_PIXEL_ELEMENTS: { |
346 ExternalPixelArray* p = ExternalPixelArray::cast(elements()); | 348 ExternalPixelArray* p = ExternalPixelArray::cast(elements()); |
347 for (int i = 0; i < p->length(); i++) { | 349 for (int i = 0; i < p->length(); i++) { |
348 PrintF(out, " %d: %d\n", i, p->get_scalar(i)); | 350 PrintF(out, " %d: %d\n", i, p->get_scalar(i)); |
349 } | 351 } |
350 break; | 352 break; |
351 } | 353 } |
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1028 desc.Print(out); | 1030 desc.Print(out); |
1029 } | 1031 } |
1030 PrintF(out, "\n"); | 1032 PrintF(out, "\n"); |
1031 } | 1033 } |
1032 | 1034 |
1033 | 1035 |
1034 #endif // OBJECT_PRINT | 1036 #endif // OBJECT_PRINT |
1035 | 1037 |
1036 | 1038 |
1037 } } // namespace v8::internal | 1039 } } // namespace v8::internal |
OLD | NEW |