diff options
author | Michaël Zasso <targos@protonmail.com> | 2016-09-06 22:49:51 +0200 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2016-09-22 09:51:19 +0200 |
commit | ec02b811a8a5c999bab4de312be2d732b7d9d50b (patch) | |
tree | ca3068017254f238cf413a451c57a803572983a4 /deps/v8/src/objects-printer.cc | |
parent | d2eb7ce0105369a9cad82787cb33a665e9bd00ad (diff) | |
download | node-new-ec02b811a8a5c999bab4de312be2d732b7d9d50b.tar.gz |
deps: update V8 to 5.4.500.27
Pick up latest commit from the 5.4-lkgr branch.
deps: edit V8 gitignore to allow trace event copy
deps: update V8 trace event to 315bf1e2d45be7d53346c31cfcc37424a32c30c8
deps: edit V8 gitignore to allow gtest_prod.h copy
deps: update V8 gtest to 6f8a66431cb592dad629028a50b3dd418a408c87
PR-URL: https://github.com/nodejs/node/pull/8317
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Diffstat (limited to 'deps/v8/src/objects-printer.cc')
-rw-r--r-- | deps/v8/src/objects-printer.cc | 355 |
1 files changed, 260 insertions, 95 deletions
diff --git a/deps/v8/src/objects-printer.cc b/deps/v8/src/objects-printer.cc index 58092a49ba..6f1f746e5e 100644 --- a/deps/v8/src/objects-printer.cc +++ b/deps/v8/src/objects-printer.cc @@ -4,6 +4,9 @@ #include "src/objects.h" +#include <iomanip> +#include <memory> + #include "src/disasm.h" #include "src/disassembler.h" #include "src/interpreter/bytecodes.h" @@ -33,7 +36,13 @@ void Object::Print(std::ostream& os) { // NOLINT void HeapObject::PrintHeader(std::ostream& os, const char* id) { // NOLINT - os << reinterpret_cast<void*>(this) << ": [" << id << "]"; + os << reinterpret_cast<void*>(this) << ": ["; + if (id != nullptr) { + os << id; + } else { + os << map()->instance_type(); + } + os << "]"; } @@ -95,22 +104,24 @@ void HeapObject::HeapObjectPrint(std::ostream& os) { // NOLINT os << "filler"; break; case JS_OBJECT_TYPE: // fall through + case JS_API_OBJECT_TYPE: case JS_SPECIAL_API_OBJECT_TYPE: case JS_CONTEXT_EXTENSION_OBJECT_TYPE: - case JS_ARRAY_TYPE: case JS_GENERATOR_OBJECT_TYPE: case JS_PROMISE_TYPE: + case JS_ARGUMENTS_TYPE: + case JS_ERROR_TYPE: JSObject::cast(this)->JSObjectPrint(os); break; + case JS_ARRAY_TYPE: + JSArray::cast(this)->JSArrayPrint(os); + break; case JS_REGEXP_TYPE: JSRegExp::cast(this)->JSRegExpPrint(os); break; case ODDBALL_TYPE: Oddball::cast(this)->to_string()->Print(os); break; - case JS_MODULE_TYPE: - JSModule::cast(this)->JSModulePrint(os); - break; case JS_BOUND_FUNCTION_TYPE: JSBoundFunction::cast(this)->JSBoundFunctionPrint(os); break; @@ -307,12 +318,35 @@ void JSObject::PrintProperties(std::ostream& os) { // NOLINT } } - -template <class T> +template <class T, bool print_the_hole> static void DoPrintElements(std::ostream& os, Object* object) { // NOLINT - T* p = T::cast(object); - for (int i = 0; i < p->length(); i++) { - os << "\n " << i << ": " << p->get_scalar(i); + T* array = T::cast(object); + if (array->length() == 0) return; + int previous_index = 0; + double previous_value = array->get_scalar(0); + double value = 0.0; + int i; + for (i = 1; i <= array->length(); i++) { + if (i < array->length()) value = array->get_scalar(i); + bool values_are_nan = std::isnan(previous_value) && std::isnan(value); + if ((previous_value == value || values_are_nan) && i != array->length()) { + continue; + } + os << "\n"; + std::stringstream ss; + ss << previous_index; + if (previous_index != i - 1) { + ss << '-' << (i - 1); + } + os << std::setw(12) << ss.str() << ": "; + if (print_the_hole && + FixedDoubleArray::cast(object)->is_the_hole(previous_index)) { + os << "<the_hole>"; + } else { + os << previous_value; + } + previous_index = i; + previous_value = value; } } @@ -320,6 +354,7 @@ static void DoPrintElements(std::ostream& os, Object* object) { // NOLINT void JSObject::PrintElements(std::ostream& os) { // NOLINT // Don't call GetElementsKind, its validation code can cause the printer to // fail when debugging. + if (elements()->length() == 0) return; switch (map()->elements_kind()) { case FAST_HOLEY_SMI_ELEMENTS: case FAST_SMI_ELEMENTS: @@ -327,52 +362,55 @@ void JSObject::PrintElements(std::ostream& os) { // NOLINT case FAST_ELEMENTS: case FAST_STRING_WRAPPER_ELEMENTS: { // Print in array notation for non-sparse arrays. - FixedArray* p = FixedArray::cast(elements()); - for (int i = 0; i < p->length(); i++) { - os << "\n " << i << ": " << Brief(p->get(i)); + FixedArray* array = FixedArray::cast(elements()); + Object* previous_value = array->get(0); + Object* value = nullptr; + int previous_index = 0; + int i; + for (i = 1; i <= array->length(); i++) { + if (i < array->length()) value = array->get(i); + if (previous_value == value && i != array->length()) { + continue; + } + os << "\n"; + std::stringstream ss; + ss << previous_index; + if (previous_index != i - 1) { + ss << '-' << (i - 1); + } + os << std::setw(12) << ss.str() << ": " << Brief(previous_value); + previous_index = i; + previous_value = value; } break; } case FAST_HOLEY_DOUBLE_ELEMENTS: case FAST_DOUBLE_ELEMENTS: { - // Print in array notation for non-sparse arrays. - if (elements()->length() > 0) { - FixedDoubleArray* p = FixedDoubleArray::cast(elements()); - for (int i = 0; i < p->length(); i++) { - os << "\n " << i << ": "; - if (p->is_the_hole(i)) { - os << "<the hole>"; - } else { - os << p->get_scalar(i); - } - } - } + DoPrintElements<FixedDoubleArray, true>(os, elements()); break; } - -#define PRINT_ELEMENTS(Kind, Type) \ - case Kind: { \ - DoPrintElements<Type>(os, elements()); \ - break; \ +#define PRINT_ELEMENTS(Kind, Type) \ + case Kind: { \ + DoPrintElements<Type, false>(os, elements()); \ + break; \ } - 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_ELEMENTS(FLOAT32_ELEMENTS, FixedFloat32Array) - PRINT_ELEMENTS(FLOAT64_ELEMENTS, FixedFloat64Array) + 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_ELEMENTS(FLOAT32_ELEMENTS, FixedFloat32Array) + PRINT_ELEMENTS(FLOAT64_ELEMENTS, FixedFloat64Array) #undef PRINT_ELEMENTS case DICTIONARY_ELEMENTS: case SLOW_STRING_WRAPPER_ELEMENTS: - os << "\n - elements: "; - elements()->Print(os); + SeededNumberDictionary::cast(elements())->Print(os); break; case FAST_SLOPPY_ARGUMENTS_ELEMENTS: case SLOW_SLOPPY_ARGUMENTS_ELEMENTS: { @@ -396,46 +434,62 @@ static void JSObjectPrintHeader(std::ostream& os, JSObject* obj, obj->PrintHeader(os, id); // Don't call GetElementsKind, its validation code can cause the printer to // fail when debugging. - os << "\n - map = " << reinterpret_cast<void*>(obj->map()) << " [" + os << "\n - map = " << reinterpret_cast<void*>(obj->map()) << " ["; + if (obj->HasFastProperties()) { + os << "FastProperties"; + } else { + os << "DictionaryProperties"; + } + PrototypeIterator iter(obj->GetIsolate(), obj); + os << "]\n - prototype = " << reinterpret_cast<void*>(iter.GetCurrent()); + os << "\n - elements = " << Brief(obj->elements()) << " [" << ElementsKindToString(obj->map()->elements_kind()); if (obj->elements()->map() == obj->GetHeap()->fixed_cow_array_map()) { os << " (COW)"; } - PrototypeIterator iter(obj->GetIsolate(), obj); - os << "]\n - prototype = " << reinterpret_cast<void*>(iter.GetCurrent()); - if (obj->elements()->length() > 0) { - os << "\n - elements = " << Brief(obj->elements()); + os << "]"; + if (obj->GetInternalFieldCount() > 0) { + os << "\n - internal fields: " << obj->GetInternalFieldCount(); } } static void JSObjectPrintBody(std::ostream& os, JSObject* obj, // NOLINT bool print_elements = true) { - os << "\n {"; + os << "\n - properties = {"; obj->PrintProperties(os); - obj->PrintTransitions(os); - if (print_elements) obj->PrintElements(os); os << "\n }\n"; + if (print_elements && obj->elements()->length() > 0) { + os << " - elements = {"; + obj->PrintElements(os); + os << "\n }\n"; + } + int internal_fields = obj->GetInternalFieldCount(); + if (internal_fields > 0) { + os << " - internal fields = {"; + for (int i = 0; i < internal_fields; i++) { + os << "\n " << Brief(obj->GetInternalField(i)); + } + os << "\n }\n"; + } } void JSObject::JSObjectPrint(std::ostream& os) { // NOLINT - JSObjectPrintHeader(os, this, "JSObject"); + JSObjectPrintHeader(os, this, nullptr); JSObjectPrintBody(os, this); } - -void JSRegExp::JSRegExpPrint(std::ostream& os) { // NOLINT - JSObjectPrintHeader(os, this, "JSRegExp"); - os << "\n - data = " << Brief(data()); +void JSArray::JSArrayPrint(std::ostream& os) { // NOLINT + JSObjectPrintHeader(os, this, "JSArray"); + os << "\n - length = " << Brief(this->length()); JSObjectPrintBody(os, this); } -void JSModule::JSModulePrint(std::ostream& os) { // NOLINT - JSObjectPrintHeader(os, this, "JSModule"); - os << "\n - context = " << Brief(context()); - os << " - scope_info = " << Brief(scope_info()); +void JSRegExp::JSRegExpPrint(std::ostream& os) { // NOLINT + JSObjectPrintHeader(os, this, "JSRegExp"); + os << "\n - data = " << Brief(data()); JSObjectPrintBody(os, this); } @@ -444,7 +498,7 @@ void Symbol::SymbolPrint(std::ostream& os) { // NOLINT HeapObject::PrintHeader(os, "Symbol"); os << "\n - hash: " << Hash(); os << "\n - name: " << Brief(name()); - if (name()->IsUndefined()) { + if (name()->IsUndefined(GetIsolate())) { os << " (" << PrivateSymbolToName() << ")"; } os << "\n - private: " << is_private(); @@ -471,14 +525,13 @@ void Map::MapPrint(std::ostream& os) { // NOLINT if (is_stable()) os << "\n - stable_map"; if (is_dictionary_map()) os << "\n - dictionary_map"; if (has_hidden_prototype()) os << "\n - has_hidden_prototype"; - if (has_named_interceptor()) os << " - named_interceptor"; + if (has_named_interceptor()) os << "\n - named_interceptor"; if (has_indexed_interceptor()) os << "\n - indexed_interceptor"; if (is_undetectable()) os << "\n - undetectable"; if (is_callable()) os << "\n - callable"; if (is_constructor()) os << "\n - constructor"; if (is_access_check_needed()) os << "\n - access_check_needed"; if (!is_extensible()) os << "\n - non-extensible"; - if (is_observed()) os << "\n - observed"; if (is_prototype_map()) { os << "\n - prototype_map"; os << "\n - prototype info: " << Brief(prototype_info()); @@ -506,20 +559,6 @@ void Map::MapPrint(std::ostream& os) { // NOLINT } -void CodeCache::CodeCachePrint(std::ostream& os) { // NOLINT - HeapObject::PrintHeader(os, "CodeCache"); - os << "\n - default_cache: " << Brief(default_cache()); - os << "\n - normal_type_cache: " << Brief(normal_type_cache()); -} - - -void PolymorphicCodeCache::PolymorphicCodeCachePrint( - std::ostream& os) { // NOLINT - HeapObject::PrintHeader(os, "PolymorphicCodeCache"); - os << "\n - cache: " << Brief(cache()); -} - - void TypeFeedbackInfo::TypeFeedbackInfoPrint(std::ostream& os) { // NOLINT HeapObject::PrintHeader(os, "TypeFeedbackInfo"); os << "\n - ic_total_count: " << ic_total_count() @@ -572,6 +611,40 @@ void TransitionArray::TransitionArrayPrint(std::ostream& os) { // NOLINT os << "\n"; } +template void FeedbackVectorSpecBase<StaticFeedbackVectorSpec>::Print(); +template void FeedbackVectorSpecBase<FeedbackVectorSpec>::Print(); + +template <typename Derived> +void FeedbackVectorSpecBase<Derived>::Print() { + OFStream os(stdout); + FeedbackVectorSpecPrint(os); + os << std::flush; +} + +template <typename Derived> +void FeedbackVectorSpecBase<Derived>::FeedbackVectorSpecPrint( + std::ostream& os) { // NOLINT + int slot_count = This()->slots(); + os << " - slot_count: " << slot_count; + if (slot_count == 0) { + os << " (empty)\n"; + return; + } + + for (int slot = 0, name_index = 0; slot < slot_count;) { + FeedbackVectorSlotKind kind = This()->GetKind(slot); + int entry_size = TypeFeedbackMetadata::GetSlotSize(kind); + DCHECK_LT(0, entry_size); + + os << "\n Slot #" << slot << " " << kind; + if (TypeFeedbackMetadata::SlotRequiresName(kind)) { + os << ", " << Brief(*This()->GetName(name_index++)); + } + + slot += entry_size; + } + os << "\n"; +} void TypeFeedbackMetadata::Print() { OFStream os(stdout); @@ -588,12 +661,16 @@ void TypeFeedbackMetadata::TypeFeedbackMetadataPrint( os << " (empty)\n"; return; } + os << "\n - slot_count: " << slot_count(); TypeFeedbackMetadataIterator iter(this); while (iter.HasNext()) { FeedbackVectorSlot slot = iter.Next(); FeedbackVectorSlotKind kind = iter.kind(); os << "\n Slot " << slot << " " << kind; + if (TypeFeedbackMetadata::SlotRequiresName(kind)) { + os << ", " << Brief(iter.name()); + } } os << "\n"; } @@ -619,13 +696,22 @@ void TypeFeedbackVector::TypeFeedbackVectorPrint(std::ostream& os) { // NOLINT FeedbackVectorSlot slot = iter.Next(); FeedbackVectorSlotKind kind = iter.kind(); - os << "\n Slot " << slot << " " << kind << " "; + os << "\n Slot " << slot << " " << kind; + if (TypeFeedbackMetadata::SlotRequiresName(kind)) { + os << ", " << Brief(iter.name()); + } + os << " "; switch (kind) { case FeedbackVectorSlotKind::LOAD_IC: { LoadICNexus nexus(this, slot); os << Code::ICState2String(nexus.StateFromFeedback()); break; } + case FeedbackVectorSlotKind::LOAD_GLOBAL_IC: { + LoadGlobalICNexus nexus(this, slot); + os << Code::ICState2String(nexus.StateFromFeedback()); + break; + } case FeedbackVectorSlotKind::KEYED_LOAD_IC: { KeyedLoadICNexus nexus(this, slot); os << Code::ICState2String(nexus.StateFromFeedback()); @@ -713,8 +799,6 @@ void String::StringPrint(std::ostream& os) { // NOLINT void Name::NamePrint(std::ostream& os) { // NOLINT if (IsString()) { String::cast(this)->StringPrint(os); - } else if (IsSymbol()) { - Symbol::cast(this)->name()->Print(os); } else { os << Brief(this); } @@ -872,6 +956,8 @@ void JSFunction::JSFunctionPrint(std::ostream& os) { // NOLINT << shared()->internal_formal_parameter_count(); if (shared()->is_generator()) { os << "\n - generator"; + } else if (shared()->is_async()) { + os << "\n - async"; } os << "\n - context = " << Brief(context()); os << "\n - literals = " << Brief(literals()); @@ -894,7 +980,7 @@ void SharedFunctionInfo::SharedFunctionInfoPrint(std::ostream& os) { // NOLINT String* source = String::cast(Script::cast(script())->source()); int start = start_position(); int length = end_position() - start; - base::SmartArrayPointer<char> source_string = source->ToCString( + std::unique_ptr<char[]> source_string = source->ToCString( DISALLOW_NULLS, FAST_STRING_TRAVERSAL, start, length, NULL); os << source_string.get(); } @@ -913,9 +999,10 @@ void SharedFunctionInfo::SharedFunctionInfoPrint(std::ostream& os) { // NOLINT os << "\n - end position = " << end_position(); os << "\n - debug info = " << Brief(debug_info()); os << "\n - length = " << length(); + os << "\n - num_literals = " << num_literals(); os << "\n - optimized_code_map = " << Brief(optimized_code_map()); - os << "\n - feedback_vector = "; - feedback_vector()->TypeFeedbackVectorPrint(os); + os << "\n - feedback_metadata = "; + feedback_metadata()->TypeFeedbackMetadataPrint(os); if (HasBytecodeArray()) { os << "\n - bytecode_array = " << bytecode_array(); } @@ -950,6 +1037,46 @@ void PropertyCell::PropertyCellPrint(std::ostream& os) { // NOLINT HeapObject::PrintHeader(os, "PropertyCell"); os << "\n - value: " << Brief(value()); os << "\n - details: " << property_details(); + PropertyCellType cell_type = property_details().cell_type(); + os << "\n - cell_type: "; + if (value()->IsTheHole(GetIsolate())) { + switch (cell_type) { + case PropertyCellType::kUninitialized: + os << "Uninitialized"; + break; + case PropertyCellType::kInvalidated: + os << "Invalidated"; + break; + default: + os << "??? " << static_cast<int>(cell_type); + break; + } + } else { + switch (cell_type) { + case PropertyCellType::kUndefined: + os << "Undefined"; + break; + case PropertyCellType::kConstant: + os << "Constant"; + break; + case PropertyCellType::kConstantType: + os << "ConstantType" + << " ("; + switch (GetConstantType()) { + case PropertyCellConstantType::kSmi: + os << "Smi"; + break; + case PropertyCellConstantType::kStableMap: + os << "StableMap"; + break; + } + os << ")"; + break; + case PropertyCellType::kMutable: + os << "Mutable"; + break; + } + } os << "\n"; } @@ -988,6 +1115,7 @@ void AccessorInfo::AccessorInfoPrint(std::ostream& os) { // NOLINT os << "\n - flag: " << flag(); os << "\n - getter: " << Brief(getter()); os << "\n - setter: " << Brief(setter()); + os << "\n - js_getter: " << Brief(js_getter()); os << "\n - data: " << Brief(data()); os << "\n"; } @@ -1028,9 +1156,9 @@ void AccessorPair::AccessorPairPrint(std::ostream& os) { // NOLINT void AccessCheckInfo::AccessCheckInfoPrint(std::ostream& os) { // NOLINT HeapObject::PrintHeader(os, "AccessCheckInfo"); - os << "\n - named_callback: " << Brief(named_callback()); - os << "\n - indexed_callback: " << Brief(indexed_callback()); os << "\n - callback: " << Brief(callback()); + os << "\n - named_interceptor: " << Brief(named_interceptor()); + os << "\n - indexed_interceptor: " << Brief(indexed_interceptor()); os << "\n - data: " << Brief(data()); os << "\n"; } @@ -1087,7 +1215,8 @@ void ObjectTemplateInfo::ObjectTemplateInfoPrint(std::ostream& os) { // NOLINT os << "\n - property_list: " << Brief(property_list()); os << "\n - property_accessors: " << Brief(property_accessors()); os << "\n - constructor: " << Brief(constructor()); - os << "\n - internal_field_count: " << Brief(internal_field_count()); + os << "\n - internal_field_count: " << internal_field_count(); + os << "\n - immutable_proto: " << (immutable_proto() ? "true" : "false"); os << "\n"; } @@ -1140,8 +1269,7 @@ void Script::ScriptPrint(std::ostream& os) { // NOLINT os << "\n - compilation type: " << compilation_type(); os << "\n - line ends: " << Brief(line_ends()); os << "\n - eval from shared: " << Brief(eval_from_shared()); - os << "\n - eval from instructions offset: " - << eval_from_instructions_offset(); + os << "\n - eval from position: " << eval_from_position(); os << "\n - shared function infos: " << Brief(shared_function_infos()); os << "\n"; } @@ -1150,7 +1278,7 @@ void Script::ScriptPrint(std::ostream& os) { // NOLINT void DebugInfo::DebugInfoPrint(std::ostream& os) { // NOLINT HeapObject::PrintHeader(os, "DebugInfo"); os << "\n - shared: " << Brief(shared()); - os << "\n - code: " << Brief(abstract_code()); + os << "\n - debug bytecode array: " << Brief(debug_bytecode_array()); os << "\n - break_points: "; break_points()->Print(os); } @@ -1158,9 +1286,7 @@ void DebugInfo::DebugInfoPrint(std::ostream& os) { // NOLINT void BreakPointInfo::BreakPointInfoPrint(std::ostream& os) { // NOLINT HeapObject::PrintHeader(os, "BreakPointInfo"); - os << "\n - code_offset: " << code_offset(); os << "\n - source_position: " << source_position(); - os << "\n - statement_position: " << statement_position(); os << "\n - break_point_objects: " << Brief(break_point_objects()); os << "\n"; } @@ -1184,7 +1310,7 @@ void LayoutDescriptor::Print() { void LayoutDescriptor::Print(std::ostream& os) { // NOLINT os << "Layout descriptor: "; - if (IsUninitialized()) { + if (IsOddball() && IsUninitialized(HeapObject::cast(this)->GetIsolate())) { os << "<uninitialized>"; } else if (IsFastPointerLayout()) { os << "<all tagged>"; @@ -1215,7 +1341,7 @@ void Name::NameShortPrint() { } else { DCHECK(this->IsSymbol()); Symbol* s = Symbol::cast(this); - if (s->name()->IsUndefined()) { + if (s->name()->IsUndefined(GetIsolate())) { PrintF("#<%s>", s->PrivateSymbolToName()); } else { PrintF("<%s>", String::cast(s->name())->ToCString().get()); @@ -1230,7 +1356,7 @@ int Name::NameShortPrint(Vector<char> str) { } else { DCHECK(this->IsSymbol()); Symbol* s = Symbol::cast(this); - if (s->name()->IsUndefined()) { + if (s->name()->IsUndefined(GetIsolate())) { return SNPrintF(str, "#<%s>", s->PrivateSymbolToName()); } else { return SNPrintF(str, "<%s>", String::cast(s->name())->ToCString().get()); @@ -1293,7 +1419,7 @@ void TransitionArray::PrintTransitions(std::ostream& os, Object* transitions, for (int i = 0; i < num_transitions; i++) { Name* key = GetKey(transitions, i); Map* target = GetTarget(transitions, i); - os << "\n "; + os << "\n "; #ifdef OBJECT_PRINT key->NamePrint(os); #else @@ -1312,8 +1438,6 @@ void TransitionArray::PrintTransitions(std::ostream& os, Object* transitions, << ")"; } else if (key == heap->strict_function_transition_symbol()) { os << " (transition to strict function)"; - } else if (key == heap->observed_symbol()) { - os << " (transition to Object.observe)"; } else { PropertyDetails details = GetTargetDetails(key, target); os << "(transition to "; @@ -1343,3 +1467,44 @@ void JSObject::PrintTransitions(std::ostream& os) { // NOLINT #endif // defined(DEBUG) || defined(OBJECT_PRINT) } // namespace internal } // namespace v8 + +// +// The following functions are used by our gdb macros. +// +extern void _v8_internal_Print_Object(void* object) { + reinterpret_cast<i::Object*>(object)->Print(); +} + +extern void _v8_internal_Print_Code(void* object) { + i::Isolate* isolate = i::Isolate::Current(); + isolate->FindCodeObject(reinterpret_cast<i::Address>(object))->Print(); +} + +extern void _v8_internal_Print_TypeFeedbackVector(void* object) { + if (reinterpret_cast<i::Object*>(object)->IsSmi()) { + printf("Not a type feedback vector\n"); + } else { + reinterpret_cast<i::TypeFeedbackVector*>(object)->Print(); + } +} + +extern void _v8_internal_Print_DescriptorArray(void* object) { + if (reinterpret_cast<i::Object*>(object)->IsSmi()) { + printf("Not a descriptor array\n"); + } else { + reinterpret_cast<i::DescriptorArray*>(object)->Print(); + } +} + +extern void _v8_internal_Print_TransitionArray(void* object) { + if (reinterpret_cast<i::Object*>(object)->IsSmi()) { + printf("Not a transition array\n"); + } else { + reinterpret_cast<i::TransitionArray*>(object)->Print(); + } +} + +extern void _v8_internal_Print_StackTrace() { + i::Isolate* isolate = i::Isolate::Current(); + isolate->PrintStack(stdout); +} |