| 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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 } else { | 311 } else { |
| 312 property_dictionary()->Print(out); | 312 property_dictionary()->Print(out); |
| 313 } | 313 } |
| 314 } | 314 } |
| 315 | 315 |
| 316 | 316 |
| 317 void JSObject::PrintElements(FILE* out) { | 317 void JSObject::PrintElements(FILE* out) { |
| 318 // Don't call GetElementsKind, its validation code can cause the printer to | 318 // Don't call GetElementsKind, its validation code can cause the printer to |
| 319 // fail when debugging. | 319 // fail when debugging. |
| 320 switch (map()->elements_kind()) { | 320 switch (map()->elements_kind()) { |
| 321 case FAST_SMI_ONLY_ELEMENTS: | 321 case FAST_HOLEY_SMI_ELEMENTS: |
| 322 case FAST_SMI_ELEMENTS: |
| 323 case FAST_HOLEY_ELEMENTS: |
| 322 case FAST_ELEMENTS: { | 324 case FAST_ELEMENTS: { |
| 323 // Print in array notation for non-sparse arrays. | 325 // Print in array notation for non-sparse arrays. |
| 324 FixedArray* p = FixedArray::cast(elements()); | 326 FixedArray* p = FixedArray::cast(elements()); |
| 325 for (int i = 0; i < p->length(); i++) { | 327 for (int i = 0; i < p->length(); i++) { |
| 326 PrintF(out, " %d: ", i); | 328 PrintF(out, " %d: ", i); |
| 327 p->get(i)->ShortPrint(out); | 329 p->get(i)->ShortPrint(out); |
| 328 PrintF(out, "\n"); | 330 PrintF(out, "\n"); |
| 329 } | 331 } |
| 330 break; | 332 break; |
| 331 } | 333 } |
| 334 case FAST_HOLEY_DOUBLE_ELEMENTS: |
| 332 case FAST_DOUBLE_ELEMENTS: { | 335 case FAST_DOUBLE_ELEMENTS: { |
| 333 // Print in array notation for non-sparse arrays. | 336 // Print in array notation for non-sparse arrays. |
| 334 if (elements()->length() > 0) { | 337 if (elements()->length() > 0) { |
| 335 FixedDoubleArray* p = FixedDoubleArray::cast(elements()); | 338 FixedDoubleArray* p = FixedDoubleArray::cast(elements()); |
| 336 for (int i = 0; i < p->length(); i++) { | 339 for (int i = 0; i < p->length(); i++) { |
| 337 if (p->is_the_hole(i)) { | 340 if (p->is_the_hole(i)) { |
| 338 PrintF(out, " %d: <the hole>", i); | 341 PrintF(out, " %d: <the hole>", i); |
| 339 } else { | 342 } else { |
| 340 PrintF(out, " %d: %g", i, p->get_scalar(i)); | 343 PrintF(out, " %d: %g", i, p->get_scalar(i)); |
| 341 } | 344 } |
| (...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1030 desc.Print(out); | 1033 desc.Print(out); |
| 1031 } | 1034 } |
| 1032 PrintF(out, "\n"); | 1035 PrintF(out, "\n"); |
| 1033 } | 1036 } |
| 1034 | 1037 |
| 1035 | 1038 |
| 1036 #endif // OBJECT_PRINT | 1039 #endif // OBJECT_PRINT |
| 1037 | 1040 |
| 1038 | 1041 |
| 1039 } } // namespace v8::internal | 1042 } } // namespace v8::internal |
| OLD | NEW |