2012-02-02 11:22:26 +00:00
|
|
|
// Copyright 2012 the V8 project authors. All rights reserved.
|
2010-12-22 13:04:47 +00:00
|
|
|
// Redistribution and use in source and binary forms, with or without
|
|
|
|
// modification, are permitted provided that the following conditions are
|
|
|
|
// met:
|
|
|
|
//
|
|
|
|
// * Redistributions of source code must retain the above copyright
|
|
|
|
// notice, this list of conditions and the following disclaimer.
|
|
|
|
// * Redistributions in binary form must reproduce the above
|
|
|
|
// copyright notice, this list of conditions and the following
|
|
|
|
// disclaimer in the documentation and/or other materials provided
|
|
|
|
// with the distribution.
|
|
|
|
// * Neither the name of Google Inc. nor the names of its
|
|
|
|
// contributors may be used to endorse or promote products derived
|
|
|
|
// from this software without specific prior written permission.
|
|
|
|
//
|
|
|
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
|
|
#include "v8.h"
|
|
|
|
|
|
|
|
#include "disassembler.h"
|
|
|
|
#include "disasm.h"
|
|
|
|
#include "jsregexp.h"
|
|
|
|
#include "objects-visiting.h"
|
|
|
|
|
|
|
|
namespace v8 {
|
|
|
|
namespace internal {
|
|
|
|
|
|
|
|
#ifdef OBJECT_PRINT
|
|
|
|
|
2013-07-18 14:40:59 +00:00
|
|
|
void MaybeObject::Print() {
|
|
|
|
Print(stdout);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-12-22 13:04:47 +00:00
|
|
|
void MaybeObject::Print(FILE* out) {
|
|
|
|
Object* this_as_object;
|
|
|
|
if (ToObject(&this_as_object)) {
|
|
|
|
if (this_as_object->IsSmi()) {
|
|
|
|
Smi::cast(this_as_object)->SmiPrint(out);
|
|
|
|
} else {
|
|
|
|
HeapObject::cast(this_as_object)->HeapObjectPrint(out);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
Failure::cast(this)->FailurePrint(out);
|
|
|
|
}
|
|
|
|
Flush(out);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-07-18 14:40:59 +00:00
|
|
|
void MaybeObject::PrintLn() {
|
|
|
|
PrintLn(stdout);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-12-22 13:04:47 +00:00
|
|
|
void MaybeObject::PrintLn(FILE* out) {
|
|
|
|
Print(out);
|
|
|
|
PrintF(out, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void HeapObject::PrintHeader(FILE* out, const char* id) {
|
|
|
|
PrintF(out, "%p: [%s]\n", reinterpret_cast<void*>(this), id);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void HeapObject::HeapObjectPrint(FILE* out) {
|
|
|
|
InstanceType instance_type = map()->instance_type();
|
|
|
|
|
2013-02-15 09:27:10 +00:00
|
|
|
HandleScope scope(GetIsolate());
|
2010-12-22 13:04:47 +00:00
|
|
|
if (instance_type < FIRST_NONSTRING_TYPE) {
|
|
|
|
String::cast(this)->StringPrint(out);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (instance_type) {
|
2013-03-01 10:34:31 +00:00
|
|
|
case SYMBOL_TYPE:
|
|
|
|
Symbol::cast(this)->SymbolPrint(out);
|
|
|
|
break;
|
2010-12-22 13:04:47 +00:00
|
|
|
case MAP_TYPE:
|
|
|
|
Map::cast(this)->MapPrint(out);
|
|
|
|
break;
|
|
|
|
case HEAP_NUMBER_TYPE:
|
|
|
|
HeapNumber::cast(this)->HeapNumberPrint(out);
|
|
|
|
break;
|
2011-09-22 11:30:04 +00:00
|
|
|
case FIXED_DOUBLE_ARRAY_TYPE:
|
|
|
|
FixedDoubleArray::cast(this)->FixedDoubleArrayPrint(out);
|
|
|
|
break;
|
2013-10-14 13:35:06 +00:00
|
|
|
case CONSTANT_POOL_ARRAY_TYPE:
|
|
|
|
ConstantPoolArray::cast(this)->ConstantPoolArrayPrint(out);
|
|
|
|
break;
|
2010-12-22 13:04:47 +00:00
|
|
|
case FIXED_ARRAY_TYPE:
|
|
|
|
FixedArray::cast(this)->FixedArrayPrint(out);
|
|
|
|
break;
|
|
|
|
case BYTE_ARRAY_TYPE:
|
|
|
|
ByteArray::cast(this)->ByteArrayPrint(out);
|
|
|
|
break;
|
2011-09-19 18:36:47 +00:00
|
|
|
case FREE_SPACE_TYPE:
|
|
|
|
FreeSpace::cast(this)->FreeSpacePrint(out);
|
|
|
|
break;
|
2011-03-09 15:01:16 +00:00
|
|
|
case EXTERNAL_PIXEL_ARRAY_TYPE:
|
|
|
|
ExternalPixelArray::cast(this)->ExternalPixelArrayPrint(out);
|
2010-12-22 13:04:47 +00:00
|
|
|
break;
|
|
|
|
case EXTERNAL_BYTE_ARRAY_TYPE:
|
|
|
|
ExternalByteArray::cast(this)->ExternalByteArrayPrint(out);
|
|
|
|
break;
|
|
|
|
case EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE:
|
|
|
|
ExternalUnsignedByteArray::cast(this)
|
|
|
|
->ExternalUnsignedByteArrayPrint(out);
|
|
|
|
break;
|
|
|
|
case EXTERNAL_SHORT_ARRAY_TYPE:
|
|
|
|
ExternalShortArray::cast(this)->ExternalShortArrayPrint(out);
|
|
|
|
break;
|
|
|
|
case EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE:
|
|
|
|
ExternalUnsignedShortArray::cast(this)
|
|
|
|
->ExternalUnsignedShortArrayPrint(out);
|
|
|
|
break;
|
|
|
|
case EXTERNAL_INT_ARRAY_TYPE:
|
|
|
|
ExternalIntArray::cast(this)->ExternalIntArrayPrint(out);
|
|
|
|
break;
|
|
|
|
case EXTERNAL_UNSIGNED_INT_ARRAY_TYPE:
|
|
|
|
ExternalUnsignedIntArray::cast(this)->ExternalUnsignedIntArrayPrint(out);
|
|
|
|
break;
|
|
|
|
case EXTERNAL_FLOAT_ARRAY_TYPE:
|
|
|
|
ExternalFloatArray::cast(this)->ExternalFloatArrayPrint(out);
|
|
|
|
break;
|
2011-04-21 07:15:43 +00:00
|
|
|
case EXTERNAL_DOUBLE_ARRAY_TYPE:
|
|
|
|
ExternalDoubleArray::cast(this)->ExternalDoubleArrayPrint(out);
|
|
|
|
break;
|
2010-12-22 13:04:47 +00:00
|
|
|
case FILLER_TYPE:
|
|
|
|
PrintF(out, "filler");
|
|
|
|
break;
|
|
|
|
case JS_OBJECT_TYPE: // fall through
|
|
|
|
case JS_CONTEXT_EXTENSION_OBJECT_TYPE:
|
|
|
|
case JS_ARRAY_TYPE:
|
2013-04-15 12:29:44 +00:00
|
|
|
case JS_GENERATOR_OBJECT_TYPE:
|
2010-12-22 13:04:47 +00:00
|
|
|
case JS_REGEXP_TYPE:
|
|
|
|
JSObject::cast(this)->JSObjectPrint(out);
|
|
|
|
break;
|
|
|
|
case ODDBALL_TYPE:
|
|
|
|
Oddball::cast(this)->to_string()->Print(out);
|
|
|
|
break;
|
2012-04-16 14:43:27 +00:00
|
|
|
case JS_MODULE_TYPE:
|
|
|
|
JSModule::cast(this)->JSModulePrint(out);
|
|
|
|
break;
|
2010-12-22 13:04:47 +00:00
|
|
|
case JS_FUNCTION_TYPE:
|
|
|
|
JSFunction::cast(this)->JSFunctionPrint(out);
|
|
|
|
break;
|
|
|
|
case JS_GLOBAL_PROXY_TYPE:
|
|
|
|
JSGlobalProxy::cast(this)->JSGlobalProxyPrint(out);
|
|
|
|
break;
|
|
|
|
case JS_GLOBAL_OBJECT_TYPE:
|
|
|
|
JSGlobalObject::cast(this)->JSGlobalObjectPrint(out);
|
|
|
|
break;
|
|
|
|
case JS_BUILTINS_OBJECT_TYPE:
|
|
|
|
JSBuiltinsObject::cast(this)->JSBuiltinsObjectPrint(out);
|
|
|
|
break;
|
|
|
|
case JS_VALUE_TYPE:
|
|
|
|
PrintF(out, "Value wrapper around:");
|
|
|
|
JSValue::cast(this)->value()->Print(out);
|
|
|
|
break;
|
2012-03-09 11:11:55 +00:00
|
|
|
case JS_DATE_TYPE:
|
2012-04-16 14:43:27 +00:00
|
|
|
JSDate::cast(this)->JSDatePrint(out);
|
2012-03-09 11:11:55 +00:00
|
|
|
break;
|
2010-12-22 13:04:47 +00:00
|
|
|
case CODE_TYPE:
|
|
|
|
Code::cast(this)->CodePrint(out);
|
|
|
|
break;
|
2011-05-13 10:58:25 +00:00
|
|
|
case JS_PROXY_TYPE:
|
|
|
|
JSProxy::cast(this)->JSProxyPrint(out);
|
|
|
|
break;
|
2011-09-13 11:42:57 +00:00
|
|
|
case JS_FUNCTION_PROXY_TYPE:
|
|
|
|
JSFunctionProxy::cast(this)->JSFunctionProxyPrint(out);
|
|
|
|
break;
|
2013-08-01 08:36:21 +00:00
|
|
|
case JS_SET_TYPE:
|
|
|
|
JSSet::cast(this)->JSSetPrint(out);
|
|
|
|
break;
|
|
|
|
case JS_MAP_TYPE:
|
|
|
|
JSMap::cast(this)->JSMapPrint(out);
|
|
|
|
break;
|
2011-08-03 11:55:13 +00:00
|
|
|
case JS_WEAK_MAP_TYPE:
|
|
|
|
JSWeakMap::cast(this)->JSWeakMapPrint(out);
|
|
|
|
break;
|
2013-07-22 08:32:24 +00:00
|
|
|
case JS_WEAK_SET_TYPE:
|
|
|
|
JSWeakSet::cast(this)->JSWeakSetPrint(out);
|
|
|
|
break;
|
2011-05-19 11:47:34 +00:00
|
|
|
case FOREIGN_TYPE:
|
|
|
|
Foreign::cast(this)->ForeignPrint(out);
|
2010-12-22 13:04:47 +00:00
|
|
|
break;
|
|
|
|
case SHARED_FUNCTION_INFO_TYPE:
|
|
|
|
SharedFunctionInfo::cast(this)->SharedFunctionInfoPrint(out);
|
|
|
|
break;
|
2011-02-02 13:31:52 +00:00
|
|
|
case JS_MESSAGE_OBJECT_TYPE:
|
|
|
|
JSMessageObject::cast(this)->JSMessageObjectPrint(out);
|
|
|
|
break;
|
2013-06-12 15:03:44 +00:00
|
|
|
case CELL_TYPE:
|
|
|
|
Cell::cast(this)->CellPrint(out);
|
|
|
|
break;
|
|
|
|
case PROPERTY_CELL_TYPE:
|
2013-06-14 16:06:12 +00:00
|
|
|
PropertyCell::cast(this)->PropertyCellPrint(out);
|
2010-12-22 13:04:47 +00:00
|
|
|
break;
|
2013-03-28 12:50:18 +00:00
|
|
|
case JS_ARRAY_BUFFER_TYPE:
|
|
|
|
JSArrayBuffer::cast(this)->JSArrayBufferPrint(out);
|
2013-04-18 12:46:38 +00:00
|
|
|
break;
|
2013-04-16 14:16:30 +00:00
|
|
|
case JS_TYPED_ARRAY_TYPE:
|
|
|
|
JSTypedArray::cast(this)->JSTypedArrayPrint(out);
|
2013-04-18 12:46:38 +00:00
|
|
|
break;
|
2013-06-21 13:02:38 +00:00
|
|
|
case JS_DATA_VIEW_TYPE:
|
|
|
|
JSDataView::cast(this)->JSDataViewPrint(out);
|
|
|
|
break;
|
2010-12-22 13:04:47 +00:00
|
|
|
#define MAKE_STRUCT_CASE(NAME, Name, name) \
|
|
|
|
case NAME##_TYPE: \
|
|
|
|
Name::cast(this)->Name##Print(out); \
|
|
|
|
break;
|
|
|
|
STRUCT_LIST(MAKE_STRUCT_CASE)
|
|
|
|
#undef MAKE_STRUCT_CASE
|
|
|
|
|
|
|
|
default:
|
|
|
|
PrintF(out, "UNKNOWN TYPE %d", map()->instance_type());
|
|
|
|
UNREACHABLE();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ByteArray::ByteArrayPrint(FILE* out) {
|
|
|
|
PrintF(out, "byte array, data starts at %p", GetDataStartAddress());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-09-19 18:36:47 +00:00
|
|
|
void FreeSpace::FreeSpacePrint(FILE* out) {
|
|
|
|
PrintF(out, "free space, size %d", Size());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-03-09 15:01:16 +00:00
|
|
|
void ExternalPixelArray::ExternalPixelArrayPrint(FILE* out) {
|
|
|
|
PrintF(out, "external pixel array");
|
2010-12-22 13:04:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ExternalByteArray::ExternalByteArrayPrint(FILE* out) {
|
|
|
|
PrintF(out, "external byte array");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ExternalUnsignedByteArray::ExternalUnsignedByteArrayPrint(FILE* out) {
|
|
|
|
PrintF(out, "external unsigned byte array");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ExternalShortArray::ExternalShortArrayPrint(FILE* out) {
|
|
|
|
PrintF(out, "external short array");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ExternalUnsignedShortArray::ExternalUnsignedShortArrayPrint(FILE* out) {
|
|
|
|
PrintF(out, "external unsigned short array");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ExternalIntArray::ExternalIntArrayPrint(FILE* out) {
|
|
|
|
PrintF(out, "external int array");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ExternalUnsignedIntArray::ExternalUnsignedIntArrayPrint(FILE* out) {
|
|
|
|
PrintF(out, "external unsigned int array");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ExternalFloatArray::ExternalFloatArrayPrint(FILE* out) {
|
|
|
|
PrintF(out, "external float array");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-04-21 07:15:43 +00:00
|
|
|
void ExternalDoubleArray::ExternalDoubleArrayPrint(FILE* out) {
|
|
|
|
PrintF(out, "external double array");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-12-22 13:04:47 +00:00
|
|
|
void JSObject::PrintProperties(FILE* out) {
|
|
|
|
if (HasFastProperties()) {
|
|
|
|
DescriptorArray* descs = map()->instance_descriptors();
|
2012-10-10 12:31:50 +00:00
|
|
|
for (int i = 0; i < map()->NumberOfOwnDescriptors(); i++) {
|
2010-12-22 13:04:47 +00:00
|
|
|
PrintF(out, " ");
|
2013-03-04 15:00:57 +00:00
|
|
|
descs->GetKey(i)->NamePrint(out);
|
2010-12-22 13:04:47 +00:00
|
|
|
PrintF(out, ": ");
|
|
|
|
switch (descs->GetType(i)) {
|
|
|
|
case FIELD: {
|
|
|
|
int index = descs->GetFieldIndex(i);
|
2013-05-08 15:02:08 +00:00
|
|
|
RawFastPropertyAt(index)->ShortPrint(out);
|
2010-12-22 13:04:47 +00:00
|
|
|
PrintF(out, " (field at offset %d)\n", index);
|
|
|
|
break;
|
|
|
|
}
|
2013-07-24 12:34:50 +00:00
|
|
|
case CONSTANT:
|
|
|
|
descs->GetConstant(i)->ShortPrint(out);
|
|
|
|
PrintF(out, " (constant)\n");
|
2010-12-22 13:04:47 +00:00
|
|
|
break;
|
|
|
|
case CALLBACKS:
|
|
|
|
descs->GetCallbacksObject(i)->ShortPrint(out);
|
|
|
|
PrintF(out, " (callback)\n");
|
|
|
|
break;
|
2011-11-08 08:42:13 +00:00
|
|
|
case NORMAL: // only in slow mode
|
|
|
|
case HANDLER: // only in lookup results, not in descriptors
|
|
|
|
case INTERCEPTOR: // only in lookup results, not in descriptors
|
2012-07-05 13:54:20 +00:00
|
|
|
// There are no transitions in the descriptor array.
|
|
|
|
case TRANSITION:
|
2012-06-25 13:10:54 +00:00
|
|
|
case NONEXISTENT:
|
2010-12-22 13:04:47 +00:00
|
|
|
UNREACHABLE();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
property_dictionary()->Print(out);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void JSObject::PrintElements(FILE* out) {
|
2011-09-22 11:30:04 +00:00
|
|
|
// Don't call GetElementsKind, its validation code can cause the printer to
|
|
|
|
// fail when debugging.
|
|
|
|
switch (map()->elements_kind()) {
|
2012-05-23 14:24:29 +00:00
|
|
|
case FAST_HOLEY_SMI_ELEMENTS:
|
|
|
|
case FAST_SMI_ELEMENTS:
|
|
|
|
case FAST_HOLEY_ELEMENTS:
|
2010-12-22 13:04:47 +00:00
|
|
|
case FAST_ELEMENTS: {
|
|
|
|
// Print in array notation for non-sparse arrays.
|
|
|
|
FixedArray* p = FixedArray::cast(elements());
|
|
|
|
for (int i = 0; i < p->length(); i++) {
|
|
|
|
PrintF(out, " %d: ", i);
|
|
|
|
p->get(i)->ShortPrint(out);
|
|
|
|
PrintF(out, "\n");
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2012-05-23 14:24:29 +00:00
|
|
|
case FAST_HOLEY_DOUBLE_ELEMENTS:
|
2011-07-22 09:04:16 +00:00
|
|
|
case FAST_DOUBLE_ELEMENTS: {
|
|
|
|
// Print in array notation for non-sparse arrays.
|
2012-05-09 15:18:50 +00:00
|
|
|
if (elements()->length() > 0) {
|
|
|
|
FixedDoubleArray* p = FixedDoubleArray::cast(elements());
|
|
|
|
for (int i = 0; i < p->length(); i++) {
|
|
|
|
if (p->is_the_hole(i)) {
|
|
|
|
PrintF(out, " %d: <the hole>", i);
|
|
|
|
} else {
|
|
|
|
PrintF(out, " %d: %g", i, p->get_scalar(i));
|
|
|
|
}
|
|
|
|
PrintF(out, "\n");
|
2011-07-22 09:04:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2011-03-09 15:01:16 +00:00
|
|
|
case EXTERNAL_PIXEL_ELEMENTS: {
|
|
|
|
ExternalPixelArray* p = ExternalPixelArray::cast(elements());
|
2010-12-22 13:04:47 +00:00
|
|
|
for (int i = 0; i < p->length(); i++) {
|
2011-08-03 11:12:46 +00:00
|
|
|
PrintF(out, " %d: %d\n", i, p->get_scalar(i));
|
2010-12-22 13:04:47 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EXTERNAL_BYTE_ELEMENTS: {
|
|
|
|
ExternalByteArray* p = ExternalByteArray::cast(elements());
|
|
|
|
for (int i = 0; i < p->length(); i++) {
|
2011-08-03 11:12:46 +00:00
|
|
|
PrintF(out, " %d: %d\n", i, static_cast<int>(p->get_scalar(i)));
|
2010-12-22 13:04:47 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EXTERNAL_UNSIGNED_BYTE_ELEMENTS: {
|
|
|
|
ExternalUnsignedByteArray* p =
|
|
|
|
ExternalUnsignedByteArray::cast(elements());
|
|
|
|
for (int i = 0; i < p->length(); i++) {
|
2011-08-03 11:12:46 +00:00
|
|
|
PrintF(out, " %d: %d\n", i, static_cast<int>(p->get_scalar(i)));
|
2010-12-22 13:04:47 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EXTERNAL_SHORT_ELEMENTS: {
|
|
|
|
ExternalShortArray* p = ExternalShortArray::cast(elements());
|
|
|
|
for (int i = 0; i < p->length(); i++) {
|
2011-08-03 11:12:46 +00:00
|
|
|
PrintF(out, " %d: %d\n", i, static_cast<int>(p->get_scalar(i)));
|
2010-12-22 13:04:47 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EXTERNAL_UNSIGNED_SHORT_ELEMENTS: {
|
|
|
|
ExternalUnsignedShortArray* p =
|
|
|
|
ExternalUnsignedShortArray::cast(elements());
|
|
|
|
for (int i = 0; i < p->length(); i++) {
|
2011-08-03 11:12:46 +00:00
|
|
|
PrintF(out, " %d: %d\n", i, static_cast<int>(p->get_scalar(i)));
|
2010-12-22 13:04:47 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EXTERNAL_INT_ELEMENTS: {
|
|
|
|
ExternalIntArray* p = ExternalIntArray::cast(elements());
|
|
|
|
for (int i = 0; i < p->length(); i++) {
|
2011-08-03 11:12:46 +00:00
|
|
|
PrintF(out, " %d: %d\n", i, static_cast<int>(p->get_scalar(i)));
|
2010-12-22 13:04:47 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EXTERNAL_UNSIGNED_INT_ELEMENTS: {
|
|
|
|
ExternalUnsignedIntArray* p =
|
|
|
|
ExternalUnsignedIntArray::cast(elements());
|
|
|
|
for (int i = 0; i < p->length(); i++) {
|
2011-08-03 11:12:46 +00:00
|
|
|
PrintF(out, " %d: %d\n", i, static_cast<int>(p->get_scalar(i)));
|
2010-12-22 13:04:47 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case EXTERNAL_FLOAT_ELEMENTS: {
|
|
|
|
ExternalFloatArray* p = ExternalFloatArray::cast(elements());
|
|
|
|
for (int i = 0; i < p->length(); i++) {
|
2011-08-03 11:12:46 +00:00
|
|
|
PrintF(out, " %d: %f\n", i, p->get_scalar(i));
|
2010-12-22 13:04:47 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2011-04-21 07:15:43 +00:00
|
|
|
case EXTERNAL_DOUBLE_ELEMENTS: {
|
|
|
|
ExternalDoubleArray* p = ExternalDoubleArray::cast(elements());
|
|
|
|
for (int i = 0; i < p->length(); i++) {
|
2012-11-28 15:11:38 +00:00
|
|
|
PrintF(out, " %d: %f\n", i, p->get_scalar(i));
|
2011-04-21 07:15:43 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2010-12-22 13:04:47 +00:00
|
|
|
case DICTIONARY_ELEMENTS:
|
|
|
|
elements()->Print(out);
|
|
|
|
break;
|
2011-06-16 14:12:58 +00:00
|
|
|
case NON_STRICT_ARGUMENTS_ELEMENTS: {
|
|
|
|
FixedArray* p = FixedArray::cast(elements());
|
2012-11-28 15:11:38 +00:00
|
|
|
PrintF(out, " parameter map:");
|
2011-06-16 14:12:58 +00:00
|
|
|
for (int i = 2; i < p->length(); i++) {
|
2012-11-28 15:11:38 +00:00
|
|
|
PrintF(out, " %d:", i - 2);
|
2011-06-16 14:12:58 +00:00
|
|
|
p->get(i)->ShortPrint(out);
|
|
|
|
}
|
2012-11-28 15:11:38 +00:00
|
|
|
PrintF(out, "\n context: ");
|
|
|
|
p->get(0)->ShortPrint(out);
|
|
|
|
PrintF(out, "\n arguments: ");
|
|
|
|
p->get(1)->ShortPrint(out);
|
|
|
|
PrintF(out, "\n");
|
2011-06-16 14:12:58 +00:00
|
|
|
break;
|
|
|
|
}
|
2010-12-22 13:04:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-07-05 13:54:20 +00:00
|
|
|
void JSObject::PrintTransitions(FILE* out) {
|
|
|
|
if (!map()->HasTransitionArray()) return;
|
|
|
|
TransitionArray* transitions = map()->transitions();
|
|
|
|
for (int i = 0; i < transitions->number_of_transitions(); i++) {
|
|
|
|
PrintF(out, " ");
|
2013-03-04 15:00:57 +00:00
|
|
|
transitions->GetKey(i)->NamePrint(out);
|
2012-07-05 13:54:20 +00:00
|
|
|
PrintF(out, ": ");
|
|
|
|
switch (transitions->GetTargetDetails(i).type()) {
|
|
|
|
case FIELD: {
|
|
|
|
PrintF(out, " (transition to field)\n");
|
|
|
|
break;
|
|
|
|
}
|
2013-07-24 12:34:50 +00:00
|
|
|
case CONSTANT:
|
|
|
|
PrintF(out, " (transition to constant)\n");
|
2012-07-05 13:54:20 +00:00
|
|
|
break;
|
|
|
|
case CALLBACKS:
|
|
|
|
PrintF(out, " (transition to callback)\n");
|
|
|
|
break;
|
|
|
|
// Values below are never in the target descriptor array.
|
|
|
|
case NORMAL:
|
|
|
|
case HANDLER:
|
|
|
|
case INTERCEPTOR:
|
|
|
|
case TRANSITION:
|
|
|
|
case NONEXISTENT:
|
|
|
|
UNREACHABLE();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-12-22 13:04:47 +00:00
|
|
|
void JSObject::JSObjectPrint(FILE* out) {
|
|
|
|
PrintF(out, "%p: [JSObject]\n", reinterpret_cast<void*>(this));
|
2011-09-22 11:30:04 +00:00
|
|
|
PrintF(out, " - map = %p [", reinterpret_cast<void*>(map()));
|
|
|
|
// Don't call GetElementsKind, its validation code can cause the printer to
|
|
|
|
// fail when debugging.
|
|
|
|
PrintElementsKind(out, this->map()->elements_kind());
|
|
|
|
PrintF(out,
|
|
|
|
"]\n - prototype = %p\n",
|
|
|
|
reinterpret_cast<void*>(GetPrototype()));
|
2010-12-22 13:04:47 +00:00
|
|
|
PrintF(out, " {\n");
|
|
|
|
PrintProperties(out);
|
2012-07-05 13:54:20 +00:00
|
|
|
PrintTransitions(out);
|
2010-12-22 13:04:47 +00:00
|
|
|
PrintElements(out);
|
|
|
|
PrintF(out, " }\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-04-16 14:43:27 +00:00
|
|
|
void JSModule::JSModulePrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "JSModule");
|
2013-08-01 08:36:21 +00:00
|
|
|
PrintF(out, " - map = %p\n", reinterpret_cast<void*>(map()));
|
2012-04-16 14:43:27 +00:00
|
|
|
PrintF(out, " - context = ");
|
|
|
|
context()->Print(out);
|
2012-07-09 08:59:03 +00:00
|
|
|
PrintF(out, " - scope_info = ");
|
|
|
|
scope_info()->ShortPrint(out);
|
2012-04-16 14:43:27 +00:00
|
|
|
PrintElementsKind(out, this->map()->elements_kind());
|
|
|
|
PrintF(out, " {\n");
|
|
|
|
PrintProperties(out);
|
|
|
|
PrintElements(out);
|
|
|
|
PrintF(out, " }\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-12-22 13:04:47 +00:00
|
|
|
static const char* TypeToString(InstanceType type) {
|
|
|
|
switch (type) {
|
2013-08-09 08:22:46 +00:00
|
|
|
#define TYPE_TO_STRING(TYPE) case TYPE: return #TYPE;
|
|
|
|
INSTANCE_TYPE_LIST(TYPE_TO_STRING)
|
|
|
|
#undef TYPE_TO_STRING
|
2010-12-22 13:04:47 +00:00
|
|
|
}
|
2013-08-09 08:22:46 +00:00
|
|
|
UNREACHABLE();
|
|
|
|
return "UNKNOWN"; // Keep the compiler happy.
|
2010-12-22 13:04:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-03-01 10:34:31 +00:00
|
|
|
void Symbol::SymbolPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "Symbol");
|
|
|
|
PrintF(out, " - hash: %d\n", Hash());
|
2013-03-22 16:51:28 +00:00
|
|
|
PrintF(out, " - name: ");
|
|
|
|
name()->ShortPrint();
|
Provide private symbols through internal APIs
Adds a notion of private symbols, mainly intended for internal use, especially, self-hosting of built-in types that would otherwise require new C++ classes.
On the JS side (i.e., in built-ins), private properties can be created and accessed through a set of macros:
NEW_PRIVATE(print_name)
HAS_PRIVATE(obj, sym)
GET_PRIVATE(obj, sym)
SET_PRIVATE(obj, sym, val)
DELETE_PRIVATE(obj, sym)
In the V8 API, they are accessible via a new class Private, and respective HasPrivate/Get/Private/SetPrivate/DeletePrivate methods on calss Object.
These APIs are designed and restricted such that their implementation can later be replaced by whatever ES7+ will officially provide.
R=yangguo@chromium.org
BUG=
Review URL: https://codereview.chromium.org/48923002
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17683 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-11-13 10:34:06 +00:00
|
|
|
PrintF(out, " - private: %d\n", is_private());
|
2013-03-22 16:51:28 +00:00
|
|
|
PrintF(out, "\n");
|
2013-03-01 10:34:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-12-22 13:04:47 +00:00
|
|
|
void Map::MapPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "Map");
|
|
|
|
PrintF(out, " - type: %s\n", TypeToString(instance_type()));
|
|
|
|
PrintF(out, " - instance size: %d\n", instance_size());
|
|
|
|
PrintF(out, " - inobject properties: %d\n", inobject_properties());
|
2011-09-23 09:11:56 +00:00
|
|
|
PrintF(out, " - elements kind: ");
|
|
|
|
PrintElementsKind(out, elements_kind());
|
|
|
|
PrintF(out, "\n - pre-allocated property fields: %d\n",
|
2010-12-22 13:04:47 +00:00
|
|
|
pre_allocated_property_fields());
|
|
|
|
PrintF(out, " - unused property fields: %d\n", unused_property_fields());
|
|
|
|
if (is_hidden_prototype()) {
|
|
|
|
PrintF(out, " - hidden_prototype\n");
|
|
|
|
}
|
|
|
|
if (has_named_interceptor()) {
|
|
|
|
PrintF(out, " - named_interceptor\n");
|
|
|
|
}
|
|
|
|
if (has_indexed_interceptor()) {
|
|
|
|
PrintF(out, " - indexed_interceptor\n");
|
|
|
|
}
|
|
|
|
if (is_undetectable()) {
|
|
|
|
PrintF(out, " - undetectable\n");
|
|
|
|
}
|
|
|
|
if (has_instance_call_handler()) {
|
|
|
|
PrintF(out, " - instance_call_handler\n");
|
|
|
|
}
|
|
|
|
if (is_access_check_needed()) {
|
|
|
|
PrintF(out, " - access_check_needed\n");
|
|
|
|
}
|
2012-10-10 12:29:44 +00:00
|
|
|
PrintF(out, " - back pointer: ");
|
|
|
|
GetBackPointer()->ShortPrint(out);
|
2013-05-15 14:03:42 +00:00
|
|
|
PrintF(out, "\n - instance descriptors %s#%i: ",
|
|
|
|
owns_descriptors() ? "(own) " : "",
|
2012-10-17 13:04:49 +00:00
|
|
|
NumberOfOwnDescriptors());
|
2010-12-22 13:04:47 +00:00
|
|
|
instance_descriptors()->ShortPrint(out);
|
2012-07-05 13:54:20 +00:00
|
|
|
if (HasTransitionArray()) {
|
|
|
|
PrintF(out, "\n - transitions: ");
|
|
|
|
transitions()->ShortPrint(out);
|
|
|
|
}
|
2010-12-22 13:04:47 +00:00
|
|
|
PrintF(out, "\n - prototype: ");
|
|
|
|
prototype()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - constructor: ");
|
|
|
|
constructor()->ShortPrint(out);
|
2012-06-08 13:06:24 +00:00
|
|
|
PrintF(out, "\n - code cache: ");
|
|
|
|
code_cache()->ShortPrint(out);
|
2013-03-06 14:55:59 +00:00
|
|
|
PrintF(out, "\n - dependent code: ");
|
|
|
|
dependent_code()->ShortPrint(out);
|
2010-12-22 13:04:47 +00:00
|
|
|
PrintF(out, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CodeCache::CodeCachePrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "CodeCache");
|
|
|
|
PrintF(out, "\n - default_cache: ");
|
|
|
|
default_cache()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - normal_type_cache: ");
|
|
|
|
normal_type_cache()->ShortPrint(out);
|
2011-06-06 13:15:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void PolymorphicCodeCache::PolymorphicCodeCachePrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "PolymorphicCodeCache");
|
|
|
|
PrintF(out, "\n - cache: ");
|
|
|
|
cache()->ShortPrint(out);
|
2010-12-22 13:04:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-02-20 12:57:23 +00:00
|
|
|
void TypeFeedbackInfo::TypeFeedbackInfoPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "TypeFeedbackInfo");
|
2012-07-27 12:06:26 +00:00
|
|
|
PrintF(out, " - ic_total_count: %d, ic_with_type_info_count: %d\n",
|
2012-03-27 12:19:50 +00:00
|
|
|
ic_total_count(), ic_with_type_info_count());
|
2012-07-27 12:06:26 +00:00
|
|
|
PrintF(out, " - type_feedback_cells: ");
|
2012-02-20 12:57:23 +00:00
|
|
|
type_feedback_cells()->FixedArrayPrint(out);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-02-24 14:34:01 +00:00
|
|
|
void AliasedArgumentsEntry::AliasedArgumentsEntryPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "AliasedArgumentsEntry");
|
|
|
|
PrintF(out, "\n - aliased_context_slot: %d", aliased_context_slot());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-12-22 13:04:47 +00:00
|
|
|
void FixedArray::FixedArrayPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "FixedArray");
|
|
|
|
PrintF(out, " - length: %d", length());
|
|
|
|
for (int i = 0; i < length(); i++) {
|
|
|
|
PrintF(out, "\n [%d]: ", i);
|
|
|
|
get(i)->ShortPrint(out);
|
|
|
|
}
|
|
|
|
PrintF(out, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-09-22 11:30:04 +00:00
|
|
|
void FixedDoubleArray::FixedDoubleArrayPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "FixedDoubleArray");
|
|
|
|
PrintF(out, " - length: %d", length());
|
|
|
|
for (int i = 0; i < length(); i++) {
|
2012-02-02 11:22:26 +00:00
|
|
|
if (is_the_hole(i)) {
|
|
|
|
PrintF(out, "\n [%d]: <the hole>", i);
|
|
|
|
} else {
|
|
|
|
PrintF(out, "\n [%d]: %g", i, get_scalar(i));
|
|
|
|
}
|
2011-09-22 11:30:04 +00:00
|
|
|
}
|
|
|
|
PrintF(out, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-10-14 13:35:06 +00:00
|
|
|
void ConstantPoolArray::ConstantPoolArrayPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "ConstantPoolArray");
|
|
|
|
PrintF(out, " - length: %d", length());
|
|
|
|
for (int i = 0; i < length(); i++) {
|
|
|
|
if (i < first_ptr_index()) {
|
|
|
|
PrintF(out, "\n [%d]: double: %g", i, get_int64_entry_as_double(i));
|
|
|
|
} else if (i < first_int32_index()) {
|
|
|
|
PrintF(out, "\n [%d]: pointer: %p", i,
|
|
|
|
reinterpret_cast<void*>(get_ptr_entry(i)));
|
|
|
|
} else {
|
|
|
|
PrintF(out, "\n [%d]: int32: %d", i, get_int32_entry(i));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
PrintF(out, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-12-22 13:04:47 +00:00
|
|
|
void JSValue::JSValuePrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "ValueObject");
|
|
|
|
value()->Print(out);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-02-02 13:31:52 +00:00
|
|
|
void JSMessageObject::JSMessageObjectPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "JSMessageObject");
|
|
|
|
PrintF(out, " - type: ");
|
|
|
|
type()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - arguments: ");
|
|
|
|
arguments()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - start_position: %d", start_position());
|
|
|
|
PrintF(out, "\n - end_position: %d", end_position());
|
|
|
|
PrintF(out, "\n - script: ");
|
|
|
|
script()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - stack_trace: ");
|
|
|
|
stack_trace()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - stack_frames: ");
|
|
|
|
stack_frames()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-12-22 13:04:47 +00:00
|
|
|
void String::StringPrint(FILE* out) {
|
2013-02-28 17:03:34 +00:00
|
|
|
if (StringShape(this).IsInternalized()) {
|
2010-12-22 13:04:47 +00:00
|
|
|
PrintF(out, "#");
|
|
|
|
} else if (StringShape(this).IsCons()) {
|
|
|
|
PrintF(out, "c\"");
|
|
|
|
} else {
|
|
|
|
PrintF(out, "\"");
|
|
|
|
}
|
|
|
|
|
|
|
|
const char truncated_epilogue[] = "...<truncated>";
|
|
|
|
int len = length();
|
|
|
|
if (!FLAG_use_verbose_printer) {
|
|
|
|
if (len > 100) {
|
|
|
|
len = 100 - sizeof(truncated_epilogue);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (int i = 0; i < len; i++) {
|
|
|
|
PrintF(out, "%c", Get(i));
|
|
|
|
}
|
|
|
|
if (len != length()) {
|
|
|
|
PrintF(out, "%s", truncated_epilogue);
|
|
|
|
}
|
|
|
|
|
2013-02-28 17:03:34 +00:00
|
|
|
if (!StringShape(this).IsInternalized()) PrintF(out, "\"");
|
2010-12-22 13:04:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-03-04 15:00:57 +00:00
|
|
|
void Name::NamePrint(FILE* out) {
|
|
|
|
if (IsString())
|
|
|
|
String::cast(this)->StringPrint(out);
|
|
|
|
else
|
|
|
|
ShortPrint();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-07-29 09:49:40 +00:00
|
|
|
// This method is only meant to be called from gdb for debugging purposes.
|
2012-01-16 12:38:59 +00:00
|
|
|
// Since the string can also be in two-byte encoding, non-ASCII characters
|
2011-07-29 09:49:40 +00:00
|
|
|
// will be ignored in the output.
|
|
|
|
char* String::ToAsciiArray() {
|
|
|
|
// Static so that subsequent calls frees previously allocated space.
|
|
|
|
// This also means that previous results will be overwritten.
|
|
|
|
static char* buffer = NULL;
|
|
|
|
if (buffer != NULL) free(buffer);
|
|
|
|
buffer = new char[length()+1];
|
2013-01-09 16:34:45 +00:00
|
|
|
WriteToFlat(this, reinterpret_cast<uint8_t*>(buffer), 0, length());
|
2011-07-29 09:49:40 +00:00
|
|
|
buffer[length()] = 0;
|
|
|
|
return buffer;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-03-09 11:19:55 +00:00
|
|
|
static const char* const weekdays[] = {
|
|
|
|
"???", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
|
|
|
|
};
|
|
|
|
|
2013-07-05 09:52:11 +00:00
|
|
|
|
2012-03-09 11:11:55 +00:00
|
|
|
void JSDate::JSDatePrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "JSDate");
|
2013-08-01 08:36:21 +00:00
|
|
|
PrintF(out, " - map = %p\n", reinterpret_cast<void*>(map()));
|
2012-03-09 11:11:55 +00:00
|
|
|
PrintF(out, " - value = ");
|
|
|
|
value()->Print(out);
|
|
|
|
if (!year()->IsSmi()) {
|
|
|
|
PrintF(out, " - time = NaN\n");
|
|
|
|
} else {
|
2012-03-09 11:19:55 +00:00
|
|
|
PrintF(out, " - time = %s %04d/%02d/%02d %02d:%02d:%02d\n",
|
|
|
|
weekdays[weekday()->IsSmi() ? Smi::cast(weekday())->value() + 1 : 0],
|
|
|
|
year()->IsSmi() ? Smi::cast(year())->value() : -1,
|
|
|
|
month()->IsSmi() ? Smi::cast(month())->value() : -1,
|
|
|
|
day()->IsSmi() ? Smi::cast(day())->value() : -1,
|
|
|
|
hour()->IsSmi() ? Smi::cast(hour())->value() : -1,
|
|
|
|
min()->IsSmi() ? Smi::cast(min())->value() : -1,
|
|
|
|
sec()->IsSmi() ? Smi::cast(sec())->value() : -1);
|
2012-03-09 11:11:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-05-13 10:58:25 +00:00
|
|
|
void JSProxy::JSProxyPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "JSProxy");
|
2013-08-01 08:36:21 +00:00
|
|
|
PrintF(out, " - map = %p\n", reinterpret_cast<void*>(map()));
|
2011-05-13 10:58:25 +00:00
|
|
|
PrintF(out, " - handler = ");
|
|
|
|
handler()->Print(out);
|
2011-09-22 13:54:53 +00:00
|
|
|
PrintF(out, " - hash = ");
|
|
|
|
hash()->Print(out);
|
2011-05-13 10:58:25 +00:00
|
|
|
PrintF(out, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-09-13 11:42:57 +00:00
|
|
|
void JSFunctionProxy::JSFunctionProxyPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "JSFunctionProxy");
|
2013-08-01 08:36:21 +00:00
|
|
|
PrintF(out, " - map = %p\n", reinterpret_cast<void*>(map()));
|
2011-09-13 11:42:57 +00:00
|
|
|
PrintF(out, " - handler = ");
|
|
|
|
handler()->Print(out);
|
|
|
|
PrintF(out, " - call_trap = ");
|
|
|
|
call_trap()->Print(out);
|
|
|
|
PrintF(out, " - construct_trap = ");
|
|
|
|
construct_trap()->Print(out);
|
|
|
|
PrintF(out, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-08-01 08:36:21 +00:00
|
|
|
void JSSet::JSSetPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "JSSet");
|
|
|
|
PrintF(out, " - map = %p\n", reinterpret_cast<void*>(map()));
|
|
|
|
PrintF(out, " - table = ");
|
|
|
|
table()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void JSMap::JSMapPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "JSMap");
|
|
|
|
PrintF(out, " - map = %p\n", reinterpret_cast<void*>(map()));
|
|
|
|
PrintF(out, " - table = ");
|
|
|
|
table()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-08-03 11:55:13 +00:00
|
|
|
void JSWeakMap::JSWeakMapPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "JSWeakMap");
|
2013-08-01 08:36:21 +00:00
|
|
|
PrintF(out, " - map = %p\n", reinterpret_cast<void*>(map()));
|
2011-08-03 11:55:13 +00:00
|
|
|
PrintF(out, " - table = ");
|
|
|
|
table()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-07-22 08:32:24 +00:00
|
|
|
void JSWeakSet::JSWeakSetPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "JSWeakSet");
|
2013-08-01 08:36:21 +00:00
|
|
|
PrintF(out, " - map = %p\n", reinterpret_cast<void*>(map()));
|
2013-07-22 08:32:24 +00:00
|
|
|
PrintF(out, " - table = ");
|
|
|
|
table()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-03-28 12:50:18 +00:00
|
|
|
void JSArrayBuffer::JSArrayBufferPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "JSArrayBuffer");
|
2013-08-01 08:36:21 +00:00
|
|
|
PrintF(out, " - map = %p\n", reinterpret_cast<void*>(map()));
|
|
|
|
PrintF(out, " - backing_store = %p\n", backing_store());
|
2013-03-28 12:50:18 +00:00
|
|
|
PrintF(out, " - byte_length = ");
|
|
|
|
byte_length()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-16 14:16:30 +00:00
|
|
|
void JSTypedArray::JSTypedArrayPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "JSTypedArray");
|
2013-06-21 13:02:38 +00:00
|
|
|
PrintF(out, " - map = %p\n", reinterpret_cast<void*>(map()));
|
2013-04-16 14:16:30 +00:00
|
|
|
PrintF(out, " - buffer =");
|
|
|
|
buffer()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - byte_offset = ");
|
|
|
|
byte_offset()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - byte_length = ");
|
|
|
|
byte_length()->ShortPrint(out);
|
2013-06-06 12:05:22 +00:00
|
|
|
PrintF(out, "\n - length = ");
|
2013-04-16 14:16:30 +00:00
|
|
|
length()->ShortPrint(out);
|
2013-11-07 16:35:27 +00:00
|
|
|
PrintF(out, "\n");
|
2013-04-16 14:16:30 +00:00
|
|
|
PrintElements(out);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-06-21 13:02:38 +00:00
|
|
|
void JSDataView::JSDataViewPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "JSDataView");
|
|
|
|
PrintF(out, " - map = %p\n", reinterpret_cast<void*>(map()));
|
|
|
|
PrintF(out, " - buffer =");
|
|
|
|
buffer()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - byte_offset = ");
|
|
|
|
byte_offset()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - byte_length = ");
|
|
|
|
byte_length()->ShortPrint(out);
|
2013-11-07 16:35:27 +00:00
|
|
|
PrintF(out, "\n");
|
2013-06-21 13:02:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-12-22 13:04:47 +00:00
|
|
|
void JSFunction::JSFunctionPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "Function");
|
2013-08-01 08:36:21 +00:00
|
|
|
PrintF(out, " - map = %p\n", reinterpret_cast<void*>(map()));
|
2010-12-22 13:04:47 +00:00
|
|
|
PrintF(out, " - initial_map = ");
|
|
|
|
if (has_initial_map()) {
|
|
|
|
initial_map()->ShortPrint(out);
|
|
|
|
}
|
|
|
|
PrintF(out, "\n - shared_info = ");
|
|
|
|
shared()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - name = ");
|
|
|
|
shared()->name()->Print(out);
|
|
|
|
PrintF(out, "\n - context = ");
|
2013-06-26 14:04:25 +00:00
|
|
|
context()->ShortPrint(out);
|
2012-06-27 11:49:37 +00:00
|
|
|
PrintF(out, "\n - literals = ");
|
|
|
|
literals()->ShortPrint(out);
|
2010-12-22 13:04:47 +00:00
|
|
|
PrintF(out, "\n - code = ");
|
|
|
|
code()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n");
|
|
|
|
|
|
|
|
PrintProperties(out);
|
|
|
|
PrintElements(out);
|
|
|
|
|
|
|
|
PrintF(out, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void SharedFunctionInfo::SharedFunctionInfoPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "SharedFunctionInfo");
|
|
|
|
PrintF(out, " - name: ");
|
|
|
|
name()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - expected_nof_properties: %d", expected_nof_properties());
|
|
|
|
PrintF(out, "\n - instance class name = ");
|
|
|
|
instance_class_name()->Print(out);
|
|
|
|
PrintF(out, "\n - code = ");
|
|
|
|
code()->ShortPrint(out);
|
2012-06-14 15:33:15 +00:00
|
|
|
if (HasSourceCode()) {
|
|
|
|
PrintF(out, "\n - source code = ");
|
2012-07-27 09:54:56 +00:00
|
|
|
String* source = String::cast(Script::cast(script())->source());
|
|
|
|
int start = start_position();
|
|
|
|
int length = end_position() - start;
|
|
|
|
SmartArrayPointer<char> source_string =
|
|
|
|
source->ToCString(DISALLOW_NULLS,
|
|
|
|
FAST_STRING_TRAVERSAL,
|
|
|
|
start, length, NULL);
|
|
|
|
PrintF(out, "%s", *source_string);
|
2012-06-14 15:33:15 +00:00
|
|
|
}
|
2010-12-22 13:04:47 +00:00
|
|
|
// Script files are often large, hard to read.
|
|
|
|
// PrintF(out, "\n - script =");
|
|
|
|
// script()->Print(out);
|
|
|
|
PrintF(out, "\n - function token position = %d", function_token_position());
|
|
|
|
PrintF(out, "\n - start position = %d", start_position());
|
|
|
|
PrintF(out, "\n - end position = %d", end_position());
|
|
|
|
PrintF(out, "\n - is expression = %d", is_expression());
|
|
|
|
PrintF(out, "\n - debug info = ");
|
|
|
|
debug_info()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - length = %d", length());
|
2013-05-22 15:29:02 +00:00
|
|
|
PrintF(out, "\n - optimized_code_map = ");
|
|
|
|
optimized_code_map()->ShortPrint(out);
|
2010-12-22 13:04:47 +00:00
|
|
|
PrintF(out, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void JSGlobalProxy::JSGlobalProxyPrint(FILE* out) {
|
2012-07-30 10:47:04 +00:00
|
|
|
PrintF(out, "global_proxy ");
|
2010-12-22 13:04:47 +00:00
|
|
|
JSObjectPrint(out);
|
2012-08-20 11:35:50 +00:00
|
|
|
PrintF(out, "native context : ");
|
|
|
|
native_context()->ShortPrint(out);
|
2010-12-22 13:04:47 +00:00
|
|
|
PrintF(out, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void JSGlobalObject::JSGlobalObjectPrint(FILE* out) {
|
|
|
|
PrintF(out, "global ");
|
|
|
|
JSObjectPrint(out);
|
2012-08-17 09:03:08 +00:00
|
|
|
PrintF(out, "native context : ");
|
|
|
|
native_context()->ShortPrint(out);
|
2010-12-22 13:04:47 +00:00
|
|
|
PrintF(out, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void JSBuiltinsObject::JSBuiltinsObjectPrint(FILE* out) {
|
|
|
|
PrintF(out, "builtins ");
|
|
|
|
JSObjectPrint(out);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-06-12 15:03:44 +00:00
|
|
|
void Cell::CellPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "Cell");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-06-14 16:06:12 +00:00
|
|
|
void PropertyCell::PropertyCellPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "PropertyCell");
|
2010-12-22 13:04:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Code::CodePrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "Code");
|
|
|
|
#ifdef ENABLE_DISASSEMBLER
|
|
|
|
if (FLAG_use_verbose_printer) {
|
|
|
|
Disassemble(NULL, out);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-05-19 11:47:34 +00:00
|
|
|
void Foreign::ForeignPrint(FILE* out) {
|
2011-10-28 12:37:29 +00:00
|
|
|
PrintF(out, "foreign address : %p", foreign_address());
|
2010-12-22 13:04:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-02-12 14:33:08 +00:00
|
|
|
void ExecutableAccessorInfo::ExecutableAccessorInfoPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "ExecutableAccessorInfo");
|
|
|
|
PrintF(out, "\n - name: ");
|
|
|
|
name()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - flag: ");
|
|
|
|
flag()->ShortPrint(out);
|
2010-12-22 13:04:47 +00:00
|
|
|
PrintF(out, "\n - getter: ");
|
|
|
|
getter()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - setter: ");
|
|
|
|
setter()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - data: ");
|
|
|
|
data()->ShortPrint(out);
|
2013-02-12 14:33:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DeclaredAccessorInfo::DeclaredAccessorInfoPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "DeclaredAccessorInfo");
|
|
|
|
PrintF(out, "\n - name: ");
|
|
|
|
name()->ShortPrint(out);
|
2010-12-22 13:04:47 +00:00
|
|
|
PrintF(out, "\n - flag: ");
|
|
|
|
flag()->ShortPrint(out);
|
2013-02-12 14:33:08 +00:00
|
|
|
PrintF(out, "\n - descriptor: ");
|
|
|
|
descriptor()->ShortPrint(out);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DeclaredAccessorDescriptor::DeclaredAccessorDescriptorPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "DeclaredAccessorDescriptor");
|
|
|
|
PrintF(out, "\n - internal field: ");
|
2013-03-07 11:42:58 +00:00
|
|
|
serialized_data()->ShortPrint(out);
|
2010-12-22 13:04:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-06-06 15:40:28 +00:00
|
|
|
void Box::BoxPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "Box");
|
|
|
|
PrintF(out, "\n - value: ");
|
|
|
|
value()->ShortPrint(out);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-01-10 16:11:33 +00:00
|
|
|
void AccessorPair::AccessorPairPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "AccessorPair");
|
|
|
|
PrintF(out, "\n - getter: ");
|
|
|
|
getter()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - setter: ");
|
|
|
|
setter()->ShortPrint(out);
|
2013-08-26 11:59:14 +00:00
|
|
|
PrintF(out, "\n - flag: ");
|
|
|
|
access_flags()->ShortPrint(out);
|
2012-01-10 16:11:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-12-22 13:04:47 +00:00
|
|
|
void AccessCheckInfo::AccessCheckInfoPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "AccessCheckInfo");
|
|
|
|
PrintF(out, "\n - named_callback: ");
|
|
|
|
named_callback()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - indexed_callback: ");
|
|
|
|
indexed_callback()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - data: ");
|
|
|
|
data()->ShortPrint(out);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void InterceptorInfo::InterceptorInfoPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "InterceptorInfo");
|
|
|
|
PrintF(out, "\n - getter: ");
|
|
|
|
getter()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - setter: ");
|
|
|
|
setter()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - query: ");
|
|
|
|
query()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - deleter: ");
|
|
|
|
deleter()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - enumerator: ");
|
|
|
|
enumerator()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - data: ");
|
|
|
|
data()->ShortPrint(out);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CallHandlerInfo::CallHandlerInfoPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "CallHandlerInfo");
|
|
|
|
PrintF(out, "\n - callback: ");
|
|
|
|
callback()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - data: ");
|
|
|
|
data()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - call_stub_cache: ");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void FunctionTemplateInfo::FunctionTemplateInfoPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "FunctionTemplateInfo");
|
|
|
|
PrintF(out, "\n - class name: ");
|
|
|
|
class_name()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - tag: ");
|
|
|
|
tag()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - property_list: ");
|
|
|
|
property_list()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - serial_number: ");
|
|
|
|
serial_number()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - call_code: ");
|
|
|
|
call_code()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - property_accessors: ");
|
|
|
|
property_accessors()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - prototype_template: ");
|
|
|
|
prototype_template()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - parent_template: ");
|
|
|
|
parent_template()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - named_property_handler: ");
|
|
|
|
named_property_handler()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - indexed_property_handler: ");
|
|
|
|
indexed_property_handler()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - instance_template: ");
|
|
|
|
instance_template()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - signature: ");
|
|
|
|
signature()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - access_check_info: ");
|
|
|
|
access_check_info()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - hidden_prototype: %s",
|
|
|
|
hidden_prototype() ? "true" : "false");
|
|
|
|
PrintF(out, "\n - undetectable: %s", undetectable() ? "true" : "false");
|
|
|
|
PrintF(out, "\n - need_access_check: %s",
|
|
|
|
needs_access_check() ? "true" : "false");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ObjectTemplateInfo::ObjectTemplateInfoPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "ObjectTemplateInfo");
|
2011-09-19 18:36:47 +00:00
|
|
|
PrintF(out, " - tag: ");
|
|
|
|
tag()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - property_list: ");
|
|
|
|
property_list()->ShortPrint(out);
|
2013-09-04 07:45:36 +00:00
|
|
|
PrintF(out, "\n - property_accessors: ");
|
|
|
|
property_accessors()->ShortPrint(out);
|
2010-12-22 13:04:47 +00:00
|
|
|
PrintF(out, "\n - constructor: ");
|
|
|
|
constructor()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - internal_field_count: ");
|
|
|
|
internal_field_count()->ShortPrint(out);
|
2011-09-19 18:36:47 +00:00
|
|
|
PrintF(out, "\n");
|
2010-12-22 13:04:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void SignatureInfo::SignatureInfoPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "SignatureInfo");
|
|
|
|
PrintF(out, "\n - receiver: ");
|
|
|
|
receiver()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - args: ");
|
|
|
|
args()->ShortPrint(out);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void TypeSwitchInfo::TypeSwitchInfoPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "TypeSwitchInfo");
|
|
|
|
PrintF(out, "\n - types: ");
|
|
|
|
types()->ShortPrint(out);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-07-08 10:02:16 +00:00
|
|
|
void AllocationSite::AllocationSitePrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "AllocationSite");
|
2013-07-17 11:50:24 +00:00
|
|
|
PrintF(out, " - weak_next: ");
|
|
|
|
weak_next()->ShortPrint(out);
|
2013-09-19 14:13:34 +00:00
|
|
|
PrintF(out, "\n - dependent code: ");
|
|
|
|
dependent_code()->ShortPrint(out);
|
2013-09-24 10:30:41 +00:00
|
|
|
PrintF(out, "\n - nested site: ");
|
|
|
|
nested_site()->ShortPrint(out);
|
2013-09-19 14:13:34 +00:00
|
|
|
PrintF(out, "\n - transition_info: ");
|
2013-07-08 15:00:12 +00:00
|
|
|
if (transition_info()->IsCell()) {
|
|
|
|
Cell* cell = Cell::cast(transition_info());
|
2013-03-01 16:06:34 +00:00
|
|
|
Object* cell_contents = cell->value();
|
|
|
|
if (cell_contents->IsSmi()) {
|
|
|
|
ElementsKind kind = static_cast<ElementsKind>(
|
|
|
|
Smi::cast(cell_contents)->value());
|
|
|
|
PrintF(out, "Array allocation with ElementsKind ");
|
|
|
|
PrintElementsKind(out, kind);
|
|
|
|
PrintF(out, "\n");
|
|
|
|
return;
|
|
|
|
}
|
2013-07-08 15:00:12 +00:00
|
|
|
} else if (transition_info()->IsJSArray()) {
|
2013-01-08 09:03:16 +00:00
|
|
|
PrintF(out, "Array literal ");
|
2013-07-08 15:00:12 +00:00
|
|
|
transition_info()->ShortPrint(out);
|
2013-01-08 09:03:16 +00:00
|
|
|
PrintF(out, "\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-07-08 15:00:12 +00:00
|
|
|
PrintF(out, "unknown transition_info");
|
|
|
|
transition_info()->ShortPrint(out);
|
2013-01-08 09:03:16 +00:00
|
|
|
PrintF(out, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-07-19 13:30:49 +00:00
|
|
|
void AllocationMemento::AllocationMementoPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "AllocationMemento");
|
2013-07-08 10:02:16 +00:00
|
|
|
PrintF(out, " - allocation site: ");
|
|
|
|
if (IsValid()) {
|
|
|
|
GetAllocationSite()->Print();
|
|
|
|
} else {
|
|
|
|
PrintF(out, "<invalid>\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-12-22 13:04:47 +00:00
|
|
|
void Script::ScriptPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "Script");
|
|
|
|
PrintF(out, "\n - source: ");
|
|
|
|
source()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - name: ");
|
|
|
|
name()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - line_offset: ");
|
|
|
|
line_offset()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - column_offset: ");
|
|
|
|
column_offset()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - type: ");
|
|
|
|
type()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - id: ");
|
|
|
|
id()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - data: ");
|
|
|
|
data()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - context data: ");
|
|
|
|
context_data()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - wrapper: ");
|
|
|
|
wrapper()->ShortPrint(out);
|
2013-07-30 17:00:05 +00:00
|
|
|
PrintF(out, "\n - compilation type: %d", compilation_type());
|
2010-12-22 13:04:47 +00:00
|
|
|
PrintF(out, "\n - line ends: ");
|
|
|
|
line_ends()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - eval from shared: ");
|
|
|
|
eval_from_shared()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - eval from instructions offset: ");
|
|
|
|
eval_from_instructions_offset()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef ENABLE_DEBUGGER_SUPPORT
|
|
|
|
void DebugInfo::DebugInfoPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "DebugInfo");
|
|
|
|
PrintF(out, "\n - shared: ");
|
|
|
|
shared()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - original_code: ");
|
|
|
|
original_code()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - code: ");
|
|
|
|
code()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - break_points: ");
|
|
|
|
break_points()->Print(out);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void BreakPointInfo::BreakPointInfoPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "BreakPointInfo");
|
|
|
|
PrintF(out, "\n - code_position: %d", code_position()->value());
|
|
|
|
PrintF(out, "\n - source_position: %d", source_position()->value());
|
|
|
|
PrintF(out, "\n - statement_position: %d", statement_position()->value());
|
|
|
|
PrintF(out, "\n - break_point_objects: ");
|
|
|
|
break_point_objects()->ShortPrint(out);
|
|
|
|
}
|
|
|
|
#endif // ENABLE_DEBUGGER_SUPPORT
|
|
|
|
|
|
|
|
|
|
|
|
void DescriptorArray::PrintDescriptors(FILE* out) {
|
|
|
|
PrintF(out, "Descriptor array %d\n", number_of_descriptors());
|
|
|
|
for (int i = 0; i < number_of_descriptors(); i++) {
|
|
|
|
PrintF(out, " %d: ", i);
|
|
|
|
Descriptor desc;
|
|
|
|
Get(i, &desc);
|
|
|
|
desc.Print(out);
|
|
|
|
}
|
|
|
|
PrintF(out, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-07-05 13:54:20 +00:00
|
|
|
void TransitionArray::PrintTransitions(FILE* out) {
|
|
|
|
PrintF(out, "Transition array %d\n", number_of_transitions());
|
|
|
|
for (int i = 0; i < number_of_transitions(); i++) {
|
|
|
|
PrintF(out, " %d: ", i);
|
2013-03-04 15:00:57 +00:00
|
|
|
GetKey(i)->NamePrint(out);
|
2012-07-05 13:54:20 +00:00
|
|
|
PrintF(out, ": ");
|
|
|
|
switch (GetTargetDetails(i).type()) {
|
|
|
|
case FIELD: {
|
|
|
|
PrintF(out, " (transition to field)\n");
|
|
|
|
break;
|
|
|
|
}
|
2013-07-24 12:34:50 +00:00
|
|
|
case CONSTANT:
|
|
|
|
PrintF(out, " (transition to constant)\n");
|
2012-07-05 13:54:20 +00:00
|
|
|
break;
|
|
|
|
case CALLBACKS:
|
|
|
|
PrintF(out, " (transition to callback)\n");
|
|
|
|
break;
|
|
|
|
// Values below are never in the target descriptor array.
|
|
|
|
case NORMAL:
|
|
|
|
case HANDLER:
|
|
|
|
case INTERCEPTOR:
|
|
|
|
case TRANSITION:
|
|
|
|
case NONEXISTENT:
|
|
|
|
UNREACHABLE();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
PrintF(out, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-12-22 13:04:47 +00:00
|
|
|
#endif // OBJECT_PRINT
|
|
|
|
|
|
|
|
|
|
|
|
} } // namespace v8::internal
|