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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 FixedArray* p = FixedArray::cast(elements()); | 321 FixedArray* p = FixedArray::cast(elements()); |
322 for (int i = 0; i < p->length(); i++) { | 322 for (int i = 0; i < p->length(); i++) { |
323 PrintF(out, " %d: ", i); | 323 PrintF(out, " %d: ", i); |
324 p->get(i)->ShortPrint(out); | 324 p->get(i)->ShortPrint(out); |
325 PrintF(out, "\n"); | 325 PrintF(out, "\n"); |
326 } | 326 } |
327 break; | 327 break; |
328 } | 328 } |
329 case FAST_DOUBLE_ELEMENTS: { | 329 case FAST_DOUBLE_ELEMENTS: { |
330 // Print in array notation for non-sparse arrays. | 330 // Print in array notation for non-sparse arrays. |
331 FixedDoubleArray* p = FixedDoubleArray::cast(elements()); | 331 if (elements()->length() > 0) { |
332 for (int i = 0; i < p->length(); i++) { | 332 FixedDoubleArray* p = FixedDoubleArray::cast(elements()); |
333 if (p->is_the_hole(i)) { | 333 for (int i = 0; i < p->length(); i++) { |
334 PrintF(out, " %d: <the hole>", i); | 334 if (p->is_the_hole(i)) { |
335 } else { | 335 PrintF(out, " %d: <the hole>", i); |
336 PrintF(out, " %d: %g", i, p->get_scalar(i)); | 336 } else { |
| 337 PrintF(out, " %d: %g", i, p->get_scalar(i)); |
| 338 } |
| 339 PrintF(out, "\n"); |
337 } | 340 } |
338 PrintF(out, "\n"); | |
339 } | 341 } |
340 break; | 342 break; |
341 } | 343 } |
342 case EXTERNAL_PIXEL_ELEMENTS: { | 344 case EXTERNAL_PIXEL_ELEMENTS: { |
343 ExternalPixelArray* p = ExternalPixelArray::cast(elements()); | 345 ExternalPixelArray* p = ExternalPixelArray::cast(elements()); |
344 for (int i = 0; i < p->length(); i++) { | 346 for (int i = 0; i < p->length(); i++) { |
345 PrintF(out, " %d: %d\n", i, p->get_scalar(i)); | 347 PrintF(out, " %d: %d\n", i, p->get_scalar(i)); |
346 } | 348 } |
347 break; | 349 break; |
348 } | 350 } |
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1011 desc.Print(out); | 1013 desc.Print(out); |
1012 } | 1014 } |
1013 PrintF(out, "\n"); | 1015 PrintF(out, "\n"); |
1014 } | 1016 } |
1015 | 1017 |
1016 | 1018 |
1017 #endif // OBJECT_PRINT | 1019 #endif // OBJECT_PRINT |
1018 | 1020 |
1019 | 1021 |
1020 } } // namespace v8::internal | 1022 } } // namespace v8::internal |
OLD | NEW |