OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 break; | 107 break; |
108 case EXTERNAL_INT_ARRAY_TYPE: | 108 case EXTERNAL_INT_ARRAY_TYPE: |
109 ExternalIntArray::cast(this)->ExternalIntArrayPrint(out); | 109 ExternalIntArray::cast(this)->ExternalIntArrayPrint(out); |
110 break; | 110 break; |
111 case EXTERNAL_UNSIGNED_INT_ARRAY_TYPE: | 111 case EXTERNAL_UNSIGNED_INT_ARRAY_TYPE: |
112 ExternalUnsignedIntArray::cast(this)->ExternalUnsignedIntArrayPrint(out); | 112 ExternalUnsignedIntArray::cast(this)->ExternalUnsignedIntArrayPrint(out); |
113 break; | 113 break; |
114 case EXTERNAL_FLOAT_ARRAY_TYPE: | 114 case EXTERNAL_FLOAT_ARRAY_TYPE: |
115 ExternalFloatArray::cast(this)->ExternalFloatArrayPrint(out); | 115 ExternalFloatArray::cast(this)->ExternalFloatArrayPrint(out); |
116 break; | 116 break; |
| 117 case EXTERNAL_DOUBLE_ARRAY_TYPE: |
| 118 ExternalDoubleArray::cast(this)->ExternalDoubleArrayPrint(out); |
| 119 break; |
117 case FILLER_TYPE: | 120 case FILLER_TYPE: |
118 PrintF(out, "filler"); | 121 PrintF(out, "filler"); |
119 break; | 122 break; |
120 case JS_OBJECT_TYPE: // fall through | 123 case JS_OBJECT_TYPE: // fall through |
121 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: | 124 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: |
122 case JS_ARRAY_TYPE: | 125 case JS_ARRAY_TYPE: |
123 case JS_REGEXP_TYPE: | 126 case JS_REGEXP_TYPE: |
124 JSObject::cast(this)->JSObjectPrint(out); | 127 JSObject::cast(this)->JSObjectPrint(out); |
125 break; | 128 break; |
126 case ODDBALL_TYPE: | 129 case ODDBALL_TYPE: |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 void ExternalUnsignedIntArray::ExternalUnsignedIntArrayPrint(FILE* out) { | 213 void ExternalUnsignedIntArray::ExternalUnsignedIntArrayPrint(FILE* out) { |
211 PrintF(out, "external unsigned int array"); | 214 PrintF(out, "external unsigned int array"); |
212 } | 215 } |
213 | 216 |
214 | 217 |
215 void ExternalFloatArray::ExternalFloatArrayPrint(FILE* out) { | 218 void ExternalFloatArray::ExternalFloatArrayPrint(FILE* out) { |
216 PrintF(out, "external float array"); | 219 PrintF(out, "external float array"); |
217 } | 220 } |
218 | 221 |
219 | 222 |
| 223 void ExternalDoubleArray::ExternalDoubleArrayPrint(FILE* out) { |
| 224 PrintF(out, "external double array"); |
| 225 } |
| 226 |
| 227 |
220 void JSObject::PrintProperties(FILE* out) { | 228 void JSObject::PrintProperties(FILE* out) { |
221 if (HasFastProperties()) { | 229 if (HasFastProperties()) { |
222 DescriptorArray* descs = map()->instance_descriptors(); | 230 DescriptorArray* descs = map()->instance_descriptors(); |
223 for (int i = 0; i < descs->number_of_descriptors(); i++) { | 231 for (int i = 0; i < descs->number_of_descriptors(); i++) { |
224 PrintF(out, " "); | 232 PrintF(out, " "); |
225 descs->GetKey(i)->StringPrint(out); | 233 descs->GetKey(i)->StringPrint(out); |
226 PrintF(out, ": "); | 234 PrintF(out, ": "); |
227 switch (descs->GetType(i)) { | 235 switch (descs->GetType(i)) { |
228 case FIELD: { | 236 case FIELD: { |
229 int index = descs->GetFieldIndex(i); | 237 int index = descs->GetFieldIndex(i); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 } | 331 } |
324 break; | 332 break; |
325 } | 333 } |
326 case EXTERNAL_FLOAT_ELEMENTS: { | 334 case EXTERNAL_FLOAT_ELEMENTS: { |
327 ExternalFloatArray* p = ExternalFloatArray::cast(elements()); | 335 ExternalFloatArray* p = ExternalFloatArray::cast(elements()); |
328 for (int i = 0; i < p->length(); i++) { | 336 for (int i = 0; i < p->length(); i++) { |
329 PrintF(out, " %d: %f\n", i, p->get(i)); | 337 PrintF(out, " %d: %f\n", i, p->get(i)); |
330 } | 338 } |
331 break; | 339 break; |
332 } | 340 } |
| 341 case EXTERNAL_DOUBLE_ELEMENTS: { |
| 342 ExternalDoubleArray* p = ExternalDoubleArray::cast(elements()); |
| 343 for (int i = 0; i < p->length(); i++) { |
| 344 PrintF(out, " %d: %f\n", i, p->get(i)); |
| 345 } |
| 346 break; |
| 347 } |
333 case DICTIONARY_ELEMENTS: | 348 case DICTIONARY_ELEMENTS: |
334 elements()->Print(out); | 349 elements()->Print(out); |
335 break; | 350 break; |
336 default: | 351 default: |
337 UNREACHABLE(); | 352 UNREACHABLE(); |
338 break; | 353 break; |
339 } | 354 } |
340 } | 355 } |
341 | 356 |
342 | 357 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 case EXTERNAL_BYTE_ARRAY_TYPE: return "EXTERNAL_BYTE_ARRAY"; | 391 case EXTERNAL_BYTE_ARRAY_TYPE: return "EXTERNAL_BYTE_ARRAY"; |
377 case EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE: | 392 case EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE: |
378 return "EXTERNAL_UNSIGNED_BYTE_ARRAY"; | 393 return "EXTERNAL_UNSIGNED_BYTE_ARRAY"; |
379 case EXTERNAL_SHORT_ARRAY_TYPE: return "EXTERNAL_SHORT_ARRAY"; | 394 case EXTERNAL_SHORT_ARRAY_TYPE: return "EXTERNAL_SHORT_ARRAY"; |
380 case EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE: | 395 case EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE: |
381 return "EXTERNAL_UNSIGNED_SHORT_ARRAY"; | 396 return "EXTERNAL_UNSIGNED_SHORT_ARRAY"; |
382 case EXTERNAL_INT_ARRAY_TYPE: return "EXTERNAL_INT_ARRAY"; | 397 case EXTERNAL_INT_ARRAY_TYPE: return "EXTERNAL_INT_ARRAY"; |
383 case EXTERNAL_UNSIGNED_INT_ARRAY_TYPE: | 398 case EXTERNAL_UNSIGNED_INT_ARRAY_TYPE: |
384 return "EXTERNAL_UNSIGNED_INT_ARRAY"; | 399 return "EXTERNAL_UNSIGNED_INT_ARRAY"; |
385 case EXTERNAL_FLOAT_ARRAY_TYPE: return "EXTERNAL_FLOAT_ARRAY"; | 400 case EXTERNAL_FLOAT_ARRAY_TYPE: return "EXTERNAL_FLOAT_ARRAY"; |
| 401 case EXTERNAL_DOUBLE_ARRAY_TYPE: return "EXTERNAL_DOUBLE_ARRAY"; |
386 case FILLER_TYPE: return "FILLER"; | 402 case FILLER_TYPE: return "FILLER"; |
387 case JS_OBJECT_TYPE: return "JS_OBJECT"; | 403 case JS_OBJECT_TYPE: return "JS_OBJECT"; |
388 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: return "JS_CONTEXT_EXTENSION_OBJECT"; | 404 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: return "JS_CONTEXT_EXTENSION_OBJECT"; |
389 case ODDBALL_TYPE: return "ODDBALL"; | 405 case ODDBALL_TYPE: return "ODDBALL"; |
390 case JS_GLOBAL_PROPERTY_CELL_TYPE: return "JS_GLOBAL_PROPERTY_CELL"; | 406 case JS_GLOBAL_PROPERTY_CELL_TYPE: return "JS_GLOBAL_PROPERTY_CELL"; |
391 case SHARED_FUNCTION_INFO_TYPE: return "SHARED_FUNCTION_INFO"; | 407 case SHARED_FUNCTION_INFO_TYPE: return "SHARED_FUNCTION_INFO"; |
392 case JS_FUNCTION_TYPE: return "JS_FUNCTION"; | 408 case JS_FUNCTION_TYPE: return "JS_FUNCTION"; |
393 case CODE_TYPE: return "CODE"; | 409 case CODE_TYPE: return "CODE"; |
394 case JS_ARRAY_TYPE: return "JS_ARRAY"; | 410 case JS_ARRAY_TYPE: return "JS_ARRAY"; |
395 case JS_REGEXP_TYPE: return "JS_REGEXP"; | 411 case JS_REGEXP_TYPE: return "JS_REGEXP"; |
396 case JS_VALUE_TYPE: return "JS_VALUE"; | 412 case JS_VALUE_TYPE: return "JS_VALUE"; |
397 case JS_GLOBAL_OBJECT_TYPE: return "JS_GLOBAL_OBJECT"; | 413 case JS_GLOBAL_OBJECT_TYPE: return "JS_GLOBAL_OBJECT"; |
398 case JS_BUILTINS_OBJECT_TYPE: return "JS_BUILTINS_OBJECT"; | 414 case JS_BUILTINS_OBJECT_TYPE: return "JS_BUILTINS_OBJECT"; |
399 case JS_GLOBAL_PROXY_TYPE: return "JS_GLOBAL_PROXY"; | 415 case JS_GLOBAL_PROXY_TYPE: return "JS_GLOBAL_PROXY"; |
400 case PROXY_TYPE: return "PROXY"; | 416 case PROXY_TYPE: return "PROXY"; |
401 case LAST_STRING_TYPE: return "LAST_STRING_TYPE"; | 417 case LAST_STRING_TYPE: return "LAST_STRING_TYPE"; |
402 case JS_MESSAGE_OBJECT_TYPE: return "JS_MESSAGE_OBJECT_TYPE"; | 418 case JS_MESSAGE_OBJECT_TYPE: return "JS_MESSAGE_OBJECT_TYPE"; |
403 #define MAKE_STRUCT_CASE(NAME, Name, name) case NAME##_TYPE: return #NAME; | 419 #define MAKE_STRUCT_CASE(NAME, Name, name) case NAME##_TYPE: return #NAME; |
404 STRUCT_LIST(MAKE_STRUCT_CASE) | 420 STRUCT_LIST(MAKE_STRUCT_CASE) |
405 #undef MAKE_STRUCT_CASE | 421 #undef MAKE_STRUCT_CASE |
| 422 default: return "UNKNOWN"; |
406 } | 423 } |
407 return "UNKNOWN"; | |
408 } | 424 } |
409 | 425 |
410 | 426 |
411 void Map::MapPrint(FILE* out) { | 427 void Map::MapPrint(FILE* out) { |
412 HeapObject::PrintHeader(out, "Map"); | 428 HeapObject::PrintHeader(out, "Map"); |
413 PrintF(out, " - type: %s\n", TypeToString(instance_type())); | 429 PrintF(out, " - type: %s\n", TypeToString(instance_type())); |
414 PrintF(out, " - instance size: %d\n", instance_size()); | 430 PrintF(out, " - instance size: %d\n", instance_size()); |
415 PrintF(out, " - inobject properties: %d\n", inobject_properties()); | 431 PrintF(out, " - inobject properties: %d\n", inobject_properties()); |
416 PrintF(out, " - pre-allocated property fields: %d\n", | 432 PrintF(out, " - pre-allocated property fields: %d\n", |
417 pre_allocated_property_fields()); | 433 pre_allocated_property_fields()); |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 desc.Print(out); | 808 desc.Print(out); |
793 } | 809 } |
794 PrintF(out, "\n"); | 810 PrintF(out, "\n"); |
795 } | 811 } |
796 | 812 |
797 | 813 |
798 #endif // OBJECT_PRINT | 814 #endif // OBJECT_PRINT |
799 | 815 |
800 | 816 |
801 } } // namespace v8::internal | 817 } } // namespace v8::internal |
OLD | NEW |