Lines Matching refs:os
41 StdoutStream os;
42 this->Print(os);
43 os << std::flush;
46 void Object::Print(std::ostream& os) const {
48 os << "Smi: " << std::hex << "0x" << Smi::ToInt(*this);
49 os << std::dec << " (" << Smi::ToInt(*this) << ")\n";
51 HeapObject::cast(*this).HeapObjectPrint(os);
57 void PrintHeapObjectHeaderWithoutMap(HeapObject object, std::ostream& os,
60 os << reinterpret_cast<void*>(object.ptr()) << ": [";
62 os << id;
64 os << object.map(cage_base).instance_type();
66 os << "]";
68 os << " in ReadOnlySpace";
70 os << " in OldSpace";
75 void PrintDictionaryContents(std::ostream& os, T dict) {
91 os << "\n ";
93 String::cast(k).PrintUC16(os);
95 os << Brief(k);
97 os << ": " << Brief(dict.ValueAt(i)) << " ";
98 dict.DetailsAt(i).PrintAsSlowTo(os, !T::kIsOrderedDictionaryType);
103 void HeapObject::PrintHeader(std::ostream& os, const char* id) {
104 PrintHeapObjectHeaderWithoutMap(*this, os, id);
106 if (!IsMap(cage_base)) os << "\n - map: " << Brief(map(cage_base));
109 void HeapObject::HeapObjectPrint(std::ostream& os) {
115 String::cast(*this).StringPrint(os);
116 os << "\n";
130 Context::cast(*this).ContextPrint(os);
133 FixedArray::cast(*this).FixedArrayPrint(os);
136 NativeContext::cast(*this).NativeContextPrint(os);
139 ObjectHashTable::cast(*this).ObjectHashTablePrint(os);
142 NameToIndexHashTable::cast(*this).NameToIndexHashTablePrint(os);
145 RegisteredSymbolTable::cast(*this).RegisteredSymbolTablePrint(os);
148 OrderedHashMap::cast(*this).OrderedHashMapPrint(os);
151 OrderedHashSet::cast(*this).OrderedHashSetPrint(os);
154 OrderedNameDictionary::cast(*this).OrderedNameDictionaryPrint(os);
157 NameDictionary::cast(*this).NameDictionaryPrint(os);
160 GlobalDictionary::cast(*this).GlobalDictionaryPrint(os);
163 FixedArray::cast(*this).FixedArrayPrint(os);
166 NumberDictionary::cast(*this).NumberDictionaryPrint(os);
169 EphemeronHashTable::cast(*this).EphemeronHashTablePrint(os);
173 .ObjectBoilerplateDescriptionPrint(os);
176 TransitionArray::cast(*this).TransitionArrayPrint(os);
179 ClosureFeedbackCellArray::cast(*this).ClosureFeedbackCellArrayPrint(os);
183 os << "filler";
199 JSObject::cast(*this).JSObjectPrint(os);
203 WasmInstanceObject::cast(*this).WasmInstanceObjectPrint(os);
206 WasmValueObject::cast(*this).WasmValueObjectPrint(os);
210 Code::cast(*this).CodePrint(os);
213 CodeDataContainer::cast(*this).CodeDataContainerPrint(os);
217 JSSetIterator::cast(*this).JSSetIteratorPrint(os);
222 JSMapIterator::cast(*this).JSMapIteratorPrint(os);
226 Name::cast(*this).Name##Print(os); \
235 AllocationSite::cast(*this).AllocationSitePrint(os);
238 LoadHandler::cast(*this).LoadHandlerPrint(os);
241 StoreHandler::cast(*this).StoreHandlerPrint(os);
244 FeedbackMetadata::cast(*this).FeedbackMetadataPrint(os);
247 BigIntBase::cast(*this).BigIntBasePrint(os);
257 JSFunction::cast(*this).JSFunctionPrint(os);
283 os << "UNKNOWN TYPE " << map().instance_type();
288 void ByteArray::ByteArrayPrint(std::ostream& os) {
289 PrintHeader(os, "ByteArray");
290 os << "\n - length: " << length()
295 void BytecodeArray::BytecodeArrayPrint(std::ostream& os) {
296 PrintHeader(os, "BytecodeArray");
297 os << "\n";
298 Disassemble(os);
301 void FreeSpace::FreeSpacePrint(std::ostream& os) {
302 os << "free space, size " << Size() << "\n";
305 bool JSObject::PrintProperties(std::ostream& os) {
310 os << "\n ";
311 descs.GetKey(i).NamePrint(os);
312 os << ": ";
317 os << Brief(RawFastPropertyAt(field_index));
321 os << Brief(descs.GetStrongValue(i));
324 os << " ";
325 details.PrintAsFastTo(os, PropertyDetails::kForProperties);
329 os << ", location: in-object";
332 os << ", location: properties[" << field_index << "]";
335 os << ", location: descriptor";
341 os, JSGlobalObject::cast(*this).global_dictionary(kAcquireLoad));
343 PrintDictionaryContents(os, property_dictionary_swiss());
345 PrintDictionaryContents(os, property_dictionary());
371 void DoPrintElements(std::ostream& os, Object object, int length) {
386 os << "\n";
392 os << std::setw(12) << ss.str() << ": ";
394 os << "<the_hole>";
396 os << previous_value;
404 void PrintTypedArrayElements(std::ostream& os, const ElementType* data_ptr,
410 os << "\n 0-" << length << ": <mocked array buffer bytes>";
421 os << "\n";
427 os << std::setw(12) << ss.str() << ": " << +previous_value;
434 void PrintFixedArrayElements(std::ostream& os, T array) {
445 os << "\n";
451 os << std::setw(12) << ss.str() << ": " << Brief(previous_value);
457 void PrintDictionaryElements(std::ostream& os, FixedArrayBase elements) {
461 os << "\n - requires_slow_elements";
463 os << "\n - max_number_key: " << dict.max_number_key();
465 PrintDictionaryContents(os, dict);
468 void PrintSloppyArgumentElements(std::ostream& os, ElementsKind kind,
471 os << "\n 0: context: " << Brief(elements.context())
476 os << "\n " << i << ": param(" << i << "): " << Brief(mapped_entry);
478 os << " in the arguments_store[" << i << "]";
480 os << " in the context";
484 os << "\n }"
488 PrintFixedArrayElements(os, arguments_store);
491 PrintDictionaryElements(os, arguments_store);
495 void PrintEmbedderData(Isolate* isolate, std::ostream& os,
499 os << Brief(value);
502 os << ", aligned pointer: " << raw_pointer;
508 void JSObject::PrintElements(std::ostream& os) {
511 os << " - elements: " << Brief(elements()) << " {";
524 PrintFixedArrayElements(os, FixedArray::cast(elements()));
529 DoPrintElements<FixedDoubleArray>(os, elements(), elements().length());
539 PrintTypedArrayElements<elementType>(os, data_ptr, length, is_on_heap); \
548 PrintDictionaryElements(os, elements());
552 PrintSloppyArgumentElements(os, map().elements_kind(),
561 os << "\n }\n";
564 static void JSObjectPrintHeader(std::ostream& os, JSObject obj,
567 obj.PrintHeader(os, id);
570 os << " [";
572 os << "FastProperties";
574 os << "DictionaryProperties";
577 os << "]\n - prototype: " << Brief(iter.GetCurrent());
578 os << "\n - elements: " << Brief(obj.elements()) << " ["
580 if (obj.elements().IsCowArray()) os << " (COW)";
581 os << "]";
584 os << "\n - hash: " << Brief(hash);
587 os << "\n - embedder fields: " << obj.GetEmbedderFieldCount();
591 static void JSObjectPrintBody(std::ostream& os, JSObject obj,
593 os << "\n - properties: ";
596 os << Brief(properties_or_hash);
598 os << "\n - All own properties (excluding elements): {";
599 if (obj.PrintProperties(os)) os << "\n ";
600 os << "}\n";
605 if (length > 0) obj.PrintElements(os);
610 os << " - embedder fields = {";
612 os << "\n ";
613 PrintEmbedderData(isolate, os, EmbedderDataSlot(obj, i));
615 os << "\n }\n";
619 void JSObject::JSObjectPrint(std::ostream& os) {
620 JSObjectPrintHeader(os, *this, nullptr);
621 JSObjectPrintBody(os, *this);
624 void JSGeneratorObject::JSGeneratorObjectPrint(std::ostream& os) {
625 JSObjectPrintHeader(os, *this, "JSGeneratorObject");
626 os << "\n - function: " << Brief(function());
627 os << "\n - context: " << Brief(context());
628 os << "\n - receiver: " << Brief(receiver());
630 os << "\n - input: " << Brief(input_or_debug_pos());
633 os << "\n - debug pos: " << Brief(input_or_debug_pos());
647 os << "\n - resume mode: " << mode;
648 os << "\n - continuation: " << continuation();
649 if (is_closed()) os << " (closed)";
650 if (is_executing()) os << " (executing)";
651 if (is_suspended()) os << " (suspended)";
661 os << "\n - source position: ";
667 os << source_position();
668 os << " (";
669 script_name.PrintUC16(os);
672 os << ", lin " << lin;
673 os << ", col " << col;
675 os << "unavailable";
677 os << ")";
680 os << "\n - register file: " << Brief(parameters_and_registers());
681 JSObjectPrintBody(os, *this);
684 void JSArray::JSArrayPrint(std::ostream& os) {
685 JSObjectPrintHeader(os, *this, "JSArray");
686 os << "\n - length: " << Brief(this->length());
687 JSObjectPrintBody(os, *this);
690 void JSPromise::JSPromisePrint(std::ostream& os) {
691 JSObjectPrintHeader(os, *this, "JSPromise");
692 os << "\n - status: " << JSPromise::Status(status());
694 os << "\n - reactions: " << Brief(reactions());
696 os << "\n - result: " << Brief(result());
698 os << "\n - has_handler: " << has_handler();
699 os << "\n - handled_hint: " << handled_hint();
700 os << "\n - is_silent: " << is_silent();
701 JSObjectPrintBody(os, *this);
704 void JSRegExp::JSRegExpPrint(std::ostream& os) {
706 JSObjectPrintHeader(os, *this, "JSRegExp");
707 os << "\n - data: " << Brief(data());
708 os << "\n - source: " << Brief(source());
709 os << "\n - flags: " << Brief(*JSRegExp::StringFromFlags(isolate, flags()));
710 JSObjectPrintBody(os, *this);
713 void JSRegExpStringIterator::JSRegExpStringIteratorPrint(std::ostream& os) {
714 JSObjectPrintHeader(os, *this, "JSRegExpStringIterator");
715 os << "\n - regex: " << Brief(iterating_reg_exp());
716 os << "\n - string: " << Brief(iterated_string());
717 os << "\n - done: " << done();
718 os << "\n - global: " << global();
719 os << "\n - unicode: " << unicode();
720 JSObjectPrintBody(os, *this);
723 void Symbol::SymbolPrint(std::ostream& os) {
724 PrintHeader(os, "Symbol");
725 os << "\n - hash: " << hash();
726 os << "\n - description: " << Brief(description());
728 os << " (" << PrivateSymbolToName() << ")";
730 os << "\n - private: " << is_private();
731 os << "\n - private_name: " << is_private_name();
732 os << "\n - private_brand: " << is_private_brand();
733 os << "\n";
736 void DescriptorArray::DescriptorArrayPrint(std::ostream& os) {
737 PrintHeader(os, "DescriptorArray");
738 os << "\n - enum_cache: ";
740 os << "empty";
742 os << enum_cache().keys().length();
743 os << "\n - keys: " << Brief(enum_cache().keys());
744 os << "\n - indices: " << Brief(enum_cache().indices());
746 os << "\n - nof slack descriptors: " << number_of_slack_descriptors();
747 os << "\n - nof descriptors: " << number_of_descriptors();
749 os << "\n - raw marked descriptors: mc epoch "
752 PrintDescriptors(os);
756 void PrintFixedArrayWithHeader(std::ostream& os, FixedArray array,
758 array.PrintHeader(os, type);
759 os << "\n - length: " << array.length();
760 PrintFixedArrayElements(os, array);
761 os << "\n";
765 void PrintWeakArrayElements(std::ostream& os, T* array) {
777 os << "\n";
783 os << std::setw(12) << ss.str() << ": " << Brief(previous_value);
792 std::ostream& os) {
793 PrintFixedArrayWithHeader(os, *this, "ObjectBoilerplateDescription");
796 void EmbedderDataArray::EmbedderDataArrayPrint(std::ostream& os) {
798 PrintHeader(os, "EmbedderDataArray");
799 os << "\n - length: " << length();
803 os << "\n ";
804 PrintEmbedderData(isolate, os, slot);
806 os << "\n";
809 void FixedArray::FixedArrayPrint(std::ostream& os) {
810 PrintFixedArrayWithHeader(os, *this, "FixedArray");
826 void AccessorInfo::AccessorInfoPrint(std::ostream& os) {
827 TorqueGeneratedAccessorInfo<AccessorInfo, Struct>::AccessorInfoPrint(os);
828 os << " - all_can_read: " << all_can_read();
829 os << "\n - all_can_write: " << all_can_write();
830 os << "\n - is_special_data_property: " << is_special_data_property();
831 os << "\n - is_sloppy: " << is_sloppy();
832 os << "\n - replace_on_access: " << replace_on_access();
833 os << "\n - getter_side_effect_type: "
835 os << "\n - setter_side_effect_type: "
837 os << "\n - initial_attributes: " << initial_property_attributes();
838 os << '\n';
842 void PrintContextWithHeader(std::ostream& os, Context context,
844 context.PrintHeader(os, type);
845 os << "\n - type: " << context.map().instance_type();
846 os << "\n - scope_info: " << Brief(context.scope_info());
847 os << "\n - previous: " << Brief(context.unchecked_previous());
848 os << "\n - native_context: " << Brief(context.native_context());
850 os << "\n - extension: " << context.extension();
852 os << "\n - length: " << context.length();
853 os << "\n - elements:";
854 PrintFixedArrayElements(os, context);
855 os << "\n";
859 void Context::ContextPrint(std::ostream& os) {
860 PrintContextWithHeader(os, *this, "Context");
863 void NativeContext::NativeContextPrint(std::ostream& os) {
864 PrintContextWithHeader(os, *this, "NativeContext");
865 os << " - microtask_queue: " << microtask_queue() << "\n";
881 void PrintTableContentsGeneric(std::ostream& os, T dict,
889 os << "\n " << std::setw(12) << i.as_int() << ": ";
891 String::cast(k).PrintUC16(os);
893 os << Brief(k);
896 os << " -> ";
904 void PrintDictionaryContentsFull(std::ostream& os, T dict) {
905 os << "\n - elements: {";
907 os << Brief(dict.ValueAt(i)) << " ";
908 dict.DetailsAt(i).PrintAsSlowTo(os, !T::kIsOrderedDictionaryType);
910 PrintTableContentsGeneric(os, dict, print_value_and_property_details);
911 os << "\n }\n";
916 void PrintHashMapContentsFull(std::ostream& os, T dict) {
917 os << "\n - elements: {";
918 auto print_value = [&](InternalIndex i) { os << Brief(dict.ValueAt(i)); };
919 PrintTableContentsGeneric(os, dict, print_value);
920 os << "\n }\n";
925 void PrintHashSetContentsFull(std::ostream& os, T dict) {
926 os << "\n - elements: {";
928 PrintTableContentsGeneric(os, dict, nullptr);
929 os << "\n }\n";
934 void PrintOrderedHashTableHeaderAndBuckets(std::ostream& os, T table,
938 PrintHeapObjectHeaderWithoutMap(table, os, type);
939 os << "\n - FixedArray length: " << table.length();
940 os << "\n - elements: " << table.NumberOfElements();
941 os << "\n - deleted: " << table.NumberOfDeletedElements();
942 os << "\n - buckets: " << table.NumberOfBuckets();
943 os << "\n - capacity: " << table.Capacity();
945 os << "\n - buckets: {";
949 os << "\n " << std::setw(12) << bucket << ": " << Brief(entry);
951 os << "\n }";
956 void PrintHashTableHeader(std::ostream& os, T table, const char* type) {
957 PrintHeapObjectHeaderWithoutMap(table, os, type);
958 os << "\n - FixedArray length: " << table.length();
959 os << "\n - elements: " << table.NumberOfElements();
960 os << "\n - deleted: " << table.NumberOfDeletedElements();
961 os << "\n - capacity: " << table.Capacity();
965 void ObjectHashTable::ObjectHashTablePrint(std::ostream& os) {
966 PrintHashTableHeader(os, *this, "ObjectHashTable");
967 PrintHashMapContentsFull(os, *this);
970 void NameToIndexHashTable::NameToIndexHashTablePrint(std::ostream& os) {
971 PrintHashTableHeader(os, *this, "NameToIndexHashTable");
972 PrintHashMapContentsFull(os, *this);
975 void RegisteredSymbolTable::RegisteredSymbolTablePrint(std::ostream& os) {
976 PrintHashTableHeader(os, *this, "RegisteredSymbolTable");
977 PrintHashMapContentsFull(os, *this);
980 void NumberDictionary::NumberDictionaryPrint(std::ostream& os) {
981 PrintHashTableHeader(os, *this, "NumberDictionary");
982 PrintDictionaryContentsFull(os, *this);
985 void EphemeronHashTable::EphemeronHashTablePrint(std::ostream& os) {
986 PrintHashTableHeader(os, *this, "EphemeronHashTable");
987 PrintHashMapContentsFull(os, *this);
990 void NameDictionary::NameDictionaryPrint(std::ostream& os) {
991 PrintHashTableHeader(os, *this, "NameDictionary");
992 PrintDictionaryContentsFull(os, *this);
995 void GlobalDictionary::GlobalDictionaryPrint(std::ostream& os) {
996 PrintHashTableHeader(os, *this, "GlobalDictionary");
997 PrintDictionaryContentsFull(os, *this);
1000 void SmallOrderedHashSet::SmallOrderedHashSetPrint(std::ostream& os) {
1001 PrintHeader(os, "SmallOrderedHashSet");
1005 void SmallOrderedHashMap::SmallOrderedHashMapPrint(std::ostream& os) {
1006 PrintHeader(os, "SmallOrderedHashMap");
1011 std::ostream& os) {
1012 PrintHeader(os, "SmallOrderedNameDictionary");
1016 void OrderedHashSet::OrderedHashSetPrint(std::ostream& os) {
1017 PrintOrderedHashTableHeaderAndBuckets(os, *this, "OrderedHashSet");
1018 PrintHashSetContentsFull(os, *this);
1021 void OrderedHashMap::OrderedHashMapPrint(std::ostream& os) {
1022 PrintOrderedHashTableHeaderAndBuckets(os, *this, "OrderedHashMap");
1023 PrintHashMapContentsFull(os, *this);
1026 void OrderedNameDictionary::OrderedNameDictionaryPrint(std::ostream& os) {
1027 PrintOrderedHashTableHeaderAndBuckets(os, *this, "OrderedNameDictionary");
1028 PrintDictionaryContentsFull(os, *this);
1031 void print_hex_byte(std::ostream& os, int value) {
1032 os << "0x" << std::setfill('0') << std::setw(2) << std::right << std::hex
1036 void SwissNameDictionary::SwissNameDictionaryPrint(std::ostream& os) {
1037 this->PrintHeader(os, "SwissNameDictionary");
1038 os << "\n - meta table ByteArray: "
1040 os << "\n - capacity: " << this->Capacity();
1041 os << "\n - elements: " << this->NumberOfElements();
1042 os << "\n - deleted: " << this->NumberOfDeletedElements();
1044 std::ios_base::fmtflags sav_flags = os.flags();
1045 os << "\n - ctrl table (omitting buckets where key is hole value): {";
1051 os << "\n " << std::setw(12) << std::dec << i << ": ";
1056 print_hex_byte(os, ctrl);
1057 os << " (= kDeleted)";
1060 print_hex_byte(os, ctrl);
1061 os << " (= kSentinel)";
1064 print_hex_byte(os, ctrl);
1065 os << " (= H2 of a key)";
1069 os << "\n }";
1071 os << "\n - enumeration table: {";
1074 os << "\n " << std::setw(12) << std::dec << enum_index << ": " << entry;
1076 os << "\n }";
1078 os << "\n - data table (omitting slots where key is the hole): {";
1085 os << "\n " << std::setw(12) << std::dec << bucket << ": ";
1087 String::cast(k).PrintUC16(os);
1089 os << Brief(k);
1091 os << " -> " << Brief(value);
1092 details.PrintAsSlowTo(os, false);
1094 os << "\n }\n";
1095 os.flags(sav_flags);
1098 void PropertyArray::PropertyArrayPrint(std::ostream& os) {
1099 PrintHeader(os, "PropertyArray");
1100 os << "\n - length: " << length();
1101 os << "\n - hash: " << Hash();
1102 PrintFixedArrayElements(os, *this);
1103 os << "\n";
1106 void FixedDoubleArray::FixedDoubleArrayPrint(std::ostream& os) {
1107 PrintHeader(os, "FixedDoubleArray");
1108 os << "\n - length: " << length();
1109 DoPrintElements<FixedDoubleArray>(os, *this, length());
1110 os << "\n";
1113 void WeakFixedArray::WeakFixedArrayPrint(std::ostream& os) {
1114 PrintHeader(os, "WeakFixedArray");
1115 os << "\n - length: " << length() << "\n";
1116 PrintWeakArrayElements(os, this);
1117 os << "\n";
1120 void WeakArrayList::WeakArrayListPrint(std::ostream& os) {
1121 PrintHeader(os, "WeakArrayList");
1122 os << "\n - capacity: " << capacity();
1123 os << "\n - length: " << length() << "\n";
1124 PrintWeakArrayElements(os, this);
1125 os << "\n";
1128 void TransitionArray::TransitionArrayPrint(std::ostream& os) {
1129 PrintHeader(os, "TransitionArray");
1130 PrintInternal(os);
1133 void FeedbackCell::FeedbackCellPrint(std::ostream& os) {
1134 PrintHeader(os, "FeedbackCell");
1137 os << "\n - no closures";
1139 os << "\n - one closure";
1141 os << "\n - many closures";
1143 os << "\n - Invalid FeedbackCell map";
1145 os << "\n - value: " << Brief(value());
1146 os << "\n - interrupt_budget: " << interrupt_budget();
1147 os << "\n";
1151 StdoutStream os;
1153 FeedbackVectorSpecPrint(os);
1155 os << std::flush;
1158 void FeedbackVectorSpec::FeedbackVectorSpecPrint(std::ostream& os) {
1159 os << " - slot_count: " << slot_count();
1161 os << " (empty)\n";
1169 os << "\n Slot #" << slot << " " << kind;
1172 os << "\n";
1175 void FeedbackMetadata::FeedbackMetadataPrint(std::ostream& os) {
1176 PrintHeader(os, "FeedbackMetadata");
1177 os << "\n - slot_count: " << slot_count();
1178 os << "\n - create_closure_slot_count: " << create_closure_slot_count();
1184 os << "\n Slot " << slot << " " << kind;
1186 os << "\n";
1189 void ClosureFeedbackCellArray::ClosureFeedbackCellArrayPrint(std::ostream& os) {
1190 PrintFixedArrayWithHeader(os, *this, "ClosureFeedbackCellArray");
1193 void FeedbackVector::FeedbackVectorPrint(std::ostream& os) {
1194 PrintHeader(os, "FeedbackVector");
1195 os << "\n - length: " << length();
1197 os << " (empty)\n";
1201 os << "\n - shared function info: " << Brief(shared_function_info());
1203 os << "\n - optimized code: " << Brief(optimized_code());
1205 os << "\n - no optimized code";
1207 os << "\n - tiering state: " << tiering_state();
1208 os << "\n - maybe has optimized code: " << maybe_has_optimized_code();
1209 os << "\n - invocation count: " << invocation_count();
1210 os << "\n - profiler ticks: " << profiler_ticks();
1211 os << "\n - closure feedback cell array: ";
1212 closure_feedback_cell_array().ClosureFeedbackCellArrayPrint(os);
1219 os << "\n - slot " << slot << " " << kind << " ";
1220 FeedbackSlotPrint(os, slot);
1223 if (entry_size > 0) os << " {";
1226 os << "\n [" << slot_with_offset.ToInt()
1229 if (entry_size > 0) os << "\n }";
1231 os << "\n";
1234 void FeedbackVector::FeedbackSlotPrint(std::ostream& os, FeedbackSlot slot) {
1236 nexus.Print(os);
1239 void FeedbackNexus::Print(std::ostream& os) {
1259 os << InlineCacheState2String(ic_state());
1263 os << "BinaryOp:" << GetBinaryOperationFeedback();
1267 os << "CompareOp:" << GetCompareOperationFeedback();
1271 os << "ForIn:" << GetForInFeedback();
1283 void Oddball::OddballPrint(std::ostream& os) {
1284 PrintHeapObjectHeaderWithoutMap(*this, os, "Oddball");
1285 os << ": ";
1287 os << s.PrefixForDebugPrint();
1288 s.PrintUC16(os);
1289 os << s.SuffixForDebugPrint();
1290 os << std::endl;
1293 void JSAsyncFunctionObject::JSAsyncFunctionObjectPrint(std::ostream& os) {
1294 JSGeneratorObjectPrint(os);
1297 void JSAsyncGeneratorObject::JSAsyncGeneratorObjectPrint(std::ostream& os) {
1298 JSGeneratorObjectPrint(os);
1301 void JSArgumentsObject::JSArgumentsObjectPrint(std::ostream& os) {
1302 JSObjectPrint(os);
1305 void JSStringIterator::JSStringIteratorPrint(std::ostream& os) {
1306 JSObjectPrintHeader(os, *this, "JSStringIterator");
1307 os << "\n - string: " << Brief(string());
1308 os << "\n - index: " << index();
1309 JSObjectPrintBody(os, *this);
1312 void JSAsyncFromSyncIterator::JSAsyncFromSyncIteratorPrint(std::ostream& os) {
1313 JSObjectPrintHeader(os, *this, "JSAsyncFromSyncIterator");
1314 os << "\n - sync_iterator: " << Brief(sync_iterator());
1315 os << "\n - next: " << Brief(next());
1316 JSObjectPrintBody(os, *this);
1319 void JSPrimitiveWrapper::JSPrimitiveWrapperPrint(std::ostream& os) {
1320 JSObjectPrintHeader(os, *this, "JSPrimitiveWrapper");
1321 os << "\n - value: " << Brief(value());
1322 JSObjectPrintBody(os, *this);
1325 void JSMessageObject::JSMessageObjectPrint(std::ostream& os) {
1326 JSObjectPrintHeader(os, *this, "JSMessageObject");
1327 os << "\n - type: " << static_cast<int>(type());
1328 os << "\n - arguments: " << Brief(argument());
1329 os << "\n - start_position: " << start_position();
1330 os << "\n - end_position: " << end_position();
1331 os << "\n - script: " << Brief(script());
1332 os << "\n - stack_frames: " << Brief(stack_frames());
1333 JSObjectPrintBody(os, *this);
1336 void String::StringPrint(std::ostream& os) {
1337 PrintHeapObjectHeaderWithoutMap(*this, os, "String");
1338 os << ": ";
1339 os << PrefixForDebugPrint();
1340 PrintUC16(os, 0, length());
1341 os << SuffixForDebugPrint();
1344 void Name::NamePrint(std::ostream& os) {
1346 String::cast(*this).StringPrint(os);
1348 os << Brief(*this);
1355 void JSDate::JSDatePrint(std::ostream& os) {
1356 JSObjectPrintHeader(os, *this, "JSDate");
1357 os << "\n - value: " << Brief(value());
1359 os << "\n - time = NaN\n";
1371 os << buf.begin();
1373 JSObjectPrintBody(os, *this);
1376 void JSSet::JSSetPrint(std::ostream& os) {
1377 JSObjectPrintHeader(os, *this, "JSSet");
1378 os << "\n - table: " << Brief(table());
1379 JSObjectPrintBody(os, *this);
1382 void JSMap::JSMapPrint(std::ostream& os) {
1383 JSObjectPrintHeader(os, *this, "JSMap");
1384 os << "\n - table: " << Brief(table());
1385 JSObjectPrintBody(os, *this);
1388 void JSCollectionIterator::JSCollectionIteratorPrint(std::ostream& os,
1390 JSObjectPrintHeader(os, *this, name);
1391 os << "\n - table: " << Brief(table());
1392 os << "\n - index: " << Brief(index());
1393 JSObjectPrintBody(os, *this);
1396 void JSSetIterator::JSSetIteratorPrint(std::ostream& os) {
1397 JSCollectionIteratorPrint(os, "JSSetIterator");
1400 void JSMapIterator::JSMapIteratorPrint(std::ostream& os) {
1401 JSCollectionIteratorPrint(os, "JSMapIterator");
1404 void JSWeakRef::JSWeakRefPrint(std::ostream& os) {
1405 JSObjectPrintHeader(os, *this, "JSWeakRef");
1406 os << "\n - target: " << Brief(target());
1407 JSObjectPrintBody(os, *this);
1410 void JSShadowRealm::JSShadowRealmPrint(std::ostream& os) {
1411 JSObjectPrintHeader(os, *this, "JSShadowRealm");
1412 os << "\n - native_context: " << Brief(native_context());
1413 JSObjectPrintBody(os, *this);
1416 void JSWrappedFunction::JSWrappedFunctionPrint(std::ostream& os) {
1417 JSObjectPrintHeader(os, *this, "JSWrappedFunction");
1418 os << "\n - wrapped_target_function: " << Brief(wrapped_target_function());
1419 JSObjectPrintBody(os, *this);
1422 void JSFinalizationRegistry::JSFinalizationRegistryPrint(std::ostream& os) {
1423 JSObjectPrintHeader(os, *this, "JSFinalizationRegistry");
1424 os << "\n - native_context: " << Brief(native_context());
1425 os << "\n - cleanup: " << Brief(cleanup());
1426 os << "\n - active_cells: " << Brief(active_cells());
1429 os << "\n - " << Brief(active_cell);
1432 os << "\n - cleared_cells: " << Brief(cleared_cells());
1435 os << "\n - " << Brief(cleared_cell);
1438 os << "\n - key_map: " << Brief(key_map());
1439 JSObjectPrintBody(os, *this);
1442 void JSSharedStruct::JSSharedStructPrint(std::ostream& os) {
1443 JSObjectPrintHeader(os, *this, "JSSharedStruct");
1445 os << "\n - isolate: " << isolate;
1446 if (isolate->is_shared()) os << " (shared)";
1447 JSObjectPrintBody(os, *this);
1450 void JSWeakMap::JSWeakMapPrint(std::ostream& os) {
1451 JSObjectPrintHeader(os, *this, "JSWeakMap");
1452 os << "\n - table: " << Brief(table());
1453 JSObjectPrintBody(os, *this);
1456 void JSWeakSet::JSWeakSetPrint(std::ostream& os) {
1457 JSObjectPrintHeader(os, *this, "JSWeakSet");
1458 os << "\n - table: " << Brief(table());
1459 JSObjectPrintBody(os, *this);
1462 void JSArrayBuffer::JSArrayBufferPrint(std::ostream& os) {
1463 JSObjectPrintHeader(os, *this, "JSArrayBuffer");
1464 os << "\n - backing_store: " << backing_store();
1465 os << "\n - byte_length: " << byte_length();
1466 os << "\n - max_byte_length: " << max_byte_length();
1467 if (is_external()) os << "\n - external";
1468 if (is_detachable()) os << "\n - detachable";
1469 if (was_detached()) os << "\n - detached";
1470 if (is_shared()) os << "\n - shared";
1471 if (is_resizable()) os << "\n - resizable";
1472 JSObjectPrintBody(os, *this, !was_detached());
1475 void JSTypedArray::JSTypedArrayPrint(std::ostream& os) {
1476 JSObjectPrintHeader(os, *this, "JSTypedArray");
1477 os << "\n - buffer: " << Brief(buffer());
1478 os << "\n - byte_offset: " << byte_offset();
1479 os << "\n - byte_length: " << byte_length();
1480 os << "\n - length: " << GetLength();
1481 os << "\n - data_ptr: " << DataPtr();
1483 os << "\n - base_pointer: "
1485 os << "\n - external_pointer: "
1488 os << "\n <invalid buffer>\n";
1491 if (WasDetached()) os << "\n - detached";
1492 if (is_length_tracking()) os << "\n - length-tracking";
1493 if (is_backed_by_rab()) os << "\n - backed-by-rab";
1494 JSObjectPrintBody(os, *this, !WasDetached());
1497 void JSArrayIterator::JSArrayIteratorPrint(std::ostream& os) { // NOLING
1498 JSObjectPrintHeader(os, *this, "JSArrayIterator");
1499 os << "\n - iterated_object: " << Brief(iterated_object());
1500 os << "\n - next_index: " << Brief(next_index());
1501 os << "\n - kind: " << kind();
1502 JSObjectPrintBody(os, *this);
1505 void JSDataView::JSDataViewPrint(std::ostream& os) {
1506 JSObjectPrintHeader(os, *this, "JSDataView");
1507 os << "\n - buffer =" << Brief(buffer());
1508 os << "\n - byte_offset: " << byte_offset();
1509 os << "\n - byte_length: " << byte_length();
1511 os << "\n <invalid buffer>";
1514 if (WasDetached()) os << "\n - detached";
1515 JSObjectPrintBody(os, *this, !WasDetached());
1518 void JSBoundFunction::JSBoundFunctionPrint(std::ostream& os) {
1519 JSObjectPrintHeader(os, *this, "JSBoundFunction");
1520 os << "\n - bound_target_function: " << Brief(bound_target_function());
1521 os << "\n - bound_this: " << Brief(bound_this());
1522 os << "\n - bound_arguments: " << Brief(bound_arguments());
1523 JSObjectPrintBody(os, *this);
1526 void JSFunction::JSFunctionPrint(std::ostream& os) {
1528 JSObjectPrintHeader(os, *this, "Function");
1529 os << "\n - function prototype: ";
1532 os << Brief(prototype());
1534 os << " (non-instance prototype)";
1537 os << "\n - initial_map: ";
1538 if (has_initial_map()) os << Brief(initial_map());
1540 os << "<no-prototype-slot>";
1542 os << "\n - shared_info: " << Brief(shared());
1543 os << "\n - name: " << Brief(shared().Name());
1548 os << "\n - builtin: " << isolate->builtins()->name(builtin);
1551 os << "\n - formal_parameter_count: "
1553 os << "\n - kind: " << shared().kind();
1554 os << "\n - context: " << Brief(context());
1555 os << "\n - code: " << Brief(code());
1557 os << "\n - FOR_TESTING";
1559 os << "\n - interpreted";
1561 os << "\n - bytecode: " << shared().GetBytecodeArray(isolate);
1567 os << "\n - Wasm instance: " << Brief(function.instance());
1568 os << "\n - Wasm function index: " << function.function_index();
1572 os << "\n - Wasm wrapper around: " << Brief(function.GetCallable());
1575 shared().PrintSourceCode(os);
1576 JSObjectPrintBody(os, *this);
1577 os << " - feedback vector: ";
1579 os << "feedback metadata is not available in SFI\n";
1581 feedback_vector().FeedbackVectorPrint(os);
1583 os << "No feedback vector, but we have a closure feedback cell array\n";
1584 closure_feedback_cell_array().ClosureFeedbackCellArrayPrint(os);
1586 os << "not available\n";
1590 void SharedFunctionInfo::PrintSourceCode(std::ostream& os) {
1592 os << "\n - source code: ";
1598 os << source_string.get();
1602 void SharedFunctionInfo::SharedFunctionInfoPrint(std::ostream& os) {
1603 PrintHeader(os, "SharedFunctionInfo");
1604 os << "\n - name: ";
1606 os << Brief(Name());
1608 os << "<no-shared-name>";
1611 os << "\n - inferred name: " << Brief(inferred_name());
1614 os << "\n - class_scope_has_private_brand";
1617 os << "\n - has_static_private_methods_or_accessors";
1620 os << "\n - private_name_lookup_skips_outer_class";
1622 os << "\n - kind: " << kind();
1623 os << "\n - syntax kind: " << syntax_kind();
1624 os << "\n - function_map_index: " << function_map_index();
1625 os << "\n - formal_parameter_count: "
1627 os << "\n - expected_nof_properties: " << expected_nof_properties();
1628 os << "\n - language_mode: " << language_mode();
1629 os << "\n - data: " << Brief(function_data(kAcquireLoad));
1630 os << "\n - code (from data): ";
1631 os << Brief(GetCode());
1632 PrintSourceCode(os);
1634 os << "\n - script: " << Brief(script());
1635 os << "\n - function token position: " << function_token_position();
1636 os << "\n - start position: " << StartPosition();
1637 os << "\n - end position: " << EndPosition();
1639 os << "\n - debug info: " << Brief(GetDebugInfo());
1641 os << "\n - no debug info";
1643 os << "\n - scope info: " << Brief(scope_info());
1645 os << "\n - outer scope info: " << Brief(GetOuterScopeInfo());
1647 os << "\n - length: " << length();
1648 os << "\n - feedback_metadata: ";
1650 feedback_metadata().FeedbackMetadataPrint(os);
1652 os << "<none>";
1654 os << "\n";
1657 void JSGlobalProxy::JSGlobalProxyPrint(std::ostream& os) {
1658 JSObjectPrintHeader(os, *this, "JSGlobalProxy");
1660 os << "\n - native context: " << Brief(native_context());
1662 JSObjectPrintBody(os, *this);
1665 void JSGlobalObject::JSGlobalObjectPrint(std::ostream& os) {
1666 JSObjectPrintHeader(os, *this, "JSGlobalObject");
1668 os << "\n - native context: " << Brief(native_context());
1670 os << "\n - global proxy: " << Brief(global_proxy());
1671 JSObjectPrintBody(os, *this);
1674 void PropertyCell::PropertyCellPrint(std::ostream& os) {
1675 PrintHeader(os, "PropertyCell");
1676 os << "\n - name: ";
1677 name().NamePrint(os);
1678 os << "\n - value: " << Brief(value(kAcquireLoad));
1679 os << "\n - details: ";
1681 details.PrintAsSlowTo(os, true);
1682 os << "\n - cell_type: " << details.cell_type();
1683 os << "\n";
1686 void Code::CodePrint(std::ostream& os) {
1687 PrintHeader(os, "Code");
1688 os << "\n - code_data_container: "
1691 os << "\n - builtin_id: " << Builtins::name(builtin_id());
1693 os << "\n";
1695 Disassemble(nullptr, os, GetIsolate());
1699 void CodeDataContainer::CodeDataContainerPrint(std::ostream& os) {
1700 PrintHeader(os, "CodeDataContainer");
1701 os << "\n - kind_specific_flags: " << kind_specific_flags(kRelaxedLoad);
1703 os << "\n - code: " << Brief(code());
1704 os << "\n - code_entry_point: "
1707 os << "\n";
1710 void Foreign::ForeignPrint(std::ostream& os) {
1711 PrintHeader(os, "Foreign");
1712 os << "\n - foreign address : " << reinterpret_cast<void*>(foreign_address());
1713 os << "\n";
1716 void AsyncGeneratorRequest::AsyncGeneratorRequestPrint(std::ostream& os) {
1717 PrintHeader(os, "AsyncGeneratorRequest");
1730 os << "\n - resume mode: " << mode;
1731 os << "\n - value: " << Brief(value());
1732 os << "\n - next: " << Brief(next());
1733 os << "\n";
1736 static void PrintModuleFields(Module module, std::ostream& os) {
1737 os << "\n - exports: " << Brief(module.exports());
1738 os << "\n - status: " << module.status();
1739 os << "\n - exception: " << Brief(module.exception());
1742 void Module::ModulePrint(std::ostream& os) {
1744 SourceTextModule::cast(*this).SourceTextModulePrint(os);
1746 SyntheticModule::cast(*this).SyntheticModulePrint(os);
1752 void SourceTextModule::SourceTextModulePrint(std::ostream& os) {
1753 PrintHeader(os, "SourceTextModule");
1754 PrintModuleFields(*this, os);
1755 os << "\n - sfi/code/info: " << Brief(code());
1757 os << "\n - script: " << Brief(script);
1758 os << "\n - origin: " << Brief(script.GetNameOrSourceURL());
1759 os << "\n - requested_modules: " << Brief(requested_modules());
1760 os << "\n - import_meta: " << Brief(import_meta(kAcquireLoad));
1761 os << "\n - cycle_root: " << Brief(cycle_root());
1762 os << "\n - async_evaluating_ordinal: " << async_evaluating_ordinal();
1763 os << "\n";
1766 void JSModuleNamespace::JSModuleNamespacePrint(std::ostream& os) {
1767 JSObjectPrintHeader(os, *this, "JSModuleNamespace");
1768 os << "\n - module: " << Brief(module());
1769 JSObjectPrintBody(os, *this);
1772 void PrototypeInfo::PrototypeInfoPrint(std::ostream& os) {
1773 PrintHeader(os, "PrototypeInfo");
1774 os << "\n - module namespace: " << Brief(module_namespace());
1775 os << "\n - prototype users: " << Brief(prototype_users());
1776 os << "\n - registry slot: " << registry_slot();
1777 os << "\n - object create map: " << Brief(object_create_map());
1778 os << "\n - should_be_fast_map: " << should_be_fast_map();
1779 os << "\n";
1783 std::ostream& os) {
1784 PrintHeader(os, "ArrayBoilerplateDescription");
1785 os << "\n - elements kind: " << ElementsKindToString(elements_kind());
1786 os << "\n - constant elements: " << Brief(constant_elements());
1787 os << "\n";
1791 void AsmWasmData::AsmWasmDataPrint(std::ostream& os) {
1792 PrintHeader(os, "AsmWasmData");
1793 os << "\n - native module: " << Brief(managed_native_module());
1794 os << "\n - export_wrappers: " << Brief(export_wrappers());
1795 os << "\n - uses bitset: " << uses_bitset().value();
1796 os << "\n";
1799 void WasmTypeInfo::WasmTypeInfoPrint(std::ostream& os) {
1800 PrintHeader(os, "WasmTypeInfo");
1801 os << "\n - type address: " << reinterpret_cast<void*>(foreign_address());
1802 os << "\n - supertypes: " << Brief(supertypes());
1803 os << "\n - subtypes: " << Brief(subtypes());
1804 os << "\n - instance: " << Brief(instance());
1805 os << "\n";
1808 void WasmStruct::WasmStructPrint(std::ostream& os) {
1809 PrintHeader(os, "WasmStruct");
1811 os << "\n - fields (" << struct_type->field_count() << "):";
1814 os << "\n - " << field.short_name() << ": ";
1819 os << base::ReadUnalignedValue<int32_t>(field_address);
1822 os << base::ReadUnalignedValue<int64_t>(field_address);
1825 os << base::ReadUnalignedValue<float>(field_address);
1828 os << base::ReadUnalignedValue<double>(field_address);
1831 os << base::ReadUnalignedValue<int8_t>(field_address);
1834 os << base::ReadUnalignedValue<int16_t>(field_address);
1845 os << Brief(Object(obj));
1849 os << "UNIMPLEMENTED"; // TODO(7748): Implement.
1856 os << "\n";
1859 void WasmArray::WasmArrayPrint(std::ostream& os) {
1860 PrintHeader(os, "WasmArray");
1863 os << "\n - type: " << array_type->element_type().name();
1864 os << "\n - length: " << len;
1868 PrintTypedArrayElements(os, reinterpret_cast<int32_t*>(data_ptr), len,
1872 PrintTypedArrayElements(os, reinterpret_cast<int64_t*>(data_ptr), len,
1876 PrintTypedArrayElements(os, reinterpret_cast<float*>(data_ptr), len,
1880 PrintTypedArrayElements(os, reinterpret_cast<double*>(data_ptr), len,
1884 PrintTypedArrayElements(os, reinterpret_cast<int8_t*>(data_ptr), len,
1888 PrintTypedArrayElements(os, reinterpret_cast<int16_t*>(data_ptr), len,
1895 os << "\n Printing elements of this type is unimplemented, sorry";
1902 os << "\n";
1905 void WasmContinuationObject::WasmContinuationObjectPrint(std::ostream& os) {
1906 PrintHeader(os, "WasmContinuationObject");
1907 os << "\n - parent: " << parent();
1908 os << "\n - jmpbuf: " << jmpbuf();
1909 os << "\n - stack: " << stack();
1910 os << "\n";
1913 void WasmSuspenderObject::WasmSuspenderObjectPrint(std::ostream& os) {
1914 PrintHeader(os, "WasmSuspenderObject");
1915 os << "\n - continuation: " << continuation();
1916 os << "\n - parent: " << parent();
1917 os << "\n - state: " << state();
1918 os << "\n";
1921 void WasmInstanceObject::WasmInstanceObjectPrint(std::ostream& os) {
1922 JSObjectPrintHeader(os, *this, "WasmInstanceObject");
1923 os << "\n - module_object: " << Brief(module_object());
1924 os << "\n - exports_object: " << Brief(exports_object());
1925 os << "\n - native_context: " << Brief(native_context());
1927 os << "\n - memory_object: " << Brief(memory_object());
1930 os << "\n - untagged_globals_buffer: " << Brief(untagged_globals_buffer());
1933 os << "\n - tagged_globals_buffer: " << Brief(tagged_globals_buffer());
1936 os << "\n - imported_mutable_globals_buffers: "
1940 os << "\n - table " << i << ": " << Brief(tables().get(i));
1942 os << "\n - imported_function_refs: " << Brief(imported_function_refs());
1944 os << "\n - indirect_function_table_refs: "
1948 os << "\n - managed_native_allocations: "
1952 os << "\n - tags table: " << Brief(tags_table());
1954 os << "\n - managed object maps: " << Brief(managed_object_maps());
1955 os << "\n - feedback vectors: " << Brief(feedback_vectors());
1956 os << "\n - memory_start: " << static_cast<void*>(memory_start());
1957 os << "\n - memory_size: " << memory_size();
1958 os << "\n - imported_function_targets: "
1960 os << "\n - globals_start: " << static_cast<void*>(globals_start());
1961 os << "\n - imported_mutable_globals: "
1963 os << "\n - indirect_function_table_size: " << indirect_function_table_size();
1964 os << "\n - indirect_function_table_sig_ids: "
1966 os << "\n - indirect_function_table_targets: "
1968 JSObjectPrintBody(os, *this);
1969 os << "\n";
1973 void WasmFunctionData::WasmFunctionDataPrint(std::ostream& os) {
1974 os << "\n - internal: " << Brief(internal());
1975 os << "\n - wrapper_code: " << Brief(TorqueGeneratedClass::wrapper_code());
1978 void WasmExportedFunctionData::WasmExportedFunctionDataPrint(std::ostream& os) {
1979 PrintHeader(os, "WasmExportedFunctionData");
1980 WasmFunctionDataPrint(os);
1981 os << "\n - instance: " << Brief(instance());
1982 os << "\n - function_index: " << function_index();
1983 os << "\n - signature: " << Brief(signature());
1984 os << "\n - wrapper_budget: " << wrapper_budget();
1985 os << "\n - suspender: " << suspender();
1986 os << "\n";
1989 void WasmJSFunctionData::WasmJSFunctionDataPrint(std::ostream& os) {
1990 PrintHeader(os, "WasmJSFunctionData");
1991 WasmFunctionDataPrint(os);
1992 os << "\n - serialized_return_count: " << serialized_return_count();
1993 os << "\n - serialized_parameter_count: " << serialized_parameter_count();
1994 os << "\n - serialized_signature: " << Brief(serialized_signature());
1995 os << "\n";
1998 void WasmOnFulfilledData::WasmOnFulfilledDataPrint(std::ostream& os) {
1999 PrintHeader(os, "WasmOnFulfilledData");
2000 os << "\n - suspender: " << Brief(suspender());
2001 os << '\n';
2004 void WasmApiFunctionRef::WasmApiFunctionRefPrint(std::ostream& os) {
2005 PrintHeader(os, "WasmApiFunctionRef");
2006 os << "\n - isolate_root: " << reinterpret_cast<void*>(isolate_root());
2007 os << "\n - native_context: " << Brief(native_context());
2008 os << "\n - callable: " << Brief(callable());
2009 os << "\n - suspender: " << Brief(suspender());
2010 os << "\n";
2013 void WasmInternalFunction::WasmInternalFunctionPrint(std::ostream& os) {
2014 PrintHeader(os, "WasmInternalFunction");
2015 os << "\n - call target: " << reinterpret_cast<void*>(foreign_address());
2016 os << "\n - ref: " << Brief(ref());
2017 os << "\n - external: " << Brief(external());
2018 os << "\n - code: " << Brief(code());
2019 os << "\n";
2022 void WasmCapiFunctionData::WasmCapiFunctionDataPrint(std::ostream& os) {
2023 PrintHeader(os, "WasmCapiFunctionData");
2024 WasmFunctionDataPrint(os);
2025 os << "\n - embedder_data: " << Brief(embedder_data());
2026 os << "\n - serialized_signature: " << Brief(serialized_signature());
2027 os << "\n";
2030 void WasmModuleObject::WasmModuleObjectPrint(std::ostream& os) {
2031 PrintHeader(os, "WasmModuleObject");
2032 os << "\n - module: " << module();
2033 os << "\n - native module: " << native_module();
2034 os << "\n - export wrappers: " << Brief(export_wrappers());
2035 os << "\n - script: " << Brief(script());
2036 os << "\n";
2039 void WasmGlobalObject::WasmGlobalObjectPrint(std::ostream& os) {
2040 PrintHeader(os, "WasmGlobalObject");
2042 os << "\n - tagged_buffer: " << Brief(tagged_buffer());
2044 os << "\n - untagged_buffer: " << Brief(untagged_buffer());
2046 os << "\n - offset: " << offset();
2047 os << "\n - raw_type: " << raw_type();
2048 os << "\n - is_mutable: " << is_mutable();
2049 os << "\n - type: " << type();
2050 os << "\n - is_mutable: " << is_mutable();
2051 os << "\n";
2055 std::ostream& os) {
2056 PrintHeader(os, "WasmIndirectFunctionTable");
2057 os << "\n - size: " << size();
2058 os << "\n - sig_ids: " << static_cast<void*>(sig_ids());
2059 os << "\n - targets: " << static_cast<void*>(targets());
2061 os << "\n - managed_native_allocations: "
2064 os << "\n - refs: " << Brief(refs());
2065 os << "\n";
2068 void WasmValueObject::WasmValueObjectPrint(std::ostream& os) {
2069 PrintHeader(os, "WasmValueObject");
2070 os << "\n - value: " << Brief(value());
2071 os << "\n";
2075 void LoadHandler::LoadHandlerPrint(std::ostream& os) {
2076 PrintHeader(os, "LoadHandler");
2078 os << "\n - handler: " << Brief(smi_handler());
2079 os << "\n - validity_cell: " << Brief(validity_cell());
2082 os << "\n - data1: " << Brief(data1());
2085 os << "\n - data2: " << Brief(data2());
2088 os << "\n - data3: " << Brief(data3());
2090 os << "\n";
2093 void StoreHandler::StoreHandlerPrint(std::ostream& os) {
2094 PrintHeader(os, "StoreHandler");
2096 os << "\n - handler: " << Brief(smi_handler());
2097 os << "\n - validity_cell: " << Brief(validity_cell());
2100 os << "\n - data1: " << Brief(data1());
2103 os << "\n - data2: " << Brief(data2());
2106 os << "\n - data3: " << Brief(data3());
2108 os << "\n";
2111 void CallHandlerInfo::CallHandlerInfoPrint(std::ostream& os) {
2112 PrintHeader(os, "CallHandlerInfo");
2113 os << "\n - callback: " << Brief(callback());
2114 os << "\n - js_callback: " << Brief(js_callback());
2115 os << "\n - data: " << Brief(data());
2116 os << "\n - side_effect_free: "
2118 os << "\n";
2121 void FunctionTemplateInfo::FunctionTemplateInfoPrint(std::ostream& os) {
2122 PrintHeader(os, "FunctionTemplateInfo");
2123 os << "\n - class name: " << Brief(class_name());
2124 os << "\n - tag: " << tag();
2125 os << "\n - serial_number: " << serial_number();
2126 os << "\n - property_list: " << Brief(property_list());
2127 os << "\n - call_code: " << Brief(call_code(kAcquireLoad));
2128 os << "\n - property_accessors: " << Brief(property_accessors());
2129 os << "\n - signature: " << Brief(signature());
2130 os << "\n - cached_property_name: " << Brief(cached_property_name());
2131 os << "\n - undetectable: " << (undetectable() ? "true" : "false");
2132 os << "\n - need_access_check: " << (needs_access_check() ? "true" : "false");
2133 os << "\n - instantiated: " << (instantiated() ? "true" : "false");
2134 os << "\n - rare_data: " << Brief(rare_data(kAcquireLoad));
2135 os << "\n";
2138 void ObjectTemplateInfo::ObjectTemplateInfoPrint(std::ostream& os) {
2139 PrintHeader(os, "ObjectTemplateInfo");
2140 os << "\n - tag: " << tag();
2141 os << "\n - serial_number: " << serial_number();
2142 os << "\n - property_list: " << Brief(property_list());
2143 os << "\n - property_accessors: " << Brief(property_accessors());
2144 os << "\n - constructor: " << Brief(constructor());
2145 os << "\n - embedder_field_count: " << embedder_field_count();
2146 os << "\n - immutable_proto: " << (immutable_proto() ? "true" : "false");
2147 os << "\n";
2150 void AllocationSite::AllocationSitePrint(std::ostream& os) {
2151 PrintHeader(os, "AllocationSite");
2152 if (this->HasWeakNext()) os << "\n - weak_next: " << Brief(weak_next());
2153 os << "\n - dependent code: " << Brief(dependent_code());
2154 os << "\n - nested site: " << Brief(nested_site());
2155 os << "\n - memento found count: "
2157 os << "\n - memento create count: "
2159 os << "\n - pretenure decision: "
2161 os << "\n - transition_info: ";
2164 os << "Array allocation with ElementsKind " << ElementsKindToString(kind);
2166 os << "Array literal with boilerplate " << Brief(boilerplate());
2168 os << "Object literal with boilerplate " << Brief(boilerplate());
2170 os << "\n";
2173 void AllocationMemento::AllocationMementoPrint(std::ostream& os) {
2174 PrintHeader(os, "AllocationMemento");
2175 os << "\n - allocation site: ";
2177 GetAllocationSite().AllocationSitePrint(os);
2179 os << "<invalid>\n";
2183 void ScriptOrModule::ScriptOrModulePrint(std::ostream& os) {
2184 PrintHeader(os, "ScriptOrModule");
2185 os << "\n - host_defined_options: " << Brief(host_defined_options());
2186 os << "\n - resource_name: " << Brief(resource_name());
2189 void Script::ScriptPrint(std::ostream& os) {
2190 PrintHeader(os, "Script");
2191 os << "\n - source: " << Brief(source());
2192 os << "\n - name: " << Brief(name());
2193 os << "\n - source_url: " << Brief(source_url());
2194 os << "\n - line_offset: " << line_offset();
2195 os << "\n - column_offset: " << column_offset();
2196 os << "\n - type: " << type();
2197 os << "\n - id: " << id();
2198 os << "\n - context data: " << Brief(context_data());
2199 os << "\n - compilation type: " << compilation_type();
2200 os << "\n - line ends: " << Brief(line_ends());
2205 os << "\n - wasm_breakpoint_infos: " << Brief(wasm_breakpoint_infos());
2211 os << "\n - eval from shared: " << Brief(eval_from_shared());
2213 os << "\n - wrapped arguments: " << Brief(wrapped_arguments());
2215 os << "\n - shared function info table: "
2218 os << "\n - eval from position: " << eval_from_position();
2220 os << "\n - shared function infos: " << Brief(shared_function_infos());
2221 os << "\n";
2224 void JSTemporalPlainDate::JSTemporalPlainDatePrint(std::ostream& os) {
2225 JSObjectPrintHeader(os, *this, "JSTemporalPlainDate");
2226 JSObjectPrintBody(os, *this);
2229 void JSTemporalPlainTime::JSTemporalPlainTimePrint(std::ostream& os) {
2230 JSObjectPrintHeader(os, *this, "JSTemporalPlainTime");
2231 JSObjectPrintBody(os, *this);
2234 void JSTemporalPlainDateTime::JSTemporalPlainDateTimePrint(std::ostream& os) {
2235 JSObjectPrintHeader(os, *this, "JSTemporalPlainDateTime");
2236 JSObjectPrintBody(os, *this);
2239 void JSTemporalZonedDateTime::JSTemporalZonedDateTimePrint(std::ostream& os) {
2240 JSObjectPrintHeader(os, *this, "JSTemporalZonedDateTime");
2241 JSObjectPrintBody(os, *this);
2244 void JSTemporalDuration::JSTemporalDurationPrint(std::ostream& os) {
2245 JSObjectPrintHeader(os, *this, "JSTemporalDuration");
2246 JSObjectPrintBody(os, *this);
2249 void JSTemporalInstant::JSTemporalInstantPrint(std::ostream& os) {
2250 JSObjectPrintHeader(os, *this, "JSTemporalInstant");
2251 JSObjectPrintBody(os, *this);
2254 void JSTemporalPlainYearMonth::JSTemporalPlainYearMonthPrint(std::ostream& os) {
2255 JSObjectPrintHeader(os, *this, "JSTemporalPlainYearMonth");
2256 JSObjectPrintBody(os, *this);
2259 void JSTemporalPlainMonthDay::JSTemporalPlainMonthDayPrint(std::ostream& os) {
2260 JSObjectPrintHeader(os, *this, "JSTemporalPlainMonthDay");
2261 JSObjectPrintBody(os, *this);
2264 void JSTemporalTimeZone::JSTemporalTimeZonePrint(std::ostream& os) {
2265 JSObjectPrintHeader(os, *this, "JSTemporalTimeZone");
2266 JSObjectPrintBody(os, *this);
2269 void JSTemporalCalendar::JSTemporalCalendarPrint(std::ostream& os) {
2270 JSObjectPrintHeader(os, *this, "JSTemporalCalendar");
2271 JSObjectPrintBody(os, *this);
2274 void JSV8BreakIterator::JSV8BreakIteratorPrint(std::ostream& os) {
2275 JSObjectPrintHeader(os, *this, "JSV8BreakIterator");
2276 os << "\n - locale: " << Brief(locale());
2277 os << "\n - break iterator: " << Brief(break_iterator());
2278 os << "\n - unicode string: " << Brief(unicode_string());
2279 os << "\n - bound adopt text: " << Brief(bound_adopt_text());
2280 os << "\n - bound first: " << Brief(bound_first());
2281 os << "\n - bound next: " << Brief(bound_next());
2282 os << "\n - bound current: " << Brief(bound_current());
2283 os << "\n - bound break type: " << Brief(bound_break_type());
2284 os << "\n";
2287 void JSCollator::JSCollatorPrint(std::ostream& os) {
2288 JSObjectPrintHeader(os, *this, "JSCollator");
2289 os << "\n - icu collator: " << Brief(icu_collator());
2290 os << "\n - bound compare: " << Brief(bound_compare());
2291 JSObjectPrintBody(os, *this);
2294 void JSDateTimeFormat::JSDateTimeFormatPrint(std::ostream& os) {
2295 JSObjectPrintHeader(os, *this, "JSDateTimeFormat");
2296 os << "\n - locale: " << Brief(locale());
2297 os << "\n - icu locale: " << Brief(icu_locale());
2298 os << "\n - icu simple date format: " << Brief(icu_simple_date_format());
2299 os << "\n - icu date interval format: " << Brief(icu_date_interval_format());
2300 os << "\n - bound format: " << Brief(bound_format());
2301 os << "\n - hour cycle: " << HourCycleAsString();
2302 JSObjectPrintBody(os, *this);
2305 void JSDisplayNames::JSDisplayNamesPrint(std::ostream& os) {
2306 JSObjectPrintHeader(os, *this, "JSDisplayNames");
2307 os << "\n - internal: " << Brief(internal());
2308 os << "\n - style: " << StyleAsString();
2309 os << "\n - fallback: " << FallbackAsString();
2310 JSObjectPrintBody(os, *this);
2313 void JSListFormat::JSListFormatPrint(std::ostream& os) {
2314 JSObjectPrintHeader(os, *this, "JSListFormat");
2315 os << "\n - locale: " << Brief(locale());
2316 os << "\n - style: " << StyleAsString();
2317 os << "\n - type: " << TypeAsString();
2318 os << "\n - icu formatter: " << Brief(icu_formatter());
2319 JSObjectPrintBody(os, *this);
2322 void JSLocale::JSLocalePrint(std::ostream& os) {
2323 JSObjectPrintHeader(os, *this, "JSLocale");
2324 os << "\n - icu locale: " << Brief(icu_locale());
2325 JSObjectPrintBody(os, *this);
2328 void JSNumberFormat::JSNumberFormatPrint(std::ostream& os) {
2329 JSObjectPrintHeader(os, *this, "JSNumberFormat");
2330 os << "\n - locale: " << Brief(locale());
2331 os << "\n - icu_number_formatter: " << Brief(icu_number_formatter());
2332 os << "\n - bound_format: " << Brief(bound_format());
2333 JSObjectPrintBody(os, *this);
2336 void JSPluralRules::JSPluralRulesPrint(std::ostream& os) {
2337 JSObjectPrintHeader(os, *this, "JSPluralRules");
2338 os << "\n - locale: " << Brief(locale());
2339 os << "\n - type: " << TypeAsString();
2340 os << "\n - icu plural rules: " << Brief(icu_plural_rules());
2341 os << "\n - icu_number_formatter: " << Brief(icu_number_formatter());
2342 JSObjectPrintBody(os, *this);
2345 void JSRelativeTimeFormat::JSRelativeTimeFormatPrint(std::ostream& os) {
2346 JSObjectPrintHeader(os, *this, "JSRelativeTimeFormat");
2347 os << "\n - locale: " << Brief(locale());
2348 os << "\n - numberingSystem: " << Brief(numberingSystem());
2349 os << "\n - numeric: " << NumericAsString();
2350 os << "\n - icu formatter: " << Brief(icu_formatter());
2351 os << "\n";
2354 void JSSegmentIterator::JSSegmentIteratorPrint(std::ostream& os) {
2355 JSObjectPrintHeader(os, *this, "JSSegmentIterator");
2356 os << "\n - icu break iterator: " << Brief(icu_break_iterator());
2357 os << "\n - granularity: " << GranularityAsString(GetIsolate());
2358 os << "\n";
2361 void JSSegmenter::JSSegmenterPrint(std::ostream& os) {
2362 JSObjectPrintHeader(os, *this, "JSSegmenter");
2363 os << "\n - locale: " << Brief(locale());
2364 os << "\n - granularity: " << GranularityAsString(GetIsolate());
2365 os << "\n - icu break iterator: " << Brief(icu_break_iterator());
2366 JSObjectPrintBody(os, *this);
2369 void JSSegments::JSSegmentsPrint(std::ostream& os) {
2370 JSObjectPrintHeader(os, *this, "JSSegments");
2371 os << "\n - icu break iterator: " << Brief(icu_break_iterator());
2372 os << "\n - unicode string: " << Brief(unicode_string());
2373 os << "\n - granularity: " << GranularityAsString(GetIsolate());
2374 JSObjectPrintBody(os, *this);
2379 void PrintScopeInfoList(ScopeInfo scope_info, std::ostream& os,
2383 os << "\n - " << list_name;
2384 os << " {\n";
2386 os << " - " << it->index() << ": " << it->name() << "\n";
2388 os << " }";
2392 void ScopeInfo::ScopeInfoPrint(std::ostream& os) {
2393 PrintHeader(os, "ScopeInfo");
2395 os << "\n - empty\n";
2400 os << "\n - parameters: " << ParameterCount();
2401 os << "\n - context locals : " << ContextLocalCount();
2403 os << "\n - inlined local names";
2405 os << "\n - local names in a hashtable: "
2409 os << "\n - scope type: " << scope_type();
2410 if (SloppyEvalCanExtendVars()) os << "\n - sloppy eval";
2411 os << "\n - language mode: " << language_mode();
2412 if (is_declaration_scope()) os << "\n - declaration scope";
2414 os << "\n - receiver: " << ReceiverVariableBits::decode(flags);
2416 if (ClassScopeHasPrivateBrand()) os << "\n - class scope has private brand";
2417 if (HasSavedClassVariable()) os << "\n - has saved class variable";
2418 if (HasNewTarget()) os << "\n - needs new target";
2420 os << "\n - function name(" << FunctionVariableBits::decode(flags) << "): ";
2421 FunctionName().ShortPrint(os);
2423 if (IsAsmModule()) os << "\n - asm module";
2424 if (HasSimpleParameters()) os << "\n - simple parameters";
2426 os << "\n - private name lookup skips outer class";
2427 os << "\n - function kind: " << function_kind();
2429 os << "\n - outer scope info: " << Brief(OuterScopeInfo());
2432 os << "\n - locals blocklist: " << Brief(LocalsBlockList());
2435 os << "\n - function name: " << Brief(FunctionName());
2438 os << "\n - inferred function name: " << Brief(InferredFunctionName());
2441 os << "\n - has context extension slot";
2445 os << "\n - start position: " << StartPosition();
2446 os << "\n - end position: " << EndPosition();
2448 os << "\n - length: " << length();
2450 PrintScopeInfoList(*this, os, "context slots", ContextLocalCount());
2453 os << "\n";
2456 void PreparseData::PreparseDataPrint(std::ostream& os) {
2457 PrintHeader(os, "PreparseData");
2458 os << "\n - data_length: " << data_length();
2459 os << "\n - children_length: " << children_length();
2461 os << "\n - data-start: " << (address() + kDataStartOffset);
2464 os << "\n - children-start: " << inner_start_offset();
2467 os << "\n - [" << i << "]: " << Brief(get_child(i));
2469 os << "\n";
2474 StdoutStream os;
2475 this->Print(os);
2476 os << std::flush;
2480 void TaggedImpl<kRefType, StorageType>::Print(std::ostream& os) {
2484 smi.SmiPrint(os);
2486 os << "[cleared]";
2488 os << "[weak] ";
2489 heap_object.HeapObjectPrint(os);
2491 heap_object.HeapObjectPrint(os);
2497 void HeapNumber::HeapNumberPrint(std::ostream& os) {
2498 HeapNumberShortPrint(os);
2499 os << "\n";
2504 void HeapNumber::HeapNumberShortPrint(std::ostream& os) {
2517 os << i << ".0";
2519 os << val;
2554 void Map::PrintMapDetails(std::ostream& os) {
2556 this->MapPrint(os);
2557 instance_descriptors().PrintDescriptors(os);
2560 void Map::MapPrint(std::ostream& os) {
2562 PrintHeader(os, "Map");
2564 os << "Map=" << reinterpret_cast<void*>(ptr());
2566 os << "\n - type: " << instance_type();
2567 os << "\n - instance size: ";
2569 os << "variable";
2571 os << instance_size();
2574 os << "\n - inobject properties: " << GetInObjectProperties();
2576 os << "\n - elements kind: " << ElementsKindToString(elements_kind());
2577 os << "\n - unused property fields: " << UnusedPropertyFields();
2578 os << "\n - enum length: ";
2580 os << "invalid";
2582 os << EnumLength();
2584 if (is_deprecated()) os << "\n - deprecated_map";
2585 if (is_stable()) os << "\n - stable_map";
2586 if (is_migration_target()) os << "\n - migration_target";
2587 if (is_dictionary_map()) os << "\n - dictionary_map";
2588 if (has_named_interceptor()) os << "\n - named_interceptor";
2589 if (has_indexed_interceptor()) os << "\n - indexed_interceptor";
2590 if (may_have_interesting_symbols()) os << "\n - may_have_interesting_symbols";
2591 if (is_undetectable()) os << "\n - undetectable";
2592 if (is_callable()) os << "\n - callable";
2593 if (is_constructor()) os << "\n - constructor";
2595 os << "\n - has_prototype_slot";
2596 if (has_non_instance_prototype()) os << " (non-instance prototype)";
2598 if (is_access_check_needed()) os << "\n - access_check_needed";
2599 if (!is_extensible()) os << "\n - non-extensible";
2601 os << "\n - native context: " << Brief(native_context());
2603 os << "\n - prototype_map";
2604 os << "\n - prototype info: " << Brief(prototype_info());
2606 os << "\n - back pointer: " << Brief(GetBackPointer());
2608 os << "\n - prototype_validity cell: " << Brief(prototype_validity_cell());
2609 os << "\n - instance descriptors " << (owns_descriptors() ? "(own) " : "")
2620 os << "\n - transitions #" << nof_transitions << ": ";
2624 os << Brief(smi);
2626 os << Brief(heap_object);
2629 transitions.PrintTransitions(os);
2633 os << "\n - prototype: " << Brief(prototype());
2635 os << "\n - constructor: " << Brief(GetConstructor());
2637 os << "\n - dependent code: " << Brief(dependent_code());
2638 os << "\n - construction counter: " << construction_counter();
2639 os << "\n";
2642 void DescriptorArray::PrintDescriptors(std::ostream& os) {
2645 os << "\n [" << i.as_int() << "]: ";
2647 key.NamePrint(os);
2649 key.ShortPrint(os);
2651 os << " ";
2652 PrintDescriptorDetails(os, i, PropertyDetails::kPrintFull);
2654 os << "\n";
2657 void DescriptorArray::PrintDescriptorDetails(std::ostream& os,
2661 details.PrintAsFastTo(os, mode);
2662 os << " @ ";
2666 field_type.PrintTo(os);
2671 os << Brief(value);
2674 os << "(get: " << Brief(pair.getter())
2697 void TransitionsAccessor::PrintOneTransition(std::ostream& os, Name key,
2699 os << "\n ";
2701 key.NamePrint(os);
2703 key.ShortPrint(os);
2705 os << ": ";
2708 os << "(transition to non-extensible)";
2710 os << "(transition to sealed)";
2712 os << "(transition to frozen)";
2714 os << "(transition to " << ElementsKindToString(target.elements_kind())
2717 os << " (transition to strict function)";
2720 os << "(transition to ";
2723 descriptors.PrintDescriptorDetails(os, descriptor,
2725 os << ")";
2727 os << " -> " << Brief(target);
2730 void TransitionArray::PrintInternal(std::ostream& os) {
2732 os << "Transition array #" << num_transitions << ":";
2736 TransitionsAccessor::PrintOneTransition(os, key, target);
2738 os << "\n" << std::flush;
2741 void TransitionsAccessor::PrintTransitions(std::ostream& os) {
2750 PrintOneTransition(os, key, target);
2754 return transitions().PrintInternal(os);
2759 StdoutStream os;
2760 os << "map= " << Brief(map_);
2762 PrintTransitionTree(os, 0, &no_gc);
2763 os << "\n" << std::flush;
2767 std::ostream& os, int level, DisallowGarbageCollection* no_gc) {
2774 os << std::endl
2778 os << std::left << std::setw(50) << ss.str() << ": ";
2781 os << "to non-extensible";
2783 os << "to sealed ";
2785 os << "to frozen";
2787 os << "to " << ElementsKindToString(target.elements_kind());
2789 os << "to strict function";
2792 key.NamePrint(os);
2794 key.ShortPrint(os);
2796 os << " ";
2798 os << "to ";
2801 descriptors.PrintDescriptorDetails(os, descriptor,
2805 transitions.PrintTransitionTree(os, level + 1, no_gc);
2809 void JSObject::PrintTransitions(std::ostream& os) {
2812 os << "\n - transitions";
2813 ta.PrintTransitions(os);
2850 i::StdoutStream os;
2851 i::LoadHandler::PrintHandler(GetObjectFromRaw(object), os);
2852 os << std::flush;
2858 i::StdoutStream os;
2859 i::StoreHandler::PrintHandler(GetObjectFromRaw(object), os);
2860 os << std::flush;
2872 i::StdoutStream os;
2873 wasm_code->Disassemble(nullptr, os, address);
2896 i::StdoutStream os;
2897 code.Disassemble(nullptr, os, isolate, address);