objects-printer.cc revision 1e0659c275bb392c045087af4f6b0d7565cb3d77
19fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block// Copyright 2010 the V8 project authors. All rights reserved. 29fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block// Redistribution and use in source and binary forms, with or without 39fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block// modification, are permitted provided that the following conditions are 49fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block// met: 59fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block// 69fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block// * Redistributions of source code must retain the above copyright 79fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block// notice, this list of conditions and the following disclaimer. 89fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block// * Redistributions in binary form must reproduce the above 99fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block// copyright notice, this list of conditions and the following 109fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block// disclaimer in the documentation and/or other materials provided 119fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block// with the distribution. 129fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block// * Neither the name of Google Inc. nor the names of its 139fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block// contributors may be used to endorse or promote products derived 149fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block// from this software without specific prior written permission. 159fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block// 169fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 179fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 189fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 199fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 209fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 219fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 229fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 239fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 249fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 259fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 269fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 279fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 289fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block#include "v8.h" 299fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 309fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block#include "disassembler.h" 319fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block#include "disasm.h" 329fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block#include "jsregexp.h" 339fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block#include "objects-visiting.h" 349fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 359fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blocknamespace v8 { 369fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blocknamespace internal { 379fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 389fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block#ifdef OBJECT_PRINT 399fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 409fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockstatic const char* TypeToString(InstanceType type); 419fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 429fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 439fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid MaybeObject::Print(FILE* out) { 449fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block Object* this_as_object; 459fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block if (ToObject(&this_as_object)) { 469fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block if (this_as_object->IsSmi()) { 479fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block Smi::cast(this_as_object)->SmiPrint(out); 489fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } else { 499fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block HeapObject::cast(this_as_object)->HeapObjectPrint(out); 509fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 519fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } else { 529fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block Failure::cast(this)->FailurePrint(out); 539fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 549fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block Flush(out); 559fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 569fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 579fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 589fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid MaybeObject::PrintLn(FILE* out) { 599fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block Print(out); 609fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n"); 619fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 629fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 639fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 649fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid HeapObject::PrintHeader(FILE* out, const char* id) { 659fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "%p: [%s]\n", reinterpret_cast<void*>(this), id); 669fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 679fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 689fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 699fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid HeapObject::HeapObjectPrint(FILE* out) { 709fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block InstanceType instance_type = map()->instance_type(); 719fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 729fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block HandleScope scope; 739fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block if (instance_type < FIRST_NONSTRING_TYPE) { 749fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block String::cast(this)->StringPrint(out); 759fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block return; 769fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 779fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 789fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block switch (instance_type) { 799fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case MAP_TYPE: 809fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block Map::cast(this)->MapPrint(out); 819fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 829fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case HEAP_NUMBER_TYPE: 839fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block HeapNumber::cast(this)->HeapNumberPrint(out); 849fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 859fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case FIXED_ARRAY_TYPE: 869fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block FixedArray::cast(this)->FixedArrayPrint(out); 879fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 889fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case BYTE_ARRAY_TYPE: 899fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block ByteArray::cast(this)->ByteArrayPrint(out); 909fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 919fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case PIXEL_ARRAY_TYPE: 929fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PixelArray::cast(this)->PixelArrayPrint(out); 939fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 949fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case EXTERNAL_BYTE_ARRAY_TYPE: 959fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block ExternalByteArray::cast(this)->ExternalByteArrayPrint(out); 969fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 979fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE: 989fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block ExternalUnsignedByteArray::cast(this) 999fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block ->ExternalUnsignedByteArrayPrint(out); 1009fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 1019fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case EXTERNAL_SHORT_ARRAY_TYPE: 1029fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block ExternalShortArray::cast(this)->ExternalShortArrayPrint(out); 1039fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 1049fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE: 1059fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block ExternalUnsignedShortArray::cast(this) 1069fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block ->ExternalUnsignedShortArrayPrint(out); 1079fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 1089fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case EXTERNAL_INT_ARRAY_TYPE: 1099fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block ExternalIntArray::cast(this)->ExternalIntArrayPrint(out); 1109fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 1119fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case EXTERNAL_UNSIGNED_INT_ARRAY_TYPE: 1129fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block ExternalUnsignedIntArray::cast(this)->ExternalUnsignedIntArrayPrint(out); 1139fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 1149fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case EXTERNAL_FLOAT_ARRAY_TYPE: 1159fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block ExternalFloatArray::cast(this)->ExternalFloatArrayPrint(out); 1169fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 1179fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case FILLER_TYPE: 1189fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "filler"); 1199fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 1209fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case JS_OBJECT_TYPE: // fall through 1219fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case JS_CONTEXT_EXTENSION_OBJECT_TYPE: 1229fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case JS_ARRAY_TYPE: 1239fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case JS_REGEXP_TYPE: 1249fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block JSObject::cast(this)->JSObjectPrint(out); 1259fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 1269fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case ODDBALL_TYPE: 1279fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block Oddball::cast(this)->to_string()->Print(out); 1289fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 1299fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case JS_FUNCTION_TYPE: 1309fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block JSFunction::cast(this)->JSFunctionPrint(out); 1319fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 1329fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case JS_GLOBAL_PROXY_TYPE: 1339fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block JSGlobalProxy::cast(this)->JSGlobalProxyPrint(out); 1349fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 1359fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case JS_GLOBAL_OBJECT_TYPE: 1369fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block JSGlobalObject::cast(this)->JSGlobalObjectPrint(out); 1379fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 1389fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case JS_BUILTINS_OBJECT_TYPE: 1399fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block JSBuiltinsObject::cast(this)->JSBuiltinsObjectPrint(out); 1409fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 1419fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case JS_VALUE_TYPE: 1429fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "Value wrapper around:"); 1439fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block JSValue::cast(this)->value()->Print(out); 1449fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 1459fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case CODE_TYPE: 1469fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block Code::cast(this)->CodePrint(out); 1479fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 1489fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case PROXY_TYPE: 1499fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block Proxy::cast(this)->ProxyPrint(out); 1509fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 1519fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case SHARED_FUNCTION_INFO_TYPE: 1529fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block SharedFunctionInfo::cast(this)->SharedFunctionInfoPrint(out); 1539fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 1541e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block case JS_MESSAGE_OBJECT_TYPE: 1551e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block JSMessageObject::cast(this)->JSMessageObjectPrint(out); 1561e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block break; 1579fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case JS_GLOBAL_PROPERTY_CELL_TYPE: 1589fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block JSGlobalPropertyCell::cast(this)->JSGlobalPropertyCellPrint(out); 1599fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 1609fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block#define MAKE_STRUCT_CASE(NAME, Name, name) \ 1619fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case NAME##_TYPE: \ 1629fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block Name::cast(this)->Name##Print(out); \ 1639fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 1649fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block STRUCT_LIST(MAKE_STRUCT_CASE) 1659fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block#undef MAKE_STRUCT_CASE 1669fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 1679fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block default: 1689fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "UNKNOWN TYPE %d", map()->instance_type()); 1699fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block UNREACHABLE(); 1709fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 1719fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 1729fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 1739fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 1749fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 1759fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid ByteArray::ByteArrayPrint(FILE* out) { 1769fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "byte array, data starts at %p", GetDataStartAddress()); 1779fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 1789fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 1799fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 1809fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid PixelArray::PixelArrayPrint(FILE* out) { 1819fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "pixel array"); 1829fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 1839fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 1849fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 1859fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid ExternalByteArray::ExternalByteArrayPrint(FILE* out) { 1869fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "external byte array"); 1879fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 1889fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 1899fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 1909fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid ExternalUnsignedByteArray::ExternalUnsignedByteArrayPrint(FILE* out) { 1919fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "external unsigned byte array"); 1929fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 1939fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 1949fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 1959fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid ExternalShortArray::ExternalShortArrayPrint(FILE* out) { 1969fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "external short array"); 1979fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 1989fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 1999fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 2009fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid ExternalUnsignedShortArray::ExternalUnsignedShortArrayPrint(FILE* out) { 2019fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "external unsigned short array"); 2029fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 2039fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 2049fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 2059fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid ExternalIntArray::ExternalIntArrayPrint(FILE* out) { 2069fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "external int array"); 2079fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 2089fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 2099fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 2109fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid ExternalUnsignedIntArray::ExternalUnsignedIntArrayPrint(FILE* out) { 2119fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "external unsigned int array"); 2129fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 2139fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 2149fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 2159fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid ExternalFloatArray::ExternalFloatArrayPrint(FILE* out) { 2169fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "external float array"); 2179fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 2189fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 2199fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 2209fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid JSObject::PrintProperties(FILE* out) { 2219fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block if (HasFastProperties()) { 2229fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block DescriptorArray* descs = map()->instance_descriptors(); 2239fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block for (int i = 0; i < descs->number_of_descriptors(); i++) { 2249fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " "); 2259fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block descs->GetKey(i)->StringPrint(out); 2269fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, ": "); 2279fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block switch (descs->GetType(i)) { 2289fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case FIELD: { 2299fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block int index = descs->GetFieldIndex(i); 2309fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block FastPropertyAt(index)->ShortPrint(out); 2319fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " (field at offset %d)\n", index); 2329fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 2339fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 2349fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case CONSTANT_FUNCTION: 2359fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block descs->GetConstantFunction(i)->ShortPrint(out); 2369fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " (constant function)\n"); 2379fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 2389fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case CALLBACKS: 2399fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block descs->GetCallbacksObject(i)->ShortPrint(out); 2409fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " (callback)\n"); 2419fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 2429fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case MAP_TRANSITION: 2439fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " (map transition)\n"); 2449fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 2459fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case CONSTANT_TRANSITION: 2469fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " (constant transition)\n"); 2479fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 2489fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case NULL_DESCRIPTOR: 2499fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " (null descriptor)\n"); 2509fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 2519fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block default: 2529fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block UNREACHABLE(); 2539fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 2549fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 2559fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 2569fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } else { 2579fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block property_dictionary()->Print(out); 2589fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 2599fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 2609fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 2619fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 2629fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid JSObject::PrintElements(FILE* out) { 2639fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block switch (GetElementsKind()) { 2649fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case FAST_ELEMENTS: { 2659fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block // Print in array notation for non-sparse arrays. 2669fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block FixedArray* p = FixedArray::cast(elements()); 2679fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block for (int i = 0; i < p->length(); i++) { 2689fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " %d: ", i); 2699fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block p->get(i)->ShortPrint(out); 2709fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n"); 2719fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 2729fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 2739fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 2749fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case PIXEL_ELEMENTS: { 2759fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PixelArray* p = PixelArray::cast(elements()); 2769fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block for (int i = 0; i < p->length(); i++) { 2779fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " %d: %d\n", i, p->get(i)); 2789fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 2799fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 2809fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 2819fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case EXTERNAL_BYTE_ELEMENTS: { 2829fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block ExternalByteArray* p = ExternalByteArray::cast(elements()); 2839fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block for (int i = 0; i < p->length(); i++) { 2849fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " %d: %d\n", i, static_cast<int>(p->get(i))); 2859fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 2869fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 2879fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 2889fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case EXTERNAL_UNSIGNED_BYTE_ELEMENTS: { 2899fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block ExternalUnsignedByteArray* p = 2909fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block ExternalUnsignedByteArray::cast(elements()); 2919fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block for (int i = 0; i < p->length(); i++) { 2929fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " %d: %d\n", i, static_cast<int>(p->get(i))); 2939fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 2949fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 2959fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 2969fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case EXTERNAL_SHORT_ELEMENTS: { 2979fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block ExternalShortArray* p = ExternalShortArray::cast(elements()); 2989fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block for (int i = 0; i < p->length(); i++) { 2999fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " %d: %d\n", i, static_cast<int>(p->get(i))); 3009fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 3019fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 3029fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 3039fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case EXTERNAL_UNSIGNED_SHORT_ELEMENTS: { 3049fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block ExternalUnsignedShortArray* p = 3059fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block ExternalUnsignedShortArray::cast(elements()); 3069fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block for (int i = 0; i < p->length(); i++) { 3079fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " %d: %d\n", i, static_cast<int>(p->get(i))); 3089fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 3099fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 3109fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 3119fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case EXTERNAL_INT_ELEMENTS: { 3129fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block ExternalIntArray* p = ExternalIntArray::cast(elements()); 3139fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block for (int i = 0; i < p->length(); i++) { 3149fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " %d: %d\n", i, static_cast<int>(p->get(i))); 3159fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 3169fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 3179fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 3189fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case EXTERNAL_UNSIGNED_INT_ELEMENTS: { 3199fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block ExternalUnsignedIntArray* p = 3209fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block ExternalUnsignedIntArray::cast(elements()); 3219fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block for (int i = 0; i < p->length(); i++) { 3229fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " %d: %d\n", i, static_cast<int>(p->get(i))); 3239fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 3249fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 3259fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 3269fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case EXTERNAL_FLOAT_ELEMENTS: { 3279fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block ExternalFloatArray* p = ExternalFloatArray::cast(elements()); 3289fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block for (int i = 0; i < p->length(); i++) { 3299fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " %d: %f\n", i, p->get(i)); 3309fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 3319fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 3329fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 3339fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case DICTIONARY_ELEMENTS: 3349fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block elements()->Print(out); 3359fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 3369fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block default: 3379fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block UNREACHABLE(); 3389fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break; 3399fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 3409fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 3419fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 3429fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 3439fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid JSObject::JSObjectPrint(FILE* out) { 3449fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "%p: [JSObject]\n", reinterpret_cast<void*>(this)); 3459fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " - map = %p\n", reinterpret_cast<void*>(map())); 3469fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " - prototype = %p\n", reinterpret_cast<void*>(GetPrototype())); 3479fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " {\n"); 3489fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintProperties(out); 3499fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintElements(out); 3509fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " }\n"); 3519fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 3529fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 3539fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 3549fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockstatic const char* TypeToString(InstanceType type) { 3559fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block switch (type) { 3569fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case INVALID_TYPE: return "INVALID"; 3579fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case MAP_TYPE: return "MAP"; 3589fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case HEAP_NUMBER_TYPE: return "HEAP_NUMBER"; 3599fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case SYMBOL_TYPE: return "SYMBOL"; 3609fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case ASCII_SYMBOL_TYPE: return "ASCII_SYMBOL"; 3619fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case CONS_SYMBOL_TYPE: return "CONS_SYMBOL"; 3629fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case CONS_ASCII_SYMBOL_TYPE: return "CONS_ASCII_SYMBOL"; 3639fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case EXTERNAL_ASCII_SYMBOL_TYPE: 3649fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case EXTERNAL_SYMBOL_WITH_ASCII_DATA_TYPE: 3659fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case EXTERNAL_SYMBOL_TYPE: return "EXTERNAL_SYMBOL"; 3669fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case ASCII_STRING_TYPE: return "ASCII_STRING"; 3679fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case STRING_TYPE: return "TWO_BYTE_STRING"; 3689fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case CONS_STRING_TYPE: 3699fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case CONS_ASCII_STRING_TYPE: return "CONS_STRING"; 3709fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case EXTERNAL_ASCII_STRING_TYPE: 3719fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case EXTERNAL_STRING_WITH_ASCII_DATA_TYPE: 3729fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case EXTERNAL_STRING_TYPE: return "EXTERNAL_STRING"; 3739fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case FIXED_ARRAY_TYPE: return "FIXED_ARRAY"; 3749fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case BYTE_ARRAY_TYPE: return "BYTE_ARRAY"; 3759fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case PIXEL_ARRAY_TYPE: return "PIXEL_ARRAY"; 3769fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case EXTERNAL_BYTE_ARRAY_TYPE: return "EXTERNAL_BYTE_ARRAY"; 3779fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE: 3789fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block return "EXTERNAL_UNSIGNED_BYTE_ARRAY"; 3799fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case EXTERNAL_SHORT_ARRAY_TYPE: return "EXTERNAL_SHORT_ARRAY"; 3809fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE: 3819fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block return "EXTERNAL_UNSIGNED_SHORT_ARRAY"; 3829fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case EXTERNAL_INT_ARRAY_TYPE: return "EXTERNAL_INT_ARRAY"; 3839fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case EXTERNAL_UNSIGNED_INT_ARRAY_TYPE: 3849fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block return "EXTERNAL_UNSIGNED_INT_ARRAY"; 3859fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case EXTERNAL_FLOAT_ARRAY_TYPE: return "EXTERNAL_FLOAT_ARRAY"; 3869fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case FILLER_TYPE: return "FILLER"; 3879fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case JS_OBJECT_TYPE: return "JS_OBJECT"; 3889fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case JS_CONTEXT_EXTENSION_OBJECT_TYPE: return "JS_CONTEXT_EXTENSION_OBJECT"; 3899fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case ODDBALL_TYPE: return "ODDBALL"; 3909fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case JS_GLOBAL_PROPERTY_CELL_TYPE: return "JS_GLOBAL_PROPERTY_CELL"; 3919fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case SHARED_FUNCTION_INFO_TYPE: return "SHARED_FUNCTION_INFO"; 3929fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case JS_FUNCTION_TYPE: return "JS_FUNCTION"; 3939fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case CODE_TYPE: return "CODE"; 3949fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case JS_ARRAY_TYPE: return "JS_ARRAY"; 3959fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case JS_REGEXP_TYPE: return "JS_REGEXP"; 3969fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case JS_VALUE_TYPE: return "JS_VALUE"; 3979fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case JS_GLOBAL_OBJECT_TYPE: return "JS_GLOBAL_OBJECT"; 3989fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case JS_BUILTINS_OBJECT_TYPE: return "JS_BUILTINS_OBJECT"; 3999fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case JS_GLOBAL_PROXY_TYPE: return "JS_GLOBAL_PROXY"; 4009fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block case PROXY_TYPE: return "PROXY"; 4011e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block case LAST_STRING_TYPE: return "LAST_STRING_TYPE"; 4021e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block case JS_MESSAGE_OBJECT_TYPE: return "JS_MESSAGE_OBJECT_TYPE"; 4039fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block#define MAKE_STRUCT_CASE(NAME, Name, name) case NAME##_TYPE: return #NAME; 4049fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block STRUCT_LIST(MAKE_STRUCT_CASE) 4059fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block#undef MAKE_STRUCT_CASE 4069fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 4079fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block return "UNKNOWN"; 4089fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 4099fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 4109fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 4119fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid Map::MapPrint(FILE* out) { 4129fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block HeapObject::PrintHeader(out, "Map"); 4139fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " - type: %s\n", TypeToString(instance_type())); 4149fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " - instance size: %d\n", instance_size()); 4159fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " - inobject properties: %d\n", inobject_properties()); 4169fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " - pre-allocated property fields: %d\n", 4179fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block pre_allocated_property_fields()); 4189fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " - unused property fields: %d\n", unused_property_fields()); 4199fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block if (is_hidden_prototype()) { 4209fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " - hidden_prototype\n"); 4219fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 4229fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block if (has_named_interceptor()) { 4239fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " - named_interceptor\n"); 4249fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 4259fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block if (has_indexed_interceptor()) { 4269fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " - indexed_interceptor\n"); 4279fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 4289fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block if (is_undetectable()) { 4299fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " - undetectable\n"); 4309fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 4319fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block if (has_instance_call_handler()) { 4329fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " - instance_call_handler\n"); 4339fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 4349fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block if (is_access_check_needed()) { 4359fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " - access_check_needed\n"); 4369fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 4379fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " - instance descriptors: "); 4389fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block instance_descriptors()->ShortPrint(out); 4399fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - prototype: "); 4409fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block prototype()->ShortPrint(out); 4419fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - constructor: "); 4429fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block constructor()->ShortPrint(out); 4439fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n"); 4449fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 4459fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 4469fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 4479fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid CodeCache::CodeCachePrint(FILE* out) { 4489fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block HeapObject::PrintHeader(out, "CodeCache"); 4499fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - default_cache: "); 4509fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block default_cache()->ShortPrint(out); 4519fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - normal_type_cache: "); 4529fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block normal_type_cache()->ShortPrint(out); 4539fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 4549fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 4559fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 4569fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid FixedArray::FixedArrayPrint(FILE* out) { 4579fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block HeapObject::PrintHeader(out, "FixedArray"); 4589fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " - length: %d", length()); 4599fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block for (int i = 0; i < length(); i++) { 4609fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n [%d]: ", i); 4619fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block get(i)->ShortPrint(out); 4629fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 4639fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n"); 4649fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 4659fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 4669fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 4679fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid JSValue::JSValuePrint(FILE* out) { 4689fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block HeapObject::PrintHeader(out, "ValueObject"); 4699fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block value()->Print(out); 4709fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 4719fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 4729fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 4731e0659c275bb392c045087af4f6b0d7565cb3d77Steve Blockvoid JSMessageObject::JSMessageObjectPrint(FILE* out) { 4741e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block HeapObject::PrintHeader(out, "JSMessageObject"); 4751e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block PrintF(out, " - type: "); 4761e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block type()->ShortPrint(out); 4771e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block PrintF(out, "\n - arguments: "); 4781e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block arguments()->ShortPrint(out); 4791e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block PrintF(out, "\n - start_position: %d", start_position()); 4801e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block PrintF(out, "\n - end_position: %d", end_position()); 4811e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block PrintF(out, "\n - script: "); 4821e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block script()->ShortPrint(out); 4831e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block PrintF(out, "\n - stack_trace: "); 4841e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block stack_trace()->ShortPrint(out); 4851e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block PrintF(out, "\n - stack_frames: "); 4861e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block stack_frames()->ShortPrint(out); 4871e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block PrintF(out, "\n"); 4881e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block} 4891e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 4901e0659c275bb392c045087af4f6b0d7565cb3d77Steve Block 4919fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid String::StringPrint(FILE* out) { 4929fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block if (StringShape(this).IsSymbol()) { 4939fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "#"); 4949fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } else if (StringShape(this).IsCons()) { 4959fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "c\""); 4969fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } else { 4979fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\""); 4989fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 4999fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 5009fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block const char truncated_epilogue[] = "...<truncated>"; 5019fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block int len = length(); 5029fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block if (!FLAG_use_verbose_printer) { 5039fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block if (len > 100) { 5049fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block len = 100 - sizeof(truncated_epilogue); 5059fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 5069fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 5079fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block for (int i = 0; i < len; i++) { 5089fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "%c", Get(i)); 5099fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 5109fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block if (len != length()) { 5119fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "%s", truncated_epilogue); 5129fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 5139fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 5149fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block if (!StringShape(this).IsSymbol()) PrintF(out, "\""); 5159fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 5169fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 5179fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 5189fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid JSFunction::JSFunctionPrint(FILE* out) { 5199fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block HeapObject::PrintHeader(out, "Function"); 5209fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " - map = 0x%p\n", reinterpret_cast<void*>(map())); 5219fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " - initial_map = "); 5229fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block if (has_initial_map()) { 5239fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block initial_map()->ShortPrint(out); 5249fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 5259fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - shared_info = "); 5269fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block shared()->ShortPrint(out); 5279fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - name = "); 5289fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block shared()->name()->Print(out); 5299fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - context = "); 5309fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block unchecked_context()->ShortPrint(out); 5319fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - code = "); 5329fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block code()->ShortPrint(out); 5339fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n"); 5349fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 5359fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintProperties(out); 5369fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintElements(out); 5379fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 5389fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n"); 5399fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 5409fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 5419fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 5429fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid SharedFunctionInfo::SharedFunctionInfoPrint(FILE* out) { 5439fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block HeapObject::PrintHeader(out, "SharedFunctionInfo"); 5449fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " - name: "); 5459fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block name()->ShortPrint(out); 5469fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - expected_nof_properties: %d", expected_nof_properties()); 5479fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - instance class name = "); 5489fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block instance_class_name()->Print(out); 5499fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - code = "); 5509fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block code()->ShortPrint(out); 5519fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - source code = "); 5529fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block GetSourceCode()->ShortPrint(out); 5539fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block // Script files are often large, hard to read. 5549fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block // PrintF(out, "\n - script ="); 5559fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block // script()->Print(out); 5569fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - function token position = %d", function_token_position()); 5579fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - start position = %d", start_position()); 5589fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - end position = %d", end_position()); 5599fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - is expression = %d", is_expression()); 5609fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - debug info = "); 5619fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block debug_info()->ShortPrint(out); 5629fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - length = %d", length()); 5639fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - has_only_simple_this_property_assignments = %d", 5649fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block has_only_simple_this_property_assignments()); 5659fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - this_property_assignments = "); 5669fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block this_property_assignments()->ShortPrint(out); 5679fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n"); 5689fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 5699fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 5709fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 5719fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid JSGlobalProxy::JSGlobalProxyPrint(FILE* out) { 5729fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "global_proxy"); 5739fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block JSObjectPrint(out); 5749fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "context : "); 5759fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block context()->ShortPrint(out); 5769fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n"); 5779fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 5789fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 5799fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 5809fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid JSGlobalObject::JSGlobalObjectPrint(FILE* out) { 5819fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "global "); 5829fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block JSObjectPrint(out); 5839fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "global context : "); 5849fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block global_context()->ShortPrint(out); 5859fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n"); 5869fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 5879fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 5889fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 5899fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid JSBuiltinsObject::JSBuiltinsObjectPrint(FILE* out) { 5909fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "builtins "); 5919fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block JSObjectPrint(out); 5929fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 5939fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 5949fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 5959fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid JSGlobalPropertyCell::JSGlobalPropertyCellPrint(FILE* out) { 5969fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block HeapObject::PrintHeader(out, "JSGlobalPropertyCell"); 5979fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 5989fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 5999fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 6009fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid Code::CodePrint(FILE* out) { 6019fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block HeapObject::PrintHeader(out, "Code"); 6029fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block#ifdef ENABLE_DISASSEMBLER 6039fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block if (FLAG_use_verbose_printer) { 6049fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block Disassemble(NULL, out); 6059fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 6069fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block#endif 6079fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 6089fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 6099fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 6109fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid Proxy::ProxyPrint(FILE* out) { 6119fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "proxy to %p", proxy()); 6129fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 6139fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 6149fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 6159fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid AccessorInfo::AccessorInfoPrint(FILE* out) { 6169fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block HeapObject::PrintHeader(out, "AccessorInfo"); 6179fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - getter: "); 6189fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block getter()->ShortPrint(out); 6199fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - setter: "); 6209fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block setter()->ShortPrint(out); 6219fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - name: "); 6229fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block name()->ShortPrint(out); 6239fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - data: "); 6249fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block data()->ShortPrint(out); 6259fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - flag: "); 6269fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block flag()->ShortPrint(out); 6279fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 6289fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 6299fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 6309fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid AccessCheckInfo::AccessCheckInfoPrint(FILE* out) { 6319fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block HeapObject::PrintHeader(out, "AccessCheckInfo"); 6329fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - named_callback: "); 6339fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block named_callback()->ShortPrint(out); 6349fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - indexed_callback: "); 6359fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block indexed_callback()->ShortPrint(out); 6369fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - data: "); 6379fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block data()->ShortPrint(out); 6389fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 6399fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 6409fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 6419fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid InterceptorInfo::InterceptorInfoPrint(FILE* out) { 6429fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block HeapObject::PrintHeader(out, "InterceptorInfo"); 6439fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - getter: "); 6449fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block getter()->ShortPrint(out); 6459fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - setter: "); 6469fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block setter()->ShortPrint(out); 6479fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - query: "); 6489fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block query()->ShortPrint(out); 6499fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - deleter: "); 6509fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block deleter()->ShortPrint(out); 6519fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - enumerator: "); 6529fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block enumerator()->ShortPrint(out); 6539fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - data: "); 6549fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block data()->ShortPrint(out); 6559fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 6569fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 6579fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 6589fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid CallHandlerInfo::CallHandlerInfoPrint(FILE* out) { 6599fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block HeapObject::PrintHeader(out, "CallHandlerInfo"); 6609fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - callback: "); 6619fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block callback()->ShortPrint(out); 6629fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - data: "); 6639fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block data()->ShortPrint(out); 6649fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - call_stub_cache: "); 6659fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 6669fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 6679fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 6689fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid FunctionTemplateInfo::FunctionTemplateInfoPrint(FILE* out) { 6699fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block HeapObject::PrintHeader(out, "FunctionTemplateInfo"); 6709fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - class name: "); 6719fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block class_name()->ShortPrint(out); 6729fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - tag: "); 6739fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block tag()->ShortPrint(out); 6749fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - property_list: "); 6759fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block property_list()->ShortPrint(out); 6769fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - serial_number: "); 6779fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block serial_number()->ShortPrint(out); 6789fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - call_code: "); 6799fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block call_code()->ShortPrint(out); 6809fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - property_accessors: "); 6819fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block property_accessors()->ShortPrint(out); 6829fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - prototype_template: "); 6839fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block prototype_template()->ShortPrint(out); 6849fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - parent_template: "); 6859fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block parent_template()->ShortPrint(out); 6869fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - named_property_handler: "); 6879fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block named_property_handler()->ShortPrint(out); 6889fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - indexed_property_handler: "); 6899fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block indexed_property_handler()->ShortPrint(out); 6909fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - instance_template: "); 6919fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block instance_template()->ShortPrint(out); 6929fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - signature: "); 6939fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block signature()->ShortPrint(out); 6949fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - access_check_info: "); 6959fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block access_check_info()->ShortPrint(out); 6969fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - hidden_prototype: %s", 6979fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block hidden_prototype() ? "true" : "false"); 6989fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - undetectable: %s", undetectable() ? "true" : "false"); 6999fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - need_access_check: %s", 7009fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block needs_access_check() ? "true" : "false"); 7019fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 7029fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 7039fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 7049fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid ObjectTemplateInfo::ObjectTemplateInfoPrint(FILE* out) { 7059fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block HeapObject::PrintHeader(out, "ObjectTemplateInfo"); 7069fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - constructor: "); 7079fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block constructor()->ShortPrint(out); 7089fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - internal_field_count: "); 7099fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block internal_field_count()->ShortPrint(out); 7109fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 7119fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 7129fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 7139fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid SignatureInfo::SignatureInfoPrint(FILE* out) { 7149fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block HeapObject::PrintHeader(out, "SignatureInfo"); 7159fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - receiver: "); 7169fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block receiver()->ShortPrint(out); 7179fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - args: "); 7189fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block args()->ShortPrint(out); 7199fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 7209fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 7219fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 7229fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid TypeSwitchInfo::TypeSwitchInfoPrint(FILE* out) { 7239fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block HeapObject::PrintHeader(out, "TypeSwitchInfo"); 7249fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - types: "); 7259fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block types()->ShortPrint(out); 7269fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 7279fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 7289fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 7299fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid Script::ScriptPrint(FILE* out) { 7309fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block HeapObject::PrintHeader(out, "Script"); 7319fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - source: "); 7329fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block source()->ShortPrint(out); 7339fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - name: "); 7349fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block name()->ShortPrint(out); 7359fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - line_offset: "); 7369fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block line_offset()->ShortPrint(out); 7379fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - column_offset: "); 7389fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block column_offset()->ShortPrint(out); 7399fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - type: "); 7409fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block type()->ShortPrint(out); 7419fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - id: "); 7429fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block id()->ShortPrint(out); 7439fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - data: "); 7449fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block data()->ShortPrint(out); 7459fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - context data: "); 7469fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block context_data()->ShortPrint(out); 7479fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - wrapper: "); 7489fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block wrapper()->ShortPrint(out); 7499fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - compilation type: "); 7509fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block compilation_type()->ShortPrint(out); 7519fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - line ends: "); 7529fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block line_ends()->ShortPrint(out); 7539fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - eval from shared: "); 7549fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block eval_from_shared()->ShortPrint(out); 7559fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - eval from instructions offset: "); 7569fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block eval_from_instructions_offset()->ShortPrint(out); 7579fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n"); 7589fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 7599fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 7609fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 7619fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block#ifdef ENABLE_DEBUGGER_SUPPORT 7629fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid DebugInfo::DebugInfoPrint(FILE* out) { 7639fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block HeapObject::PrintHeader(out, "DebugInfo"); 7649fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - shared: "); 7659fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block shared()->ShortPrint(out); 7669fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - original_code: "); 7679fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block original_code()->ShortPrint(out); 7689fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - code: "); 7699fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block code()->ShortPrint(out); 7709fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - break_points: "); 7719fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break_points()->Print(out); 7729fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 7739fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 7749fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 7759fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid BreakPointInfo::BreakPointInfoPrint(FILE* out) { 7769fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block HeapObject::PrintHeader(out, "BreakPointInfo"); 7779fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - code_position: %d", code_position()->value()); 7789fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - source_position: %d", source_position()->value()); 7799fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - statement_position: %d", statement_position()->value()); 7809fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n - break_point_objects: "); 7819fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block break_point_objects()->ShortPrint(out); 7829fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 7839fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block#endif // ENABLE_DEBUGGER_SUPPORT 7849fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 7859fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 7869fac840a46e8b7e26894f4792ba26dde14c56b04Steve Blockvoid DescriptorArray::PrintDescriptors(FILE* out) { 7879fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "Descriptor array %d\n", number_of_descriptors()); 7889fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block for (int i = 0; i < number_of_descriptors(); i++) { 7899fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, " %d: ", i); 7909fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block Descriptor desc; 7919fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block Get(i, &desc); 7929fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block desc.Print(out); 7939fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block } 7949fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block PrintF(out, "\n"); 7959fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} 7969fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 7979fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 7989fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block#endif // OBJECT_PRINT 7999fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 8009fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block 8019fac840a46e8b7e26894f4792ba26dde14c56b04Steve Block} } // namespace v8::internal 802