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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 return; | 75 return; |
76 } | 76 } |
77 | 77 |
78 switch (instance_type) { | 78 switch (instance_type) { |
79 case MAP_TYPE: | 79 case MAP_TYPE: |
80 Map::cast(this)->MapPrint(out); | 80 Map::cast(this)->MapPrint(out); |
81 break; | 81 break; |
82 case HEAP_NUMBER_TYPE: | 82 case HEAP_NUMBER_TYPE: |
83 HeapNumber::cast(this)->HeapNumberPrint(out); | 83 HeapNumber::cast(this)->HeapNumberPrint(out); |
84 break; | 84 break; |
| 85 case FIXED_DOUBLE_ARRAY_TYPE: |
| 86 FixedDoubleArray::cast(this)->FixedDoubleArrayPrint(out); |
| 87 break; |
85 case FIXED_ARRAY_TYPE: | 88 case FIXED_ARRAY_TYPE: |
86 FixedArray::cast(this)->FixedArrayPrint(out); | 89 FixedArray::cast(this)->FixedArrayPrint(out); |
87 break; | 90 break; |
88 case BYTE_ARRAY_TYPE: | 91 case BYTE_ARRAY_TYPE: |
89 ByteArray::cast(this)->ByteArrayPrint(out); | 92 ByteArray::cast(this)->ByteArrayPrint(out); |
90 break; | 93 break; |
91 case EXTERNAL_PIXEL_ARRAY_TYPE: | 94 case EXTERNAL_PIXEL_ARRAY_TYPE: |
92 ExternalPixelArray::cast(this)->ExternalPixelArrayPrint(out); | 95 ExternalPixelArray::cast(this)->ExternalPixelArrayPrint(out); |
93 break; | 96 break; |
94 case EXTERNAL_BYTE_ARRAY_TYPE: | 97 case EXTERNAL_BYTE_ARRAY_TYPE: |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 } | 274 } |
272 } | 275 } |
273 } else { | 276 } else { |
274 property_dictionary()->Print(out); | 277 property_dictionary()->Print(out); |
275 } | 278 } |
276 } | 279 } |
277 | 280 |
278 | 281 |
279 void JSObject::PrintElements(FILE* out) { | 282 void JSObject::PrintElements(FILE* out) { |
280 switch (GetElementsKind()) { | 283 switch (GetElementsKind()) { |
| 284 case FAST_SMI_ONLY_ELEMENTS: |
281 case FAST_ELEMENTS: { | 285 case FAST_ELEMENTS: { |
282 // Print in array notation for non-sparse arrays. | 286 // Print in array notation for non-sparse arrays. |
283 FixedArray* p = FixedArray::cast(elements()); | 287 FixedArray* p = FixedArray::cast(elements()); |
284 for (int i = 0; i < p->length(); i++) { | 288 for (int i = 0; i < p->length(); i++) { |
285 PrintF(out, " %d: ", i); | 289 PrintF(out, " %d: ", i); |
286 p->get(i)->ShortPrint(out); | 290 p->get(i)->ShortPrint(out); |
287 PrintF(out, "\n"); | 291 PrintF(out, "\n"); |
288 } | 292 } |
289 break; | 293 break; |
290 } | 294 } |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 HeapObject::PrintHeader(out, "FixedArray"); | 513 HeapObject::PrintHeader(out, "FixedArray"); |
510 PrintF(out, " - length: %d", length()); | 514 PrintF(out, " - length: %d", length()); |
511 for (int i = 0; i < length(); i++) { | 515 for (int i = 0; i < length(); i++) { |
512 PrintF(out, "\n [%d]: ", i); | 516 PrintF(out, "\n [%d]: ", i); |
513 get(i)->ShortPrint(out); | 517 get(i)->ShortPrint(out); |
514 } | 518 } |
515 PrintF(out, "\n"); | 519 PrintF(out, "\n"); |
516 } | 520 } |
517 | 521 |
518 | 522 |
| 523 void FixedDoubleArray::FixedDoubleArrayPrint(FILE* out) { |
| 524 HeapObject::PrintHeader(out, "FixedDoubleArray"); |
| 525 PrintF(out, " - length: %d", length()); |
| 526 for (int i = 0; i < length(); i++) { |
| 527 PrintF(out, "\n [%d]: %g", i, get_scalar(i)); |
| 528 } |
| 529 PrintF(out, "\n"); |
| 530 } |
| 531 |
| 532 |
519 void JSValue::JSValuePrint(FILE* out) { | 533 void JSValue::JSValuePrint(FILE* out) { |
520 HeapObject::PrintHeader(out, "ValueObject"); | 534 HeapObject::PrintHeader(out, "ValueObject"); |
521 value()->Print(out); | 535 value()->Print(out); |
522 } | 536 } |
523 | 537 |
524 | 538 |
525 void JSMessageObject::JSMessageObjectPrint(FILE* out) { | 539 void JSMessageObject::JSMessageObjectPrint(FILE* out) { |
526 HeapObject::PrintHeader(out, "JSMessageObject"); | 540 HeapObject::PrintHeader(out, "JSMessageObject"); |
527 PrintF(out, " - type: "); | 541 PrintF(out, " - type: "); |
528 type()->ShortPrint(out); | 542 type()->ShortPrint(out); |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
878 desc.Print(out); | 892 desc.Print(out); |
879 } | 893 } |
880 PrintF(out, "\n"); | 894 PrintF(out, "\n"); |
881 } | 895 } |
882 | 896 |
883 | 897 |
884 #endif // OBJECT_PRINT | 898 #endif // OBJECT_PRINT |
885 | 899 |
886 | 900 |
887 } } // namespace v8::internal | 901 } } // namespace v8::internal |
OLD | NEW |