2014-04-24 11:44:22 +00:00
|
|
|
// Copyright 2012 the V8 project authors. All rights reserved.
|
2014-04-29 06:42:26 +00:00
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
2014-04-24 11:44:22 +00:00
|
|
|
|
|
|
|
#include "v8.h"
|
2010-12-22 13:04:47 +00:00
|
|
|
|
|
|
|
#include "disassembler.h"
|
2014-04-24 11:44:22 +00:00
|
|
|
#include "disasm.h"
|
2010-12-22 13:04:47 +00:00
|
|
|
#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;
|
2014-01-24 16:01:15 +00:00
|
|
|
|
|
|
|
#define PRINT_EXTERNAL_ARRAY(Type, type, TYPE, ctype, size) \
|
|
|
|
case EXTERNAL_##TYPE##_ARRAY_TYPE: \
|
|
|
|
External##Type##Array::cast(this)->External##Type##ArrayPrint(out); \
|
2011-04-21 07:15:43 +00:00
|
|
|
break;
|
2014-01-24 16:01:15 +00:00
|
|
|
|
|
|
|
TYPED_ARRAYS(PRINT_EXTERNAL_ARRAY)
|
|
|
|
#undef PRINT_EXTERNAL_ARRAY
|
|
|
|
|
|
|
|
#define PRINT_FIXED_TYPED_ARRAY(Type, type, TYPE, ctype, size) \
|
2014-01-16 17:08:45 +00:00
|
|
|
case Fixed##Type##Array::kInstanceType: \
|
|
|
|
Fixed##Type##Array::cast(this)->FixedTypedArrayPrint(out); \
|
|
|
|
break;
|
|
|
|
|
2014-01-24 16:01:15 +00:00
|
|
|
TYPED_ARRAYS(PRINT_FIXED_TYPED_ARRAY)
|
|
|
|
#undef PRINT_FIXED_TYPED_ARRAY
|
2014-01-16 17:08:45 +00:00
|
|
|
|
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;
|
2014-04-17 17:45:32 +00:00
|
|
|
case JS_SET_ITERATOR_TYPE:
|
|
|
|
JSSetIterator::cast(this)->JSSetIteratorPrint(out);
|
|
|
|
break;
|
|
|
|
case JS_MAP_ITERATOR_TYPE:
|
|
|
|
JSMapIterator::cast(this)->JSMapIteratorPrint(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());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-01-24 16:01:15 +00:00
|
|
|
#define EXTERNAL_ARRAY_PRINTER(Type, type, TYPE, ctype, size) \
|
|
|
|
void External##Type##Array::External##Type##ArrayPrint(FILE* out) { \
|
|
|
|
PrintF(out, "external " #type " array"); \
|
|
|
|
}
|
2010-12-22 13:04:47 +00:00
|
|
|
|
2014-01-24 16:01:15 +00:00
|
|
|
TYPED_ARRAYS(EXTERNAL_ARRAY_PRINTER)
|
2010-12-22 13:04:47 +00:00
|
|
|
|
2014-01-24 16:01:15 +00:00
|
|
|
#undef EXTERNAL_ARRAY_PRINTER
|
2010-12-22 13:04:47 +00:00
|
|
|
|
2011-04-21 07:15:43 +00:00
|
|
|
|
2014-01-16 17:08:45 +00:00
|
|
|
template <class Traits>
|
|
|
|
void FixedTypedArray<Traits>::FixedTypedArrayPrint(FILE* out) {
|
|
|
|
PrintF(out, "fixed %s", Traits::Designator());
|
|
|
|
}
|
|
|
|
|
2011-04-21 07:15:43 +00:00
|
|
|
|
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.
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-01-16 17:08:45 +00:00
|
|
|
template<class T>
|
|
|
|
static void DoPrintElements(FILE *out, Object* object) {
|
|
|
|
T* p = T::cast(object);
|
|
|
|
for (int i = 0; i < p->length(); i++) {
|
|
|
|
PrintF(out, " %d: %d\n", i, p->get_scalar(i));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template<class T>
|
|
|
|
static void DoPrintDoubleElements(FILE* out, Object* object) {
|
|
|
|
T* p = T::cast(object);
|
|
|
|
for (int i = 0; i < p->length(); i++) {
|
|
|
|
PrintF(out, " %d: %f\n", i, p->get_scalar(i));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-12-22 13:04:47 +00:00
|
|
|
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;
|
|
|
|
}
|
2014-01-16 17:08:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
#define PRINT_ELEMENTS(Kind, Type) \
|
|
|
|
case Kind: { \
|
|
|
|
DoPrintElements<Type>(out, elements()); \
|
|
|
|
break; \
|
2014-01-16 16:00:36 +00:00
|
|
|
}
|
2014-01-16 17:08:45 +00:00
|
|
|
|
|
|
|
#define PRINT_DOUBLE_ELEMENTS(Kind, Type) \
|
|
|
|
case Kind: { \
|
|
|
|
DoPrintDoubleElements<Type>(out, elements()); \
|
|
|
|
break; \
|
2011-04-21 07:15:43 +00:00
|
|
|
}
|
2014-01-16 17:08:45 +00:00
|
|
|
|
2014-01-24 16:01:15 +00:00
|
|
|
PRINT_ELEMENTS(EXTERNAL_UINT8_CLAMPED_ELEMENTS, ExternalUint8ClampedArray)
|
|
|
|
PRINT_ELEMENTS(EXTERNAL_INT8_ELEMENTS, ExternalInt8Array)
|
|
|
|
PRINT_ELEMENTS(EXTERNAL_UINT8_ELEMENTS,
|
|
|
|
ExternalUint8Array)
|
|
|
|
PRINT_ELEMENTS(EXTERNAL_INT16_ELEMENTS, ExternalInt16Array)
|
|
|
|
PRINT_ELEMENTS(EXTERNAL_UINT16_ELEMENTS,
|
|
|
|
ExternalUint16Array)
|
|
|
|
PRINT_ELEMENTS(EXTERNAL_INT32_ELEMENTS, ExternalInt32Array)
|
|
|
|
PRINT_ELEMENTS(EXTERNAL_UINT32_ELEMENTS,
|
|
|
|
ExternalUint32Array)
|
|
|
|
PRINT_DOUBLE_ELEMENTS(EXTERNAL_FLOAT32_ELEMENTS, ExternalFloat32Array)
|
|
|
|
PRINT_DOUBLE_ELEMENTS(EXTERNAL_FLOAT64_ELEMENTS, ExternalFloat64Array)
|
2014-01-16 17:08:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
PRINT_ELEMENTS(UINT8_ELEMENTS, FixedUint8Array)
|
|
|
|
PRINT_ELEMENTS(UINT8_CLAMPED_ELEMENTS, FixedUint8ClampedArray)
|
|
|
|
PRINT_ELEMENTS(INT8_ELEMENTS, FixedInt8Array)
|
|
|
|
PRINT_ELEMENTS(UINT16_ELEMENTS, FixedUint16Array)
|
|
|
|
PRINT_ELEMENTS(INT16_ELEMENTS, FixedInt16Array)
|
|
|
|
PRINT_ELEMENTS(UINT32_ELEMENTS, FixedUint32Array)
|
|
|
|
PRINT_ELEMENTS(INT32_ELEMENTS, FixedInt32Array)
|
|
|
|
PRINT_DOUBLE_ELEMENTS(FLOAT32_ELEMENTS, FixedFloat32Array)
|
|
|
|
PRINT_DOUBLE_ELEMENTS(FLOAT64_ELEMENTS, FixedFloat64Array)
|
|
|
|
|
|
|
|
#undef PRINT_DOUBLE_ELEMENTS
|
|
|
|
#undef PRINT_ELEMENTS
|
|
|
|
|
2010-12-22 13:04:47 +00:00
|
|
|
case DICTIONARY_ELEMENTS:
|
|
|
|
elements()->Print(out);
|
|
|
|
break;
|
2014-03-11 14:39:08 +00:00
|
|
|
case SLOPPY_ARGUMENTS_ELEMENTS: {
|
2011-06-16 14:12:58 +00:00
|
|
|
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++) {
|
2014-02-28 11:41:07 +00:00
|
|
|
Name* key = transitions->GetKey(i);
|
2012-07-05 13:54:20 +00:00
|
|
|
PrintF(out, " ");
|
2014-02-28 11:41:07 +00:00
|
|
|
key->NamePrint(out);
|
2012-07-05 13:54:20 +00:00
|
|
|
PrintF(out, ": ");
|
2014-02-28 11:41:07 +00:00
|
|
|
if (key == GetHeap()->frozen_symbol()) {
|
|
|
|
PrintF(out, " (transition to frozen)\n");
|
|
|
|
} else if (key == GetHeap()->elements_transition_symbol()) {
|
|
|
|
PrintF(out, " (transition to ");
|
|
|
|
PrintElementsKind(out, transitions->GetTarget(i)->elements_kind());
|
|
|
|
PrintF(out, ")\n");
|
|
|
|
} else if (key == GetHeap()->observed_symbol()) {
|
|
|
|
PrintF(out, " (transition to Object.observe)\n");
|
|
|
|
} else {
|
|
|
|
switch (transitions->GetTargetDetails(i).type()) {
|
|
|
|
case FIELD: {
|
|
|
|
PrintF(out, " (transition to field)\n");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case CONSTANT:
|
|
|
|
PrintF(out, " (transition to constant)\n");
|
|
|
|
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 NONEXISTENT:
|
|
|
|
UNREACHABLE();
|
|
|
|
break;
|
2012-07-05 13:54:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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");
|
|
|
|
}
|
2013-11-29 15:22:16 +00:00
|
|
|
if (is_frozen()) {
|
|
|
|
PrintF(out, " - frozen\n");
|
|
|
|
} else if (!is_extensible()) {
|
|
|
|
PrintF(out, " - sealed\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-02-20 12:57:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
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++) {
|
2014-03-10 19:05:43 +00:00
|
|
|
if (i < first_code_ptr_index()) {
|
2013-10-14 13:35:06 +00:00
|
|
|
PrintF(out, "\n [%d]: double: %g", i, get_int64_entry_as_double(i));
|
2014-03-10 19:05:43 +00:00
|
|
|
} else if (i < first_heap_ptr_index()) {
|
|
|
|
PrintF(out, "\n [%d]: code target pointer: %p", i,
|
|
|
|
reinterpret_cast<void*>(get_code_ptr_entry(i)));
|
2013-10-14 13:35:06 +00:00
|
|
|
} else if (i < first_int32_index()) {
|
2014-03-10 19:05:43 +00:00
|
|
|
PrintF(out, "\n [%d]: heap pointer: %p", i,
|
|
|
|
reinterpret_cast<void*>(get_heap_ptr_entry(i)));
|
2013-10-14 13:35:06 +00:00
|
|
|
} 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_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);
|
2014-04-17 17:45:32 +00:00
|
|
|
PrintF(out, "\n - hash = ");
|
2011-09-22 13:54:53 +00:00
|
|
|
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);
|
2014-04-17 17:45:32 +00:00
|
|
|
PrintF(out, "\n - call_trap = ");
|
2011-09-13 11:42:57 +00:00
|
|
|
call_trap()->Print(out);
|
2014-04-17 17:45:32 +00:00
|
|
|
PrintF(out, "\n - construct_trap = ");
|
2011-09-13 11:42:57 +00:00
|
|
|
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");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-04-17 17:45:32 +00:00
|
|
|
template<class Derived, class TableType>
|
|
|
|
void OrderedHashTableIterator<Derived, TableType>::
|
|
|
|
OrderedHashTableIteratorPrint(FILE* out) {
|
|
|
|
PrintF(out, " - map = %p\n", reinterpret_cast<void*>(map()));
|
|
|
|
PrintF(out, " - table = ");
|
|
|
|
table()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - index = ");
|
|
|
|
index()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - count = ");
|
|
|
|
count()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - kind = ");
|
|
|
|
kind()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - next_iterator = ");
|
|
|
|
next_iterator()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n - previous_iterator = ");
|
|
|
|
previous_iterator()->ShortPrint(out);
|
|
|
|
PrintF(out, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template void
|
|
|
|
OrderedHashTableIterator<JSSetIterator,
|
|
|
|
OrderedHashSet>::OrderedHashTableIteratorPrint(FILE* out);
|
|
|
|
|
|
|
|
|
|
|
|
template void
|
|
|
|
OrderedHashTableIterator<JSMapIterator,
|
|
|
|
OrderedHashMap>::OrderedHashTableIteratorPrint(FILE* out);
|
|
|
|
|
|
|
|
|
|
|
|
void JSSetIterator::JSSetIteratorPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "JSSetIterator");
|
|
|
|
OrderedHashTableIteratorPrint(out);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void JSMapIterator::JSMapIteratorPrint(FILE* out) {
|
|
|
|
HeapObject::PrintHeader(out, "JSMapIterator");
|
|
|
|
OrderedHashTableIteratorPrint(out);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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);
|
2013-11-25 12:19:02 +00:00
|
|
|
if (shared()->bound()) {
|
|
|
|
PrintF(out, "\n - bindings = ");
|
|
|
|
function_bindings()->ShortPrint(out);
|
|
|
|
} else {
|
|
|
|
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());
|
2014-04-30 10:51:01 +00:00
|
|
|
PrintF(out, "\n - ast_node_count: %d", ast_node_count());
|
2010-12-22 13:04:47 +00:00
|
|
|
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);
|
2013-12-09 07:41:20 +00:00
|
|
|
PrintF(out, "%s", source_string.get());
|
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);
|
2014-04-30 10:51:01 +00:00
|
|
|
PrintF(out, "\n - feedback_vector = ");
|
|
|
|
feedback_vector()->FixedArrayPrint(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-11-22 07:34:21 +00:00
|
|
|
PrintF(out, "\n - memento found count: ");
|
2014-01-13 10:28:01 +00:00
|
|
|
Smi::FromInt(memento_found_count())->ShortPrint(out);
|
2013-11-22 07:34:21 +00:00
|
|
|
PrintF(out, "\n - memento create count: ");
|
2014-01-13 10:28:01 +00:00
|
|
|
Smi::FromInt(memento_create_count())->ShortPrint(out);
|
2013-11-22 07:34:21 +00:00
|
|
|
PrintF(out, "\n - pretenure decision: ");
|
2014-01-13 10:28:01 +00:00
|
|
|
Smi::FromInt(pretenure_decision())->ShortPrint(out);
|
2013-09-19 14:13:34 +00:00
|
|
|
PrintF(out, "\n - transition_info: ");
|
2013-11-14 12:05:09 +00:00
|
|
|
if (transition_info()->IsSmi()) {
|
|
|
|
ElementsKind kind = GetElementsKind();
|
|
|
|
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 - 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");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
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 NONEXISTENT:
|
|
|
|
UNREACHABLE();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
PrintF(out, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-12-22 13:04:47 +00:00
|
|
|
#endif // OBJECT_PRINT
|
|
|
|
|
|
|
|
|
|
|
|
} } // namespace v8::internal
|