| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 FixedArray* p = FixedArray::cast(elements()); | 318 FixedArray* p = FixedArray::cast(elements()); |
| 319 for (int i = 0; i < p->length(); i++) { | 319 for (int i = 0; i < p->length(); i++) { |
| 320 PrintF(out, " %d: ", i); | 320 PrintF(out, " %d: ", i); |
| 321 p->get(i)->ShortPrint(out); | 321 p->get(i)->ShortPrint(out); |
| 322 PrintF(out, "\n"); | 322 PrintF(out, "\n"); |
| 323 } | 323 } |
| 324 break; | 324 break; |
| 325 } | 325 } |
| 326 case FAST_DOUBLE_ELEMENTS: { | 326 case FAST_DOUBLE_ELEMENTS: { |
| 327 // Print in array notation for non-sparse arrays. | 327 // Print in array notation for non-sparse arrays. |
| 328 FixedDoubleArray* p = FixedDoubleArray::cast(elements()); | 328 if (elements()->length() > 0) { |
| 329 for (int i = 0; i < p->length(); i++) { | 329 FixedDoubleArray* p = FixedDoubleArray::cast(elements()); |
| 330 if (p->is_the_hole(i)) { | 330 for (int i = 0; i < p->length(); i++) { |
| 331 PrintF(out, " %d: <the hole>", i); | 331 if (p->is_the_hole(i)) { |
| 332 } else { | 332 PrintF(out, " %d: <the hole>", i); |
| 333 PrintF(out, " %d: %g", i, p->get_scalar(i)); | 333 } else { |
| 334 PrintF(out, " %d: %g", i, p->get_scalar(i)); |
| 335 } |
| 336 PrintF(out, "\n"); |
| 334 } | 337 } |
| 335 PrintF(out, "\n"); | |
| 336 } | 338 } |
| 337 break; | 339 break; |
| 338 } | 340 } |
| 339 case EXTERNAL_PIXEL_ELEMENTS: { | 341 case EXTERNAL_PIXEL_ELEMENTS: { |
| 340 ExternalPixelArray* p = ExternalPixelArray::cast(elements()); | 342 ExternalPixelArray* p = ExternalPixelArray::cast(elements()); |
| 341 for (int i = 0; i < p->length(); i++) { | 343 for (int i = 0; i < p->length(); i++) { |
| 342 PrintF(out, " %d: %d\n", i, p->get_scalar(i)); | 344 PrintF(out, " %d: %d\n", i, p->get_scalar(i)); |
| 343 } | 345 } |
| 344 break; | 346 break; |
| 345 } | 347 } |
| (...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 965 desc.Print(out); | 967 desc.Print(out); |
| 966 } | 968 } |
| 967 PrintF(out, "\n"); | 969 PrintF(out, "\n"); |
| 968 } | 970 } |
| 969 | 971 |
| 970 | 972 |
| 971 #endif // OBJECT_PRINT | 973 #endif // OBJECT_PRINT |
| 972 | 974 |
| 973 | 975 |
| 974 } } // namespace v8::internal | 976 } } // namespace v8::internal |
| OLD | NEW |