ricow@chromium.org | 9fa0967 | 2011-07-25 11:05:35 +0000 | [diff] [blame] | 1 | // Copyright 2011 the V8 project authors. All rights reserved. |
fschneider@chromium.org | 9e3e0b6 | 2011-01-03 10:16:46 +0000 | [diff] [blame] | 2 | // Redistribution and use in source and binary forms, with or without |
| 3 | // modification, are permitted provided that the following conditions are |
| 4 | // met: |
| 5 | // |
| 6 | // * Redistributions of source code must retain the above copyright |
| 7 | // notice, this list of conditions and the following disclaimer. |
| 8 | // * Redistributions in binary form must reproduce the above |
| 9 | // copyright notice, this list of conditions and the following |
| 10 | // disclaimer in the documentation and/or other materials provided |
| 11 | // with the distribution. |
| 12 | // * Neither the name of Google Inc. nor the names of its |
| 13 | // contributors may be used to endorse or promote products derived |
| 14 | // from this software without specific prior written permission. |
| 15 | // |
| 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 17 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 18 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 20 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 21 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 22 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 23 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | |
| 28 | #include "v8.h" |
| 29 | |
| 30 | #include "disassembler.h" |
| 31 | #include "disasm.h" |
| 32 | #include "jsregexp.h" |
| 33 | #include "objects-visiting.h" |
| 34 | |
| 35 | namespace v8 { |
| 36 | namespace internal { |
| 37 | |
| 38 | #ifdef OBJECT_PRINT |
| 39 | |
| 40 | static const char* TypeToString(InstanceType type); |
| 41 | |
| 42 | |
| 43 | void MaybeObject::Print(FILE* out) { |
| 44 | Object* this_as_object; |
| 45 | if (ToObject(&this_as_object)) { |
| 46 | if (this_as_object->IsSmi()) { |
| 47 | Smi::cast(this_as_object)->SmiPrint(out); |
| 48 | } else { |
| 49 | HeapObject::cast(this_as_object)->HeapObjectPrint(out); |
| 50 | } |
| 51 | } else { |
| 52 | Failure::cast(this)->FailurePrint(out); |
| 53 | } |
| 54 | Flush(out); |
| 55 | } |
| 56 | |
| 57 | |
| 58 | void MaybeObject::PrintLn(FILE* out) { |
| 59 | Print(out); |
| 60 | PrintF(out, "\n"); |
| 61 | } |
| 62 | |
| 63 | |
| 64 | void HeapObject::PrintHeader(FILE* out, const char* id) { |
| 65 | PrintF(out, "%p: [%s]\n", reinterpret_cast<void*>(this), id); |
| 66 | } |
| 67 | |
| 68 | |
| 69 | void HeapObject::HeapObjectPrint(FILE* out) { |
| 70 | InstanceType instance_type = map()->instance_type(); |
| 71 | |
| 72 | HandleScope scope; |
| 73 | if (instance_type < FIRST_NONSTRING_TYPE) { |
| 74 | String::cast(this)->StringPrint(out); |
| 75 | return; |
| 76 | } |
| 77 | |
| 78 | switch (instance_type) { |
| 79 | case MAP_TYPE: |
| 80 | Map::cast(this)->MapPrint(out); |
| 81 | break; |
| 82 | case HEAP_NUMBER_TYPE: |
| 83 | HeapNumber::cast(this)->HeapNumberPrint(out); |
| 84 | break; |
| 85 | case FIXED_ARRAY_TYPE: |
| 86 | FixedArray::cast(this)->FixedArrayPrint(out); |
| 87 | break; |
| 88 | case BYTE_ARRAY_TYPE: |
| 89 | ByteArray::cast(this)->ByteArrayPrint(out); |
| 90 | break; |
danno@chromium.org | 4d3fe4e | 2011-03-10 10:14:28 +0000 | [diff] [blame] | 91 | case EXTERNAL_PIXEL_ARRAY_TYPE: |
| 92 | ExternalPixelArray::cast(this)->ExternalPixelArrayPrint(out); |
fschneider@chromium.org | 9e3e0b6 | 2011-01-03 10:16:46 +0000 | [diff] [blame] | 93 | break; |
| 94 | case EXTERNAL_BYTE_ARRAY_TYPE: |
| 95 | ExternalByteArray::cast(this)->ExternalByteArrayPrint(out); |
| 96 | break; |
| 97 | case EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE: |
| 98 | ExternalUnsignedByteArray::cast(this) |
| 99 | ->ExternalUnsignedByteArrayPrint(out); |
| 100 | break; |
| 101 | case EXTERNAL_SHORT_ARRAY_TYPE: |
| 102 | ExternalShortArray::cast(this)->ExternalShortArrayPrint(out); |
| 103 | break; |
| 104 | case EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE: |
| 105 | ExternalUnsignedShortArray::cast(this) |
| 106 | ->ExternalUnsignedShortArrayPrint(out); |
| 107 | break; |
| 108 | case EXTERNAL_INT_ARRAY_TYPE: |
| 109 | ExternalIntArray::cast(this)->ExternalIntArrayPrint(out); |
| 110 | break; |
| 111 | case EXTERNAL_UNSIGNED_INT_ARRAY_TYPE: |
| 112 | ExternalUnsignedIntArray::cast(this)->ExternalUnsignedIntArrayPrint(out); |
| 113 | break; |
| 114 | case EXTERNAL_FLOAT_ARRAY_TYPE: |
| 115 | ExternalFloatArray::cast(this)->ExternalFloatArrayPrint(out); |
| 116 | break; |
erik.corry@gmail.com | 3847bd5 | 2011-04-27 10:38:56 +0000 | [diff] [blame] | 117 | case EXTERNAL_DOUBLE_ARRAY_TYPE: |
| 118 | ExternalDoubleArray::cast(this)->ExternalDoubleArrayPrint(out); |
| 119 | break; |
fschneider@chromium.org | 9e3e0b6 | 2011-01-03 10:16:46 +0000 | [diff] [blame] | 120 | case FILLER_TYPE: |
| 121 | PrintF(out, "filler"); |
| 122 | break; |
| 123 | case JS_OBJECT_TYPE: // fall through |
| 124 | case JS_CONTEXT_EXTENSION_OBJECT_TYPE: |
| 125 | case JS_ARRAY_TYPE: |
| 126 | case JS_REGEXP_TYPE: |
| 127 | JSObject::cast(this)->JSObjectPrint(out); |
| 128 | break; |
| 129 | case ODDBALL_TYPE: |
| 130 | Oddball::cast(this)->to_string()->Print(out); |
| 131 | break; |
| 132 | case JS_FUNCTION_TYPE: |
| 133 | JSFunction::cast(this)->JSFunctionPrint(out); |
| 134 | break; |
| 135 | case JS_GLOBAL_PROXY_TYPE: |
| 136 | JSGlobalProxy::cast(this)->JSGlobalProxyPrint(out); |
| 137 | break; |
| 138 | case JS_GLOBAL_OBJECT_TYPE: |
| 139 | JSGlobalObject::cast(this)->JSGlobalObjectPrint(out); |
| 140 | break; |
| 141 | case JS_BUILTINS_OBJECT_TYPE: |
| 142 | JSBuiltinsObject::cast(this)->JSBuiltinsObjectPrint(out); |
| 143 | break; |
| 144 | case JS_VALUE_TYPE: |
| 145 | PrintF(out, "Value wrapper around:"); |
| 146 | JSValue::cast(this)->value()->Print(out); |
| 147 | break; |
| 148 | case CODE_TYPE: |
| 149 | Code::cast(this)->CodePrint(out); |
| 150 | break; |
vegorov@chromium.org | 7304bca | 2011-05-16 12:14:13 +0000 | [diff] [blame] | 151 | case JS_PROXY_TYPE: |
| 152 | JSProxy::cast(this)->JSProxyPrint(out); |
| 153 | break; |
ager@chromium.org | ea91cc5 | 2011-05-23 06:06:11 +0000 | [diff] [blame] | 154 | case FOREIGN_TYPE: |
| 155 | Foreign::cast(this)->ForeignPrint(out); |
fschneider@chromium.org | 9e3e0b6 | 2011-01-03 10:16:46 +0000 | [diff] [blame] | 156 | break; |
| 157 | case SHARED_FUNCTION_INFO_TYPE: |
| 158 | SharedFunctionInfo::cast(this)->SharedFunctionInfoPrint(out); |
| 159 | break; |
kmillikin@chromium.org | 31b1277 | 2011-02-02 16:08:26 +0000 | [diff] [blame] | 160 | case JS_MESSAGE_OBJECT_TYPE: |
| 161 | JSMessageObject::cast(this)->JSMessageObjectPrint(out); |
| 162 | break; |
fschneider@chromium.org | 9e3e0b6 | 2011-01-03 10:16:46 +0000 | [diff] [blame] | 163 | case JS_GLOBAL_PROPERTY_CELL_TYPE: |
| 164 | JSGlobalPropertyCell::cast(this)->JSGlobalPropertyCellPrint(out); |
| 165 | break; |
| 166 | #define MAKE_STRUCT_CASE(NAME, Name, name) \ |
| 167 | case NAME##_TYPE: \ |
| 168 | Name::cast(this)->Name##Print(out); \ |
| 169 | break; |
| 170 | STRUCT_LIST(MAKE_STRUCT_CASE) |
| 171 | #undef MAKE_STRUCT_CASE |
| 172 | |
| 173 | default: |
| 174 | PrintF(out, "UNKNOWN TYPE %d", map()->instance_type()); |
| 175 | UNREACHABLE(); |
| 176 | break; |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | |
| 181 | void ByteArray::ByteArrayPrint(FILE* out) { |
| 182 | PrintF(out, "byte array, data starts at %p", GetDataStartAddress()); |
| 183 | } |
| 184 | |
| 185 | |
danno@chromium.org | 4d3fe4e | 2011-03-10 10:14:28 +0000 | [diff] [blame] | 186 | void ExternalPixelArray::ExternalPixelArrayPrint(FILE* out) { |
| 187 | PrintF(out, "external pixel array"); |
fschneider@chromium.org | 9e3e0b6 | 2011-01-03 10:16:46 +0000 | [diff] [blame] | 188 | } |
| 189 | |
| 190 | |
| 191 | void ExternalByteArray::ExternalByteArrayPrint(FILE* out) { |
| 192 | PrintF(out, "external byte array"); |
| 193 | } |
| 194 | |
| 195 | |
| 196 | void ExternalUnsignedByteArray::ExternalUnsignedByteArrayPrint(FILE* out) { |
| 197 | PrintF(out, "external unsigned byte array"); |
| 198 | } |
| 199 | |
| 200 | |
| 201 | void ExternalShortArray::ExternalShortArrayPrint(FILE* out) { |
| 202 | PrintF(out, "external short array"); |
| 203 | } |
| 204 | |
| 205 | |
| 206 | void ExternalUnsignedShortArray::ExternalUnsignedShortArrayPrint(FILE* out) { |
| 207 | PrintF(out, "external unsigned short array"); |
| 208 | } |
| 209 | |
| 210 | |
| 211 | void ExternalIntArray::ExternalIntArrayPrint(FILE* out) { |
| 212 | PrintF(out, "external int array"); |
| 213 | } |
| 214 | |
| 215 | |
| 216 | void ExternalUnsignedIntArray::ExternalUnsignedIntArrayPrint(FILE* out) { |
| 217 | PrintF(out, "external unsigned int array"); |
| 218 | } |
| 219 | |
| 220 | |
| 221 | void ExternalFloatArray::ExternalFloatArrayPrint(FILE* out) { |
| 222 | PrintF(out, "external float array"); |
| 223 | } |
| 224 | |
| 225 | |
erik.corry@gmail.com | 3847bd5 | 2011-04-27 10:38:56 +0000 | [diff] [blame] | 226 | void ExternalDoubleArray::ExternalDoubleArrayPrint(FILE* out) { |
| 227 | PrintF(out, "external double array"); |
| 228 | } |
| 229 | |
| 230 | |
fschneider@chromium.org | 9e3e0b6 | 2011-01-03 10:16:46 +0000 | [diff] [blame] | 231 | void JSObject::PrintProperties(FILE* out) { |
| 232 | if (HasFastProperties()) { |
| 233 | DescriptorArray* descs = map()->instance_descriptors(); |
| 234 | for (int i = 0; i < descs->number_of_descriptors(); i++) { |
| 235 | PrintF(out, " "); |
| 236 | descs->GetKey(i)->StringPrint(out); |
| 237 | PrintF(out, ": "); |
| 238 | switch (descs->GetType(i)) { |
| 239 | case FIELD: { |
| 240 | int index = descs->GetFieldIndex(i); |
| 241 | FastPropertyAt(index)->ShortPrint(out); |
| 242 | PrintF(out, " (field at offset %d)\n", index); |
| 243 | break; |
| 244 | } |
| 245 | case CONSTANT_FUNCTION: |
| 246 | descs->GetConstantFunction(i)->ShortPrint(out); |
| 247 | PrintF(out, " (constant function)\n"); |
| 248 | break; |
| 249 | case CALLBACKS: |
| 250 | descs->GetCallbacksObject(i)->ShortPrint(out); |
| 251 | PrintF(out, " (callback)\n"); |
| 252 | break; |
| 253 | case MAP_TRANSITION: |
| 254 | PrintF(out, " (map transition)\n"); |
| 255 | break; |
| 256 | case CONSTANT_TRANSITION: |
| 257 | PrintF(out, " (constant transition)\n"); |
| 258 | break; |
| 259 | case NULL_DESCRIPTOR: |
| 260 | PrintF(out, " (null descriptor)\n"); |
| 261 | break; |
| 262 | default: |
| 263 | UNREACHABLE(); |
| 264 | break; |
| 265 | } |
| 266 | } |
| 267 | } else { |
| 268 | property_dictionary()->Print(out); |
| 269 | } |
| 270 | } |
| 271 | |
| 272 | |
| 273 | void JSObject::PrintElements(FILE* out) { |
| 274 | switch (GetElementsKind()) { |
| 275 | case FAST_ELEMENTS: { |
| 276 | // Print in array notation for non-sparse arrays. |
| 277 | FixedArray* p = FixedArray::cast(elements()); |
| 278 | for (int i = 0; i < p->length(); i++) { |
| 279 | PrintF(out, " %d: ", i); |
| 280 | p->get(i)->ShortPrint(out); |
| 281 | PrintF(out, "\n"); |
| 282 | } |
| 283 | break; |
| 284 | } |
ricow@chromium.org | 9fa0967 | 2011-07-25 11:05:35 +0000 | [diff] [blame] | 285 | case FAST_DOUBLE_ELEMENTS: { |
| 286 | // Print in array notation for non-sparse arrays. |
| 287 | FixedDoubleArray* p = FixedDoubleArray::cast(elements()); |
| 288 | for (int i = 0; i < p->length(); i++) { |
| 289 | if (p->is_the_hole(i)) { |
| 290 | PrintF(out, " %d: <the hole>", i); |
| 291 | } else { |
| 292 | PrintF(out, " %d: %g", i, p->get(i)); |
| 293 | } |
| 294 | PrintF(out, "\n"); |
| 295 | } |
| 296 | break; |
| 297 | } |
danno@chromium.org | 4d3fe4e | 2011-03-10 10:14:28 +0000 | [diff] [blame] | 298 | case EXTERNAL_PIXEL_ELEMENTS: { |
| 299 | ExternalPixelArray* p = ExternalPixelArray::cast(elements()); |
fschneider@chromium.org | 9e3e0b6 | 2011-01-03 10:16:46 +0000 | [diff] [blame] | 300 | for (int i = 0; i < p->length(); i++) { |
| 301 | PrintF(out, " %d: %d\n", i, p->get(i)); |
| 302 | } |
| 303 | break; |
| 304 | } |
| 305 | case EXTERNAL_BYTE_ELEMENTS: { |
| 306 | ExternalByteArray* p = ExternalByteArray::cast(elements()); |
| 307 | for (int i = 0; i < p->length(); i++) { |
| 308 | PrintF(out, " %d: %d\n", i, static_cast<int>(p->get(i))); |
| 309 | } |
| 310 | break; |
| 311 | } |
| 312 | case EXTERNAL_UNSIGNED_BYTE_ELEMENTS: { |
| 313 | ExternalUnsignedByteArray* p = |
| 314 | ExternalUnsignedByteArray::cast(elements()); |
| 315 | for (int i = 0; i < p->length(); i++) { |
| 316 | PrintF(out, " %d: %d\n", i, static_cast<int>(p->get(i))); |
| 317 | } |
| 318 | break; |
| 319 | } |
| 320 | case EXTERNAL_SHORT_ELEMENTS: { |
| 321 | ExternalShortArray* p = ExternalShortArray::cast(elements()); |
| 322 | for (int i = 0; i < p->length(); i++) { |
| 323 | PrintF(out, " %d: %d\n", i, static_cast<int>(p->get(i))); |
| 324 | } |
| 325 | break; |
| 326 | } |
| 327 | case EXTERNAL_UNSIGNED_SHORT_ELEMENTS: { |
| 328 | ExternalUnsignedShortArray* p = |
| 329 | ExternalUnsignedShortArray::cast(elements()); |
| 330 | for (int i = 0; i < p->length(); i++) { |
| 331 | PrintF(out, " %d: %d\n", i, static_cast<int>(p->get(i))); |
| 332 | } |
| 333 | break; |
| 334 | } |
| 335 | case EXTERNAL_INT_ELEMENTS: { |
| 336 | ExternalIntArray* p = ExternalIntArray::cast(elements()); |
| 337 | for (int i = 0; i < p->length(); i++) { |
| 338 | PrintF(out, " %d: %d\n", i, static_cast<int>(p->get(i))); |
| 339 | } |
| 340 | break; |
| 341 | } |
| 342 | case EXTERNAL_UNSIGNED_INT_ELEMENTS: { |
| 343 | ExternalUnsignedIntArray* p = |
| 344 | ExternalUnsignedIntArray::cast(elements()); |
| 345 | for (int i = 0; i < p->length(); i++) { |
| 346 | PrintF(out, " %d: %d\n", i, static_cast<int>(p->get(i))); |
| 347 | } |
| 348 | break; |
| 349 | } |
| 350 | case EXTERNAL_FLOAT_ELEMENTS: { |
| 351 | ExternalFloatArray* p = ExternalFloatArray::cast(elements()); |
| 352 | for (int i = 0; i < p->length(); i++) { |
| 353 | PrintF(out, " %d: %f\n", i, p->get(i)); |
| 354 | } |
| 355 | break; |
| 356 | } |
erik.corry@gmail.com | 3847bd5 | 2011-04-27 10:38:56 +0000 | [diff] [blame] | 357 | case EXTERNAL_DOUBLE_ELEMENTS: { |
| 358 | ExternalDoubleArray* p = ExternalDoubleArray::cast(elements()); |
| 359 | for (int i = 0; i < p->length(); i++) { |
| 360 | PrintF(out, " %d: %f\n", i, p->get(i)); |
| 361 | } |
| 362 | break; |
| 363 | } |
fschneider@chromium.org | 9e3e0b6 | 2011-01-03 10:16:46 +0000 | [diff] [blame] | 364 | case DICTIONARY_ELEMENTS: |
| 365 | elements()->Print(out); |
| 366 | break; |
whesse@chromium.org | 7b26015 | 2011-06-20 15:33:18 +0000 | [diff] [blame] | 367 | case NON_STRICT_ARGUMENTS_ELEMENTS: { |
| 368 | FixedArray* p = FixedArray::cast(elements()); |
| 369 | for (int i = 2; i < p->length(); i++) { |
| 370 | PrintF(out, " %d: ", i); |
| 371 | p->get(i)->ShortPrint(out); |
| 372 | PrintF(out, "\n"); |
| 373 | } |
| 374 | break; |
| 375 | } |
fschneider@chromium.org | 9e3e0b6 | 2011-01-03 10:16:46 +0000 | [diff] [blame] | 376 | } |
| 377 | } |
| 378 | |
| 379 | |
| 380 | void JSObject::JSObjectPrint(FILE* out) { |
| 381 | PrintF(out, "%p: [JSObject]\n", reinterpret_cast<void*>(this)); |
| 382 | PrintF(out, " - map = %p\n", reinterpret_cast<void*>(map())); |
| 383 | PrintF(out, " - prototype = %p\n", reinterpret_cast<void*>(GetPrototype())); |
| 384 | PrintF(out, " {\n"); |
| 385 | PrintProperties(out); |
| 386 | PrintElements(out); |
| 387 | PrintF(out, " }\n"); |
| 388 | } |
| 389 | |
| 390 | |
| 391 | static const char* TypeToString(InstanceType type) { |
| 392 | switch (type) { |
| 393 | case INVALID_TYPE: return "INVALID"; |
| 394 | case MAP_TYPE: return "MAP"; |
| 395 | case HEAP_NUMBER_TYPE: return "HEAP_NUMBER"; |
| 396 | case SYMBOL_TYPE: return "SYMBOL"; |
| 397 | case ASCII_SYMBOL_TYPE: return "ASCII_SYMBOL"; |
| 398 | case CONS_SYMBOL_TYPE: return "CONS_SYMBOL"; |
| 399 | case CONS_ASCII_SYMBOL_TYPE: return "CONS_ASCII_SYMBOL"; |
| 400 | case EXTERNAL_ASCII_SYMBOL_TYPE: |
| 401 | case EXTERNAL_SYMBOL_WITH_ASCII_DATA_TYPE: |
| 402 | case EXTERNAL_SYMBOL_TYPE: return "EXTERNAL_SYMBOL"; |
| 403 | case ASCII_STRING_TYPE: return "ASCII_STRING"; |
| 404 | case STRING_TYPE: return "TWO_BYTE_STRING"; |
| 405 | case CONS_STRING_TYPE: |
| 406 | case CONS_ASCII_STRING_TYPE: return "CONS_STRING"; |
| 407 | case EXTERNAL_ASCII_STRING_TYPE: |
| 408 | case EXTERNAL_STRING_WITH_ASCII_DATA_TYPE: |
| 409 | case EXTERNAL_STRING_TYPE: return "EXTERNAL_STRING"; |
| 410 | case FIXED_ARRAY_TYPE: return "FIXED_ARRAY"; |
| 411 | case BYTE_ARRAY_TYPE: return "BYTE_ARRAY"; |
danno@chromium.org | 4d3fe4e | 2011-03-10 10:14:28 +0000 | [diff] [blame] | 412 | case EXTERNAL_PIXEL_ARRAY_TYPE: return "EXTERNAL_PIXEL_ARRAY"; |
fschneider@chromium.org | 9e3e0b6 | 2011-01-03 10:16:46 +0000 | [diff] [blame] | 413 | case EXTERNAL_BYTE_ARRAY_TYPE: return "EXTERNAL_BYTE_ARRAY"; |
| 414 | case EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE: |
| 415 | return "EXTERNAL_UNSIGNED_BYTE_ARRAY"; |
| 416 | case EXTERNAL_SHORT_ARRAY_TYPE: return "EXTERNAL_SHORT_ARRAY"; |
| 417 | case EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE: |
| 418 | return "EXTERNAL_UNSIGNED_SHORT_ARRAY"; |
| 419 | case EXTERNAL_INT_ARRAY_TYPE: return "EXTERNAL_INT_ARRAY"; |
| 420 | case EXTERNAL_UNSIGNED_INT_ARRAY_TYPE: |
| 421 | return "EXTERNAL_UNSIGNED_INT_ARRAY"; |
| 422 | case EXTERNAL_FLOAT_ARRAY_TYPE: return "EXTERNAL_FLOAT_ARRAY"; |
erik.corry@gmail.com | 3847bd5 | 2011-04-27 10:38:56 +0000 | [diff] [blame] | 423 | case EXTERNAL_DOUBLE_ARRAY_TYPE: return "EXTERNAL_DOUBLE_ARRAY"; |
fschneider@chromium.org | 9e3e0b6 | 2011-01-03 10:16:46 +0000 | [diff] [blame] | 424 | case FILLER_TYPE: return "FILLER"; |
| 425 | case JS_OBJECT_TYPE: return "JS_OBJECT"; |
| 426 | case JS_CONTEXT_EXTENSION_OBJECT_TYPE: return "JS_CONTEXT_EXTENSION_OBJECT"; |
| 427 | case ODDBALL_TYPE: return "ODDBALL"; |
| 428 | case JS_GLOBAL_PROPERTY_CELL_TYPE: return "JS_GLOBAL_PROPERTY_CELL"; |
| 429 | case SHARED_FUNCTION_INFO_TYPE: return "SHARED_FUNCTION_INFO"; |
| 430 | case JS_FUNCTION_TYPE: return "JS_FUNCTION"; |
| 431 | case CODE_TYPE: return "CODE"; |
| 432 | case JS_ARRAY_TYPE: return "JS_ARRAY"; |
vegorov@chromium.org | 7304bca | 2011-05-16 12:14:13 +0000 | [diff] [blame] | 433 | case JS_PROXY_TYPE: return "JS_PROXY"; |
fschneider@chromium.org | 9e3e0b6 | 2011-01-03 10:16:46 +0000 | [diff] [blame] | 434 | case JS_REGEXP_TYPE: return "JS_REGEXP"; |
| 435 | case JS_VALUE_TYPE: return "JS_VALUE"; |
| 436 | case JS_GLOBAL_OBJECT_TYPE: return "JS_GLOBAL_OBJECT"; |
| 437 | case JS_BUILTINS_OBJECT_TYPE: return "JS_BUILTINS_OBJECT"; |
| 438 | case JS_GLOBAL_PROXY_TYPE: return "JS_GLOBAL_PROXY"; |
ager@chromium.org | ea91cc5 | 2011-05-23 06:06:11 +0000 | [diff] [blame] | 439 | case FOREIGN_TYPE: return "FOREIGN"; |
kmillikin@chromium.org | 31b1277 | 2011-02-02 16:08:26 +0000 | [diff] [blame] | 440 | case JS_MESSAGE_OBJECT_TYPE: return "JS_MESSAGE_OBJECT_TYPE"; |
fschneider@chromium.org | 9e3e0b6 | 2011-01-03 10:16:46 +0000 | [diff] [blame] | 441 | #define MAKE_STRUCT_CASE(NAME, Name, name) case NAME##_TYPE: return #NAME; |
| 442 | STRUCT_LIST(MAKE_STRUCT_CASE) |
| 443 | #undef MAKE_STRUCT_CASE |
erik.corry@gmail.com | 3847bd5 | 2011-04-27 10:38:56 +0000 | [diff] [blame] | 444 | default: return "UNKNOWN"; |
fschneider@chromium.org | 9e3e0b6 | 2011-01-03 10:16:46 +0000 | [diff] [blame] | 445 | } |
fschneider@chromium.org | 9e3e0b6 | 2011-01-03 10:16:46 +0000 | [diff] [blame] | 446 | } |
| 447 | |
| 448 | |
| 449 | void Map::MapPrint(FILE* out) { |
| 450 | HeapObject::PrintHeader(out, "Map"); |
| 451 | PrintF(out, " - type: %s\n", TypeToString(instance_type())); |
| 452 | PrintF(out, " - instance size: %d\n", instance_size()); |
| 453 | PrintF(out, " - inobject properties: %d\n", inobject_properties()); |
| 454 | PrintF(out, " - pre-allocated property fields: %d\n", |
| 455 | pre_allocated_property_fields()); |
| 456 | PrintF(out, " - unused property fields: %d\n", unused_property_fields()); |
| 457 | if (is_hidden_prototype()) { |
| 458 | PrintF(out, " - hidden_prototype\n"); |
| 459 | } |
| 460 | if (has_named_interceptor()) { |
| 461 | PrintF(out, " - named_interceptor\n"); |
| 462 | } |
| 463 | if (has_indexed_interceptor()) { |
| 464 | PrintF(out, " - indexed_interceptor\n"); |
| 465 | } |
| 466 | if (is_undetectable()) { |
| 467 | PrintF(out, " - undetectable\n"); |
| 468 | } |
| 469 | if (has_instance_call_handler()) { |
| 470 | PrintF(out, " - instance_call_handler\n"); |
| 471 | } |
| 472 | if (is_access_check_needed()) { |
| 473 | PrintF(out, " - access_check_needed\n"); |
| 474 | } |
| 475 | PrintF(out, " - instance descriptors: "); |
| 476 | instance_descriptors()->ShortPrint(out); |
| 477 | PrintF(out, "\n - prototype: "); |
| 478 | prototype()->ShortPrint(out); |
| 479 | PrintF(out, "\n - constructor: "); |
| 480 | constructor()->ShortPrint(out); |
| 481 | PrintF(out, "\n"); |
| 482 | } |
| 483 | |
| 484 | |
| 485 | void CodeCache::CodeCachePrint(FILE* out) { |
| 486 | HeapObject::PrintHeader(out, "CodeCache"); |
| 487 | PrintF(out, "\n - default_cache: "); |
| 488 | default_cache()->ShortPrint(out); |
| 489 | PrintF(out, "\n - normal_type_cache: "); |
| 490 | normal_type_cache()->ShortPrint(out); |
| 491 | } |
| 492 | |
| 493 | |
jkummerow@chromium.org | e297f59 | 2011-06-08 10:05:15 +0000 | [diff] [blame] | 494 | void PolymorphicCodeCache::PolymorphicCodeCachePrint(FILE* out) { |
| 495 | HeapObject::PrintHeader(out, "PolymorphicCodeCache"); |
| 496 | PrintF(out, "\n - cache: "); |
| 497 | cache()->ShortPrint(out); |
| 498 | } |
| 499 | |
| 500 | |
fschneider@chromium.org | 9e3e0b6 | 2011-01-03 10:16:46 +0000 | [diff] [blame] | 501 | void FixedArray::FixedArrayPrint(FILE* out) { |
| 502 | HeapObject::PrintHeader(out, "FixedArray"); |
| 503 | PrintF(out, " - length: %d", length()); |
| 504 | for (int i = 0; i < length(); i++) { |
| 505 | PrintF(out, "\n [%d]: ", i); |
| 506 | get(i)->ShortPrint(out); |
| 507 | } |
| 508 | PrintF(out, "\n"); |
| 509 | } |
| 510 | |
| 511 | |
| 512 | void JSValue::JSValuePrint(FILE* out) { |
| 513 | HeapObject::PrintHeader(out, "ValueObject"); |
| 514 | value()->Print(out); |
| 515 | } |
| 516 | |
| 517 | |
kmillikin@chromium.org | 31b1277 | 2011-02-02 16:08:26 +0000 | [diff] [blame] | 518 | void JSMessageObject::JSMessageObjectPrint(FILE* out) { |
| 519 | HeapObject::PrintHeader(out, "JSMessageObject"); |
| 520 | PrintF(out, " - type: "); |
| 521 | type()->ShortPrint(out); |
| 522 | PrintF(out, "\n - arguments: "); |
| 523 | arguments()->ShortPrint(out); |
| 524 | PrintF(out, "\n - start_position: %d", start_position()); |
| 525 | PrintF(out, "\n - end_position: %d", end_position()); |
| 526 | PrintF(out, "\n - script: "); |
| 527 | script()->ShortPrint(out); |
| 528 | PrintF(out, "\n - stack_trace: "); |
| 529 | stack_trace()->ShortPrint(out); |
| 530 | PrintF(out, "\n - stack_frames: "); |
| 531 | stack_frames()->ShortPrint(out); |
| 532 | PrintF(out, "\n"); |
| 533 | } |
| 534 | |
| 535 | |
fschneider@chromium.org | 9e3e0b6 | 2011-01-03 10:16:46 +0000 | [diff] [blame] | 536 | void String::StringPrint(FILE* out) { |
| 537 | if (StringShape(this).IsSymbol()) { |
| 538 | PrintF(out, "#"); |
| 539 | } else if (StringShape(this).IsCons()) { |
| 540 | PrintF(out, "c\""); |
| 541 | } else { |
| 542 | PrintF(out, "\""); |
| 543 | } |
| 544 | |
| 545 | const char truncated_epilogue[] = "...<truncated>"; |
| 546 | int len = length(); |
| 547 | if (!FLAG_use_verbose_printer) { |
| 548 | if (len > 100) { |
| 549 | len = 100 - sizeof(truncated_epilogue); |
| 550 | } |
| 551 | } |
| 552 | for (int i = 0; i < len; i++) { |
| 553 | PrintF(out, "%c", Get(i)); |
| 554 | } |
| 555 | if (len != length()) { |
| 556 | PrintF(out, "%s", truncated_epilogue); |
| 557 | } |
| 558 | |
| 559 | if (!StringShape(this).IsSymbol()) PrintF(out, "\""); |
| 560 | } |
| 561 | |
| 562 | |
vegorov@chromium.org | 7943d46 | 2011-08-01 11:41:52 +0000 | [diff] [blame] | 563 | // This method is only meant to be called from gdb for debugging purposes. |
| 564 | // Since the string can also be in two-byte encoding, non-ascii characters |
| 565 | // will be ignored in the output. |
| 566 | char* String::ToAsciiArray() { |
| 567 | // Static so that subsequent calls frees previously allocated space. |
| 568 | // This also means that previous results will be overwritten. |
| 569 | static char* buffer = NULL; |
| 570 | if (buffer != NULL) free(buffer); |
| 571 | buffer = new char[length()+1]; |
| 572 | WriteToFlat(this, buffer, 0, length()); |
| 573 | buffer[length()] = 0; |
| 574 | return buffer; |
| 575 | } |
| 576 | |
| 577 | |
vegorov@chromium.org | 7304bca | 2011-05-16 12:14:13 +0000 | [diff] [blame] | 578 | void JSProxy::JSProxyPrint(FILE* out) { |
| 579 | HeapObject::PrintHeader(out, "JSProxy"); |
| 580 | PrintF(out, " - map = 0x%p\n", reinterpret_cast<void*>(map())); |
| 581 | PrintF(out, " - handler = "); |
| 582 | handler()->Print(out); |
| 583 | PrintF(out, "\n"); |
| 584 | } |
| 585 | |
| 586 | |
fschneider@chromium.org | 9e3e0b6 | 2011-01-03 10:16:46 +0000 | [diff] [blame] | 587 | void JSFunction::JSFunctionPrint(FILE* out) { |
| 588 | HeapObject::PrintHeader(out, "Function"); |
| 589 | PrintF(out, " - map = 0x%p\n", reinterpret_cast<void*>(map())); |
| 590 | PrintF(out, " - initial_map = "); |
| 591 | if (has_initial_map()) { |
| 592 | initial_map()->ShortPrint(out); |
| 593 | } |
| 594 | PrintF(out, "\n - shared_info = "); |
| 595 | shared()->ShortPrint(out); |
| 596 | PrintF(out, "\n - name = "); |
| 597 | shared()->name()->Print(out); |
| 598 | PrintF(out, "\n - context = "); |
| 599 | unchecked_context()->ShortPrint(out); |
| 600 | PrintF(out, "\n - code = "); |
| 601 | code()->ShortPrint(out); |
| 602 | PrintF(out, "\n"); |
| 603 | |
| 604 | PrintProperties(out); |
| 605 | PrintElements(out); |
| 606 | |
| 607 | PrintF(out, "\n"); |
| 608 | } |
| 609 | |
| 610 | |
| 611 | void SharedFunctionInfo::SharedFunctionInfoPrint(FILE* out) { |
| 612 | HeapObject::PrintHeader(out, "SharedFunctionInfo"); |
| 613 | PrintF(out, " - name: "); |
| 614 | name()->ShortPrint(out); |
| 615 | PrintF(out, "\n - expected_nof_properties: %d", expected_nof_properties()); |
| 616 | PrintF(out, "\n - instance class name = "); |
| 617 | instance_class_name()->Print(out); |
| 618 | PrintF(out, "\n - code = "); |
| 619 | code()->ShortPrint(out); |
| 620 | PrintF(out, "\n - source code = "); |
| 621 | GetSourceCode()->ShortPrint(out); |
| 622 | // Script files are often large, hard to read. |
| 623 | // PrintF(out, "\n - script ="); |
| 624 | // script()->Print(out); |
| 625 | PrintF(out, "\n - function token position = %d", function_token_position()); |
| 626 | PrintF(out, "\n - start position = %d", start_position()); |
| 627 | PrintF(out, "\n - end position = %d", end_position()); |
| 628 | PrintF(out, "\n - is expression = %d", is_expression()); |
| 629 | PrintF(out, "\n - debug info = "); |
| 630 | debug_info()->ShortPrint(out); |
| 631 | PrintF(out, "\n - length = %d", length()); |
| 632 | PrintF(out, "\n - has_only_simple_this_property_assignments = %d", |
| 633 | has_only_simple_this_property_assignments()); |
| 634 | PrintF(out, "\n - this_property_assignments = "); |
| 635 | this_property_assignments()->ShortPrint(out); |
| 636 | PrintF(out, "\n"); |
| 637 | } |
| 638 | |
| 639 | |
| 640 | void JSGlobalProxy::JSGlobalProxyPrint(FILE* out) { |
| 641 | PrintF(out, "global_proxy"); |
| 642 | JSObjectPrint(out); |
| 643 | PrintF(out, "context : "); |
| 644 | context()->ShortPrint(out); |
| 645 | PrintF(out, "\n"); |
| 646 | } |
| 647 | |
| 648 | |
| 649 | void JSGlobalObject::JSGlobalObjectPrint(FILE* out) { |
| 650 | PrintF(out, "global "); |
| 651 | JSObjectPrint(out); |
| 652 | PrintF(out, "global context : "); |
| 653 | global_context()->ShortPrint(out); |
| 654 | PrintF(out, "\n"); |
| 655 | } |
| 656 | |
| 657 | |
| 658 | void JSBuiltinsObject::JSBuiltinsObjectPrint(FILE* out) { |
| 659 | PrintF(out, "builtins "); |
| 660 | JSObjectPrint(out); |
| 661 | } |
| 662 | |
| 663 | |
| 664 | void JSGlobalPropertyCell::JSGlobalPropertyCellPrint(FILE* out) { |
| 665 | HeapObject::PrintHeader(out, "JSGlobalPropertyCell"); |
| 666 | } |
| 667 | |
| 668 | |
| 669 | void Code::CodePrint(FILE* out) { |
| 670 | HeapObject::PrintHeader(out, "Code"); |
| 671 | #ifdef ENABLE_DISASSEMBLER |
| 672 | if (FLAG_use_verbose_printer) { |
| 673 | Disassemble(NULL, out); |
| 674 | } |
| 675 | #endif |
| 676 | } |
| 677 | |
| 678 | |
ager@chromium.org | ea91cc5 | 2011-05-23 06:06:11 +0000 | [diff] [blame] | 679 | void Foreign::ForeignPrint(FILE* out) { |
| 680 | PrintF(out, "foreign address : %p", address()); |
fschneider@chromium.org | 9e3e0b6 | 2011-01-03 10:16:46 +0000 | [diff] [blame] | 681 | } |
| 682 | |
| 683 | |
| 684 | void AccessorInfo::AccessorInfoPrint(FILE* out) { |
| 685 | HeapObject::PrintHeader(out, "AccessorInfo"); |
| 686 | PrintF(out, "\n - getter: "); |
| 687 | getter()->ShortPrint(out); |
| 688 | PrintF(out, "\n - setter: "); |
| 689 | setter()->ShortPrint(out); |
| 690 | PrintF(out, "\n - name: "); |
| 691 | name()->ShortPrint(out); |
| 692 | PrintF(out, "\n - data: "); |
| 693 | data()->ShortPrint(out); |
| 694 | PrintF(out, "\n - flag: "); |
| 695 | flag()->ShortPrint(out); |
| 696 | } |
| 697 | |
| 698 | |
| 699 | void AccessCheckInfo::AccessCheckInfoPrint(FILE* out) { |
| 700 | HeapObject::PrintHeader(out, "AccessCheckInfo"); |
| 701 | PrintF(out, "\n - named_callback: "); |
| 702 | named_callback()->ShortPrint(out); |
| 703 | PrintF(out, "\n - indexed_callback: "); |
| 704 | indexed_callback()->ShortPrint(out); |
| 705 | PrintF(out, "\n - data: "); |
| 706 | data()->ShortPrint(out); |
| 707 | } |
| 708 | |
| 709 | |
| 710 | void InterceptorInfo::InterceptorInfoPrint(FILE* out) { |
| 711 | HeapObject::PrintHeader(out, "InterceptorInfo"); |
| 712 | PrintF(out, "\n - getter: "); |
| 713 | getter()->ShortPrint(out); |
| 714 | PrintF(out, "\n - setter: "); |
| 715 | setter()->ShortPrint(out); |
| 716 | PrintF(out, "\n - query: "); |
| 717 | query()->ShortPrint(out); |
| 718 | PrintF(out, "\n - deleter: "); |
| 719 | deleter()->ShortPrint(out); |
| 720 | PrintF(out, "\n - enumerator: "); |
| 721 | enumerator()->ShortPrint(out); |
| 722 | PrintF(out, "\n - data: "); |
| 723 | data()->ShortPrint(out); |
| 724 | } |
| 725 | |
| 726 | |
| 727 | void CallHandlerInfo::CallHandlerInfoPrint(FILE* out) { |
| 728 | HeapObject::PrintHeader(out, "CallHandlerInfo"); |
| 729 | PrintF(out, "\n - callback: "); |
| 730 | callback()->ShortPrint(out); |
| 731 | PrintF(out, "\n - data: "); |
| 732 | data()->ShortPrint(out); |
| 733 | PrintF(out, "\n - call_stub_cache: "); |
| 734 | } |
| 735 | |
| 736 | |
| 737 | void FunctionTemplateInfo::FunctionTemplateInfoPrint(FILE* out) { |
| 738 | HeapObject::PrintHeader(out, "FunctionTemplateInfo"); |
| 739 | PrintF(out, "\n - class name: "); |
| 740 | class_name()->ShortPrint(out); |
| 741 | PrintF(out, "\n - tag: "); |
| 742 | tag()->ShortPrint(out); |
| 743 | PrintF(out, "\n - property_list: "); |
| 744 | property_list()->ShortPrint(out); |
| 745 | PrintF(out, "\n - serial_number: "); |
| 746 | serial_number()->ShortPrint(out); |
| 747 | PrintF(out, "\n - call_code: "); |
| 748 | call_code()->ShortPrint(out); |
| 749 | PrintF(out, "\n - property_accessors: "); |
| 750 | property_accessors()->ShortPrint(out); |
| 751 | PrintF(out, "\n - prototype_template: "); |
| 752 | prototype_template()->ShortPrint(out); |
| 753 | PrintF(out, "\n - parent_template: "); |
| 754 | parent_template()->ShortPrint(out); |
| 755 | PrintF(out, "\n - named_property_handler: "); |
| 756 | named_property_handler()->ShortPrint(out); |
| 757 | PrintF(out, "\n - indexed_property_handler: "); |
| 758 | indexed_property_handler()->ShortPrint(out); |
| 759 | PrintF(out, "\n - instance_template: "); |
| 760 | instance_template()->ShortPrint(out); |
| 761 | PrintF(out, "\n - signature: "); |
| 762 | signature()->ShortPrint(out); |
| 763 | PrintF(out, "\n - access_check_info: "); |
| 764 | access_check_info()->ShortPrint(out); |
| 765 | PrintF(out, "\n - hidden_prototype: %s", |
| 766 | hidden_prototype() ? "true" : "false"); |
| 767 | PrintF(out, "\n - undetectable: %s", undetectable() ? "true" : "false"); |
| 768 | PrintF(out, "\n - need_access_check: %s", |
| 769 | needs_access_check() ? "true" : "false"); |
| 770 | } |
| 771 | |
| 772 | |
| 773 | void ObjectTemplateInfo::ObjectTemplateInfoPrint(FILE* out) { |
| 774 | HeapObject::PrintHeader(out, "ObjectTemplateInfo"); |
| 775 | PrintF(out, "\n - constructor: "); |
| 776 | constructor()->ShortPrint(out); |
| 777 | PrintF(out, "\n - internal_field_count: "); |
| 778 | internal_field_count()->ShortPrint(out); |
| 779 | } |
| 780 | |
| 781 | |
| 782 | void SignatureInfo::SignatureInfoPrint(FILE* out) { |
| 783 | HeapObject::PrintHeader(out, "SignatureInfo"); |
| 784 | PrintF(out, "\n - receiver: "); |
| 785 | receiver()->ShortPrint(out); |
| 786 | PrintF(out, "\n - args: "); |
| 787 | args()->ShortPrint(out); |
| 788 | } |
| 789 | |
| 790 | |
| 791 | void TypeSwitchInfo::TypeSwitchInfoPrint(FILE* out) { |
| 792 | HeapObject::PrintHeader(out, "TypeSwitchInfo"); |
| 793 | PrintF(out, "\n - types: "); |
| 794 | types()->ShortPrint(out); |
| 795 | } |
| 796 | |
| 797 | |
| 798 | void Script::ScriptPrint(FILE* out) { |
| 799 | HeapObject::PrintHeader(out, "Script"); |
| 800 | PrintF(out, "\n - source: "); |
| 801 | source()->ShortPrint(out); |
| 802 | PrintF(out, "\n - name: "); |
| 803 | name()->ShortPrint(out); |
| 804 | PrintF(out, "\n - line_offset: "); |
| 805 | line_offset()->ShortPrint(out); |
| 806 | PrintF(out, "\n - column_offset: "); |
| 807 | column_offset()->ShortPrint(out); |
| 808 | PrintF(out, "\n - type: "); |
| 809 | type()->ShortPrint(out); |
| 810 | PrintF(out, "\n - id: "); |
| 811 | id()->ShortPrint(out); |
| 812 | PrintF(out, "\n - data: "); |
| 813 | data()->ShortPrint(out); |
| 814 | PrintF(out, "\n - context data: "); |
| 815 | context_data()->ShortPrint(out); |
| 816 | PrintF(out, "\n - wrapper: "); |
| 817 | wrapper()->ShortPrint(out); |
| 818 | PrintF(out, "\n - compilation type: "); |
| 819 | compilation_type()->ShortPrint(out); |
| 820 | PrintF(out, "\n - line ends: "); |
| 821 | line_ends()->ShortPrint(out); |
| 822 | PrintF(out, "\n - eval from shared: "); |
| 823 | eval_from_shared()->ShortPrint(out); |
| 824 | PrintF(out, "\n - eval from instructions offset: "); |
| 825 | eval_from_instructions_offset()->ShortPrint(out); |
| 826 | PrintF(out, "\n"); |
| 827 | } |
| 828 | |
| 829 | |
| 830 | #ifdef ENABLE_DEBUGGER_SUPPORT |
| 831 | void DebugInfo::DebugInfoPrint(FILE* out) { |
| 832 | HeapObject::PrintHeader(out, "DebugInfo"); |
| 833 | PrintF(out, "\n - shared: "); |
| 834 | shared()->ShortPrint(out); |
| 835 | PrintF(out, "\n - original_code: "); |
| 836 | original_code()->ShortPrint(out); |
| 837 | PrintF(out, "\n - code: "); |
| 838 | code()->ShortPrint(out); |
| 839 | PrintF(out, "\n - break_points: "); |
| 840 | break_points()->Print(out); |
| 841 | } |
| 842 | |
| 843 | |
| 844 | void BreakPointInfo::BreakPointInfoPrint(FILE* out) { |
| 845 | HeapObject::PrintHeader(out, "BreakPointInfo"); |
| 846 | PrintF(out, "\n - code_position: %d", code_position()->value()); |
| 847 | PrintF(out, "\n - source_position: %d", source_position()->value()); |
| 848 | PrintF(out, "\n - statement_position: %d", statement_position()->value()); |
| 849 | PrintF(out, "\n - break_point_objects: "); |
| 850 | break_point_objects()->ShortPrint(out); |
| 851 | } |
| 852 | #endif // ENABLE_DEBUGGER_SUPPORT |
| 853 | |
| 854 | |
| 855 | void DescriptorArray::PrintDescriptors(FILE* out) { |
| 856 | PrintF(out, "Descriptor array %d\n", number_of_descriptors()); |
| 857 | for (int i = 0; i < number_of_descriptors(); i++) { |
| 858 | PrintF(out, " %d: ", i); |
| 859 | Descriptor desc; |
| 860 | Get(i, &desc); |
| 861 | desc.Print(out); |
| 862 | } |
| 863 | PrintF(out, "\n"); |
| 864 | } |
| 865 | |
| 866 | |
| 867 | #endif // OBJECT_PRINT |
| 868 | |
| 869 | |
| 870 | } } // namespace v8::internal |