OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/objects.h" | 5 #include "src/objects.h" |
6 | 6 |
7 #include "src/disasm.h" | 7 #include "src/disasm.h" |
8 #include "src/disassembler.h" | 8 #include "src/disassembler.h" |
9 #include "src/interpreter/bytecodes.h" | 9 #include "src/interpreter/bytecodes.h" |
10 #include "src/objects-inl.h" | 10 #include "src/objects-inl.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 void Object::Print(std::ostream& os) { // NOLINT | 26 void Object::Print(std::ostream& os) { // NOLINT |
27 if (IsSmi()) { | 27 if (IsSmi()) { |
28 Smi::cast(this)->SmiPrint(os); | 28 Smi::cast(this)->SmiPrint(os); |
29 } else { | 29 } else { |
30 HeapObject::cast(this)->HeapObjectPrint(os); | 30 HeapObject::cast(this)->HeapObjectPrint(os); |
31 } | 31 } |
32 } | 32 } |
33 | 33 |
34 | 34 |
35 void HeapObject::PrintHeader(std::ostream& os, const char* id) { // NOLINT | 35 void HeapObject::PrintHeader(std::ostream& os, const char* id) { // NOLINT |
36 os << reinterpret_cast<void*>(this) << ": [" << id << "]\n"; | 36 os << reinterpret_cast<void*>(this) << ": [" << id << "]"; |
37 } | 37 } |
38 | 38 |
39 | 39 |
40 void HeapObject::HeapObjectPrint(std::ostream& os) { // NOLINT | 40 void HeapObject::HeapObjectPrint(std::ostream& os) { // NOLINT |
41 InstanceType instance_type = map()->instance_type(); | 41 InstanceType instance_type = map()->instance_type(); |
42 | 42 |
43 HandleScope scope(GetIsolate()); | 43 HandleScope scope(GetIsolate()); |
44 if (instance_type < FIRST_NONSTRING_TYPE) { | 44 if (instance_type < FIRST_NONSTRING_TYPE) { |
45 String::cast(this)->StringPrint(os); | 45 String::cast(this)->StringPrint(os); |
46 return; | 46 return; |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 } | 388 } |
389 } | 389 } |
390 | 390 |
391 | 391 |
392 static void JSObjectPrintHeader(std::ostream& os, JSObject* obj, | 392 static void JSObjectPrintHeader(std::ostream& os, JSObject* obj, |
393 const char* id) { // NOLINT | 393 const char* id) { // NOLINT |
394 obj->PrintHeader(os, id); | 394 obj->PrintHeader(os, id); |
395 // Don't call GetElementsKind, its validation code can cause the printer to | 395 // Don't call GetElementsKind, its validation code can cause the printer to |
396 // fail when debugging. | 396 // fail when debugging. |
397 PrototypeIterator iter(obj->GetIsolate(), obj); | 397 PrototypeIterator iter(obj->GetIsolate(), obj); |
398 os << " - map = " << reinterpret_cast<void*>(obj->map()) << " [" | 398 os << "\n - map = " << reinterpret_cast<void*>(obj->map()) << " [" |
399 << ElementsKindToString(obj->map()->elements_kind()) | 399 << ElementsKindToString(obj->map()->elements_kind()) |
400 << "]\n - prototype = " << reinterpret_cast<void*>(iter.GetCurrent()); | 400 << "]\n - prototype = " << reinterpret_cast<void*>(iter.GetCurrent()); |
401 } | 401 } |
402 | 402 |
403 | 403 |
404 static void JSObjectPrintBody(std::ostream& os, JSObject* obj, // NOLINT | 404 static void JSObjectPrintBody(std::ostream& os, JSObject* obj, // NOLINT |
405 bool print_elements = true) { | 405 bool print_elements = true) { |
406 os << "\n {"; | 406 os << "\n {"; |
407 obj->PrintProperties(os); | 407 obj->PrintProperties(os); |
408 obj->PrintTransitions(os); | 408 obj->PrintTransitions(os); |
(...skipping 18 matching lines...) Expand all Loading... |
427 void JSModule::JSModulePrint(std::ostream& os) { // NOLINT | 427 void JSModule::JSModulePrint(std::ostream& os) { // NOLINT |
428 JSObjectPrintHeader(os, this, "JSModule"); | 428 JSObjectPrintHeader(os, this, "JSModule"); |
429 os << "\n - context = " << Brief(context()); | 429 os << "\n - context = " << Brief(context()); |
430 os << " - scope_info = " << Brief(scope_info()); | 430 os << " - scope_info = " << Brief(scope_info()); |
431 JSObjectPrintBody(os, this); | 431 JSObjectPrintBody(os, this); |
432 } | 432 } |
433 | 433 |
434 | 434 |
435 void Symbol::SymbolPrint(std::ostream& os) { // NOLINT | 435 void Symbol::SymbolPrint(std::ostream& os) { // NOLINT |
436 HeapObject::PrintHeader(os, "Symbol"); | 436 HeapObject::PrintHeader(os, "Symbol"); |
437 os << " - hash: " << Hash(); | 437 os << "\n - hash: " << Hash(); |
438 os << "\n - name: " << Brief(name()); | 438 os << "\n - name: " << Brief(name()); |
439 if (name()->IsUndefined()) { | 439 if (name()->IsUndefined()) { |
440 os << " (" << PrivateSymbolToName() << ")"; | 440 os << " (" << PrivateSymbolToName() << ")"; |
441 } | 441 } |
442 os << "\n - private: " << is_private(); | 442 os << "\n - private: " << is_private(); |
443 os << "\n"; | 443 os << "\n"; |
444 } | 444 } |
445 | 445 |
446 | 446 |
447 void Map::MapPrint(std::ostream& os) { // NOLINT | 447 void Map::MapPrint(std::ostream& os) { // NOLINT |
448 HeapObject::PrintHeader(os, "Map"); | 448 HeapObject::PrintHeader(os, "Map"); |
449 os << " - type: " << instance_type() << "\n"; | 449 os << "\n - type: " << instance_type(); |
450 os << " - instance size: " << instance_size() << "\n"; | 450 os << "\n - instance size: " << instance_size(); |
451 if (IsJSObjectMap()) { | 451 if (IsJSObjectMap()) { |
452 os << " - inobject properties: " << GetInObjectProperties() << "\n"; | 452 os << "\n - inobject properties: " << GetInObjectProperties(); |
453 } | 453 } |
454 os << " - elements kind: " << ElementsKindToString(elements_kind()) << "\n"; | 454 os << "\n - elements kind: " << ElementsKindToString(elements_kind()); |
455 os << " - unused property fields: " << unused_property_fields() << "\n"; | 455 os << "\n - unused property fields: " << unused_property_fields(); |
456 if (is_deprecated()) os << " - deprecated_map\n"; | 456 if (is_deprecated()) os << "\n - deprecated_map"; |
457 if (is_stable()) os << " - stable_map\n"; | 457 if (is_stable()) os << "\n - stable_map"; |
458 if (is_dictionary_map()) os << " - dictionary_map\n"; | 458 if (is_dictionary_map()) os << "\n - dictionary_map"; |
459 if (is_hidden_prototype()) os << " - hidden_prototype\n"; | 459 if (is_hidden_prototype()) os << "\n - hidden_prototype"; |
460 if (has_named_interceptor()) os << " - named_interceptor\n"; | 460 if (has_named_interceptor()) os << " - named_interceptor"; |
461 if (has_indexed_interceptor()) os << " - indexed_interceptor\n"; | 461 if (has_indexed_interceptor()) os << "\n - indexed_interceptor"; |
462 if (is_undetectable()) os << " - undetectable\n"; | 462 if (is_undetectable()) os << "\n - undetectable"; |
463 if (is_callable()) os << " - callable\n"; | 463 if (is_callable()) os << "\n - callable"; |
464 if (is_constructor()) os << " - constructor\n"; | 464 if (is_constructor()) os << "\n - constructor"; |
465 if (is_access_check_needed()) os << " - access_check_needed\n"; | 465 if (is_access_check_needed()) os << "\n - access_check_needed"; |
466 if (!is_extensible()) os << " - non-extensible\n"; | 466 if (!is_extensible()) os << "\n - non-extensible"; |
467 if (is_observed()) os << " - observed\n"; | 467 if (is_observed()) os << "\n - observed"; |
468 if (is_strong()) os << " - strong_map\n"; | 468 if (is_strong()) os << "\n - strong_map"; |
469 if (is_prototype_map()) { | 469 if (is_prototype_map()) { |
470 os << " - prototype_map\n"; | 470 os << "\n - prototype_map"; |
471 os << " - prototype info: " << Brief(prototype_info()); | 471 os << "\n - prototype info: " << Brief(prototype_info()); |
472 } else { | 472 } else { |
473 os << " - back pointer: " << Brief(GetBackPointer()); | 473 os << "\n - back pointer: " << Brief(GetBackPointer()); |
474 } | 474 } |
475 os << "\n - instance descriptors " << (owns_descriptors() ? "(own) " : "") | 475 os << "\n - instance descriptors " << (owns_descriptors() ? "(own) " : "") |
476 << "#" << NumberOfOwnDescriptors() << ": " | 476 << "#" << NumberOfOwnDescriptors() << ": " |
477 << Brief(instance_descriptors()); | 477 << Brief(instance_descriptors()); |
478 if (FLAG_unbox_double_fields) { | 478 if (FLAG_unbox_double_fields) { |
479 os << "\n - layout descriptor: " << Brief(layout_descriptor()); | 479 os << "\n - layout descriptor: " << Brief(layout_descriptor()); |
480 } | 480 } |
481 int nof_transitions = TransitionArray::NumberOfTransitions(raw_transitions()); | 481 int nof_transitions = TransitionArray::NumberOfTransitions(raw_transitions()); |
482 if (nof_transitions > 0) { | 482 if (nof_transitions > 0) { |
483 os << "\n - transitions #" << nof_transitions << ": " | 483 os << "\n - transitions #" << nof_transitions << ": " |
(...skipping 18 matching lines...) Expand all Loading... |
502 | 502 |
503 void PolymorphicCodeCache::PolymorphicCodeCachePrint( | 503 void PolymorphicCodeCache::PolymorphicCodeCachePrint( |
504 std::ostream& os) { // NOLINT | 504 std::ostream& os) { // NOLINT |
505 HeapObject::PrintHeader(os, "PolymorphicCodeCache"); | 505 HeapObject::PrintHeader(os, "PolymorphicCodeCache"); |
506 os << "\n - cache: " << Brief(cache()); | 506 os << "\n - cache: " << Brief(cache()); |
507 } | 507 } |
508 | 508 |
509 | 509 |
510 void TypeFeedbackInfo::TypeFeedbackInfoPrint(std::ostream& os) { // NOLINT | 510 void TypeFeedbackInfo::TypeFeedbackInfoPrint(std::ostream& os) { // NOLINT |
511 HeapObject::PrintHeader(os, "TypeFeedbackInfo"); | 511 HeapObject::PrintHeader(os, "TypeFeedbackInfo"); |
512 os << " - ic_total_count: " << ic_total_count() | 512 os << "\n - ic_total_count: " << ic_total_count() |
513 << ", ic_with_type_info_count: " << ic_with_type_info_count() | 513 << ", ic_with_type_info_count: " << ic_with_type_info_count() |
514 << ", ic_generic_count: " << ic_generic_count() << "\n"; | 514 << ", ic_generic_count: " << ic_generic_count() << "\n"; |
515 } | 515 } |
516 | 516 |
517 | 517 |
518 void AliasedArgumentsEntry::AliasedArgumentsEntryPrint( | 518 void AliasedArgumentsEntry::AliasedArgumentsEntryPrint( |
519 std::ostream& os) { // NOLINT | 519 std::ostream& os) { // NOLINT |
520 HeapObject::PrintHeader(os, "AliasedArgumentsEntry"); | 520 HeapObject::PrintHeader(os, "AliasedArgumentsEntry"); |
521 os << "\n - aliased_context_slot: " << aliased_context_slot(); | 521 os << "\n - aliased_context_slot: " << aliased_context_slot(); |
522 } | 522 } |
523 | 523 |
524 | 524 |
525 void FixedArray::FixedArrayPrint(std::ostream& os) { // NOLINT | 525 void FixedArray::FixedArrayPrint(std::ostream& os) { // NOLINT |
526 HeapObject::PrintHeader(os, "FixedArray"); | 526 HeapObject::PrintHeader(os, "FixedArray"); |
527 os << " - length: " << length(); | 527 os << "\n - length: " << length(); |
528 for (int i = 0; i < length(); i++) { | 528 for (int i = 0; i < length(); i++) { |
529 os << "\n [" << i << "]: " << Brief(get(i)); | 529 os << "\n [" << i << "]: " << Brief(get(i)); |
530 } | 530 } |
531 os << "\n"; | 531 os << "\n"; |
532 } | 532 } |
533 | 533 |
534 | 534 |
535 void FixedDoubleArray::FixedDoubleArrayPrint(std::ostream& os) { // NOLINT | 535 void FixedDoubleArray::FixedDoubleArrayPrint(std::ostream& os) { // NOLINT |
536 HeapObject::PrintHeader(os, "FixedDoubleArray"); | 536 HeapObject::PrintHeader(os, "FixedDoubleArray"); |
537 os << " - length: " << length(); | 537 os << "\n - length: " << length(); |
538 for (int i = 0; i < length(); i++) { | 538 for (int i = 0; i < length(); i++) { |
539 os << "\n [" << i << "]: "; | 539 os << "\n [" << i << "]: "; |
540 if (is_the_hole(i)) { | 540 if (is_the_hole(i)) { |
541 os << "<the hole>"; | 541 os << "<the hole>"; |
542 } else { | 542 } else { |
543 os << get_scalar(i); | 543 os << get_scalar(i); |
544 } | 544 } |
545 } | 545 } |
546 os << "\n"; | 546 os << "\n"; |
547 } | 547 } |
548 | 548 |
549 | 549 |
550 void TransitionArray::TransitionArrayPrint(std::ostream& os) { // NOLINT | 550 void TransitionArray::TransitionArrayPrint(std::ostream& os) { // NOLINT |
551 HeapObject::PrintHeader(os, "TransitionArray"); | 551 HeapObject::PrintHeader(os, "TransitionArray"); |
552 os << " - capacity: " << length(); | 552 os << "\n - capacity: " << length(); |
553 for (int i = 0; i < length(); i++) { | 553 for (int i = 0; i < length(); i++) { |
554 os << "\n [" << i << "]: " << Brief(get(i)); | 554 os << "\n [" << i << "]: " << Brief(get(i)); |
555 if (i == kNextLinkIndex) os << " (next link)"; | 555 if (i == kNextLinkIndex) os << " (next link)"; |
556 if (i == kPrototypeTransitionsIndex) os << " (prototype transitions)"; | 556 if (i == kPrototypeTransitionsIndex) os << " (prototype transitions)"; |
557 if (i == kTransitionLengthIndex) os << " (number of transitions)"; | 557 if (i == kTransitionLengthIndex) os << " (number of transitions)"; |
558 } | 558 } |
559 os << "\n"; | 559 os << "\n"; |
560 } | 560 } |
561 | 561 |
562 | 562 |
563 void TypeFeedbackMetadata::Print() { | 563 void TypeFeedbackMetadata::Print() { |
564 OFStream os(stdout); | 564 OFStream os(stdout); |
565 TypeFeedbackMetadataPrint(os); | 565 TypeFeedbackMetadataPrint(os); |
566 os << std::flush; | 566 os << std::flush; |
567 } | 567 } |
568 | 568 |
569 | 569 |
570 void TypeFeedbackMetadata::TypeFeedbackMetadataPrint( | 570 void TypeFeedbackMetadata::TypeFeedbackMetadataPrint( |
571 std::ostream& os) { // NOLINT | 571 std::ostream& os) { // NOLINT |
572 HeapObject::PrintHeader(os, "TypeFeedbackMetadata"); | 572 HeapObject::PrintHeader(os, "TypeFeedbackMetadata"); |
573 os << " - length: " << length(); | 573 os << "\n - length: " << length(); |
574 if (length() == 0) { | 574 if (length() == 0) { |
575 os << " (empty)\n"; | 575 os << " (empty)\n"; |
576 return; | 576 return; |
577 } | 577 } |
578 | 578 |
579 TypeFeedbackMetadataIterator iter(this); | 579 TypeFeedbackMetadataIterator iter(this); |
580 while (iter.HasNext()) { | 580 while (iter.HasNext()) { |
581 FeedbackVectorSlot slot = iter.Next(); | 581 FeedbackVectorSlot slot = iter.Next(); |
582 FeedbackVectorSlotKind kind = iter.kind(); | 582 FeedbackVectorSlotKind kind = iter.kind(); |
583 os << "\n Slot " << slot << " " << kind; | 583 os << "\n Slot " << slot << " " << kind; |
584 } | 584 } |
585 os << "\n"; | 585 os << "\n"; |
586 } | 586 } |
587 | 587 |
588 | 588 |
589 void TypeFeedbackVector::Print() { | 589 void TypeFeedbackVector::Print() { |
590 OFStream os(stdout); | 590 OFStream os(stdout); |
591 TypeFeedbackVectorPrint(os); | 591 TypeFeedbackVectorPrint(os); |
592 os << std::flush; | 592 os << std::flush; |
593 } | 593 } |
594 | 594 |
595 | 595 |
596 void TypeFeedbackVector::TypeFeedbackVectorPrint(std::ostream& os) { // NOLINT | 596 void TypeFeedbackVector::TypeFeedbackVectorPrint(std::ostream& os) { // NOLINT |
597 HeapObject::PrintHeader(os, "TypeFeedbackVector"); | 597 HeapObject::PrintHeader(os, "TypeFeedbackVector"); |
598 os << " - length: " << length(); | 598 os << "\n - length: " << length(); |
599 if (length() == 0) { | 599 if (length() == 0) { |
600 os << " (empty)\n"; | 600 os << " (empty)\n"; |
601 return; | 601 return; |
602 } | 602 } |
603 | 603 |
604 TypeFeedbackMetadataIterator iter(metadata()); | 604 TypeFeedbackMetadataIterator iter(metadata()); |
605 while (iter.HasNext()) { | 605 while (iter.HasNext()) { |
606 FeedbackVectorSlot slot = iter.Next(); | 606 FeedbackVectorSlot slot = iter.Next(); |
607 FeedbackVectorSlotKind kind = iter.kind(); | 607 FeedbackVectorSlotKind kind = iter.kind(); |
608 | 608 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
731 min()->IsSmi() ? Smi::cast(min())->value() : -1, | 731 min()->IsSmi() ? Smi::cast(min())->value() : -1, |
732 sec()->IsSmi() ? Smi::cast(sec())->value() : -1); | 732 sec()->IsSmi() ? Smi::cast(sec())->value() : -1); |
733 os << buf.start(); | 733 os << buf.start(); |
734 } | 734 } |
735 JSObjectPrintBody(os, this); | 735 JSObjectPrintBody(os, this); |
736 } | 736 } |
737 | 737 |
738 | 738 |
739 void JSProxy::JSProxyPrint(std::ostream& os) { // NOLINT | 739 void JSProxy::JSProxyPrint(std::ostream& os) { // NOLINT |
740 HeapObject::PrintHeader(os, "JSProxy"); | 740 HeapObject::PrintHeader(os, "JSProxy"); |
741 os << " - map = " << reinterpret_cast<void*>(map()); | 741 os << "\n - map = " << reinterpret_cast<void*>(map()); |
742 os << "\n - target = "; | 742 os << "\n - target = "; |
743 target()->ShortPrint(os); | 743 target()->ShortPrint(os); |
744 os << "\n - handler = "; | 744 os << "\n - handler = "; |
745 handler()->ShortPrint(os); | 745 handler()->ShortPrint(os); |
746 os << "\n - hash = "; | 746 os << "\n - hash = "; |
747 hash()->ShortPrint(os); | 747 hash()->ShortPrint(os); |
748 os << "\n"; | 748 os << "\n"; |
749 } | 749 } |
750 | 750 |
751 | 751 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
868 } | 868 } |
869 os << "\n - context = " << Brief(context()); | 869 os << "\n - context = " << Brief(context()); |
870 os << "\n - literals = " << Brief(literals()); | 870 os << "\n - literals = " << Brief(literals()); |
871 os << "\n - code = " << Brief(code()); | 871 os << "\n - code = " << Brief(code()); |
872 JSObjectPrintBody(os, this); | 872 JSObjectPrintBody(os, this); |
873 } | 873 } |
874 | 874 |
875 | 875 |
876 void SharedFunctionInfo::SharedFunctionInfoPrint(std::ostream& os) { // NOLINT | 876 void SharedFunctionInfo::SharedFunctionInfoPrint(std::ostream& os) { // NOLINT |
877 HeapObject::PrintHeader(os, "SharedFunctionInfo"); | 877 HeapObject::PrintHeader(os, "SharedFunctionInfo"); |
878 os << " - name: " << Brief(name()); | 878 os << "\n - name: " << Brief(name()); |
879 os << "\n - expected_nof_properties: " << expected_nof_properties(); | 879 os << "\n - expected_nof_properties: " << expected_nof_properties(); |
880 os << "\n - ast_node_count: " << ast_node_count(); | 880 os << "\n - ast_node_count: " << ast_node_count(); |
881 os << "\n - instance class name = "; | 881 os << "\n - instance class name = "; |
882 instance_class_name()->Print(os); | 882 instance_class_name()->Print(os); |
883 os << "\n - code = " << Brief(code()); | 883 os << "\n - code = " << Brief(code()); |
884 if (HasSourceCode()) { | 884 if (HasSourceCode()) { |
885 os << "\n - source code = "; | 885 os << "\n - source code = "; |
886 String* source = String::cast(Script::cast(script())->source()); | 886 String* source = String::cast(Script::cast(script())->source()); |
887 int start = start_position(); | 887 int start = start_position(); |
888 int length = end_position() - start; | 888 int length = end_position() - start; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
920 void JSGlobalObject::JSGlobalObjectPrint(std::ostream& os) { // NOLINT | 920 void JSGlobalObject::JSGlobalObjectPrint(std::ostream& os) { // NOLINT |
921 os << "global "; | 921 os << "global "; |
922 JSObjectPrint(os); | 922 JSObjectPrint(os); |
923 os << "native context : " << Brief(native_context()); | 923 os << "native context : " << Brief(native_context()); |
924 os << "\n"; | 924 os << "\n"; |
925 } | 925 } |
926 | 926 |
927 | 927 |
928 void Cell::CellPrint(std::ostream& os) { // NOLINT | 928 void Cell::CellPrint(std::ostream& os) { // NOLINT |
929 HeapObject::PrintHeader(os, "Cell"); | 929 HeapObject::PrintHeader(os, "Cell"); |
930 os << " - value: " << Brief(value()); | 930 os << "\n - value: " << Brief(value()); |
931 os << "\n"; | 931 os << "\n"; |
932 } | 932 } |
933 | 933 |
934 | 934 |
935 void PropertyCell::PropertyCellPrint(std::ostream& os) { // NOLINT | 935 void PropertyCell::PropertyCellPrint(std::ostream& os) { // NOLINT |
936 HeapObject::PrintHeader(os, "PropertyCell"); | 936 HeapObject::PrintHeader(os, "PropertyCell"); |
937 os << " - value: " << Brief(value()); | 937 os << "\n - value: " << Brief(value()); |
938 os << "\n - details: " << property_details(); | 938 os << "\n - details: " << property_details(); |
939 os << "\n"; | 939 os << "\n"; |
940 } | 940 } |
941 | 941 |
942 | 942 |
943 void WeakCell::WeakCellPrint(std::ostream& os) { // NOLINT | 943 void WeakCell::WeakCellPrint(std::ostream& os) { // NOLINT |
944 HeapObject::PrintHeader(os, "WeakCell"); | 944 HeapObject::PrintHeader(os, "WeakCell"); |
945 if (cleared()) { | 945 if (cleared()) { |
946 os << "\n - cleared"; | 946 os << "\n - cleared"; |
947 } else { | 947 } else { |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1039 os << "\n - data: " << Brief(data()); | 1039 os << "\n - data: " << Brief(data()); |
1040 os << "\n"; | 1040 os << "\n"; |
1041 } | 1041 } |
1042 | 1042 |
1043 | 1043 |
1044 void FunctionTemplateInfo::FunctionTemplateInfoPrint( | 1044 void FunctionTemplateInfo::FunctionTemplateInfoPrint( |
1045 std::ostream& os) { // NOLINT | 1045 std::ostream& os) { // NOLINT |
1046 HeapObject::PrintHeader(os, "FunctionTemplateInfo"); | 1046 HeapObject::PrintHeader(os, "FunctionTemplateInfo"); |
1047 os << "\n - class name: " << Brief(class_name()); | 1047 os << "\n - class name: " << Brief(class_name()); |
1048 os << "\n - tag: " << Brief(tag()); | 1048 os << "\n - tag: " << Brief(tag()); |
| 1049 os << "\n - serial_number: " << Brief(serial_number()); |
1049 os << "\n - property_list: " << Brief(property_list()); | 1050 os << "\n - property_list: " << Brief(property_list()); |
1050 os << "\n - serial_number: " << Brief(serial_number()); | |
1051 os << "\n - call_code: " << Brief(call_code()); | 1051 os << "\n - call_code: " << Brief(call_code()); |
1052 os << "\n - property_accessors: " << Brief(property_accessors()); | 1052 os << "\n - property_accessors: " << Brief(property_accessors()); |
1053 os << "\n - prototype_template: " << Brief(prototype_template()); | 1053 os << "\n - prototype_template: " << Brief(prototype_template()); |
1054 os << "\n - parent_template: " << Brief(parent_template()); | 1054 os << "\n - parent_template: " << Brief(parent_template()); |
1055 os << "\n - named_property_handler: " << Brief(named_property_handler()); | 1055 os << "\n - named_property_handler: " << Brief(named_property_handler()); |
1056 os << "\n - indexed_property_handler: " << Brief(indexed_property_handler()); | 1056 os << "\n - indexed_property_handler: " << Brief(indexed_property_handler()); |
1057 os << "\n - instance_template: " << Brief(instance_template()); | 1057 os << "\n - instance_template: " << Brief(instance_template()); |
1058 os << "\n - signature: " << Brief(signature()); | 1058 os << "\n - signature: " << Brief(signature()); |
1059 os << "\n - access_check_info: " << Brief(access_check_info()); | 1059 os << "\n - access_check_info: " << Brief(access_check_info()); |
1060 os << "\n - hidden_prototype: " << (hidden_prototype() ? "true" : "false"); | 1060 os << "\n - hidden_prototype: " << (hidden_prototype() ? "true" : "false"); |
1061 os << "\n - undetectable: " << (undetectable() ? "true" : "false"); | 1061 os << "\n - undetectable: " << (undetectable() ? "true" : "false"); |
1062 os << "\n - need_access_check: " << (needs_access_check() ? "true" : "false"); | 1062 os << "\n - need_access_check: " << (needs_access_check() ? "true" : "false"); |
1063 os << "\n - instantiated: " << (instantiated() ? "true" : "false"); | 1063 os << "\n - instantiated: " << (instantiated() ? "true" : "false"); |
1064 os << "\n"; | 1064 os << "\n"; |
1065 } | 1065 } |
1066 | 1066 |
1067 | 1067 |
1068 void ObjectTemplateInfo::ObjectTemplateInfoPrint(std::ostream& os) { // NOLINT | 1068 void ObjectTemplateInfo::ObjectTemplateInfoPrint(std::ostream& os) { // NOLINT |
1069 HeapObject::PrintHeader(os, "ObjectTemplateInfo"); | 1069 HeapObject::PrintHeader(os, "ObjectTemplateInfo"); |
1070 os << " - tag: " << Brief(tag()); | 1070 os << "\n - tag: " << Brief(tag()); |
| 1071 os << "\n - serial_number: " << Brief(serial_number()); |
1071 os << "\n - property_list: " << Brief(property_list()); | 1072 os << "\n - property_list: " << Brief(property_list()); |
1072 os << "\n - property_accessors: " << Brief(property_accessors()); | 1073 os << "\n - property_accessors: " << Brief(property_accessors()); |
1073 os << "\n - constructor: " << Brief(constructor()); | 1074 os << "\n - constructor: " << Brief(constructor()); |
1074 os << "\n - internal_field_count: " << Brief(internal_field_count()); | 1075 os << "\n - internal_field_count: " << Brief(internal_field_count()); |
1075 os << "\n"; | 1076 os << "\n"; |
1076 } | 1077 } |
1077 | 1078 |
1078 | 1079 |
1079 void AllocationSite::AllocationSitePrint(std::ostream& os) { // NOLINT | 1080 void AllocationSite::AllocationSitePrint(std::ostream& os) { // NOLINT |
1080 HeapObject::PrintHeader(os, "AllocationSite"); | 1081 HeapObject::PrintHeader(os, "AllocationSite"); |
1081 os << " - weak_next: " << Brief(weak_next()); | 1082 os << "\n - weak_next: " << Brief(weak_next()); |
1082 os << "\n - dependent code: " << Brief(dependent_code()); | 1083 os << "\n - dependent code: " << Brief(dependent_code()); |
1083 os << "\n - nested site: " << Brief(nested_site()); | 1084 os << "\n - nested site: " << Brief(nested_site()); |
1084 os << "\n - memento found count: " | 1085 os << "\n - memento found count: " |
1085 << Brief(Smi::FromInt(memento_found_count())); | 1086 << Brief(Smi::FromInt(memento_found_count())); |
1086 os << "\n - memento create count: " | 1087 os << "\n - memento create count: " |
1087 << Brief(Smi::FromInt(memento_create_count())); | 1088 << Brief(Smi::FromInt(memento_create_count())); |
1088 os << "\n - pretenure decision: " | 1089 os << "\n - pretenure decision: " |
1089 << Brief(Smi::FromInt(pretenure_decision())); | 1090 << Brief(Smi::FromInt(pretenure_decision())); |
1090 os << "\n - transition_info: "; | 1091 os << "\n - transition_info: "; |
1091 if (transition_info()->IsSmi()) { | 1092 if (transition_info()->IsSmi()) { |
1092 ElementsKind kind = GetElementsKind(); | 1093 ElementsKind kind = GetElementsKind(); |
1093 os << "Array allocation with ElementsKind " << ElementsKindToString(kind); | 1094 os << "Array allocation with ElementsKind " << ElementsKindToString(kind); |
1094 } else if (transition_info()->IsJSArray()) { | 1095 } else if (transition_info()->IsJSArray()) { |
1095 os << "Array literal " << Brief(transition_info()); | 1096 os << "Array literal " << Brief(transition_info()); |
1096 } else { | 1097 } else { |
1097 os << "unknown transition_info" << Brief(transition_info()); | 1098 os << "unknown transition_info" << Brief(transition_info()); |
1098 } | 1099 } |
1099 os << "\n"; | 1100 os << "\n"; |
1100 } | 1101 } |
1101 | 1102 |
1102 | 1103 |
1103 void AllocationMemento::AllocationMementoPrint(std::ostream& os) { // NOLINT | 1104 void AllocationMemento::AllocationMementoPrint(std::ostream& os) { // NOLINT |
1104 HeapObject::PrintHeader(os, "AllocationMemento"); | 1105 HeapObject::PrintHeader(os, "AllocationMemento"); |
1105 os << " - allocation site: "; | 1106 os << "\n - allocation site: "; |
1106 if (IsValid()) { | 1107 if (IsValid()) { |
1107 GetAllocationSite()->Print(os); | 1108 GetAllocationSite()->Print(os); |
1108 } else { | 1109 } else { |
1109 os << "<invalid>\n"; | 1110 os << "<invalid>\n"; |
1110 } | 1111 } |
1111 } | 1112 } |
1112 | 1113 |
1113 | 1114 |
1114 void Script::ScriptPrint(std::ostream& os) { // NOLINT | 1115 void Script::ScriptPrint(std::ostream& os) { // NOLINT |
1115 HeapObject::PrintHeader(os, "Script"); | 1116 HeapObject::PrintHeader(os, "Script"); |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1322 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT | 1323 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT |
1323 Object* transitions = map()->raw_transitions(); | 1324 Object* transitions = map()->raw_transitions(); |
1324 int num_transitions = TransitionArray::NumberOfTransitions(transitions); | 1325 int num_transitions = TransitionArray::NumberOfTransitions(transitions); |
1325 if (num_transitions == 0) return; | 1326 if (num_transitions == 0) return; |
1326 os << "\n - transitions"; | 1327 os << "\n - transitions"; |
1327 TransitionArray::PrintTransitions(os, transitions, false); | 1328 TransitionArray::PrintTransitions(os, transitions, false); |
1328 } | 1329 } |
1329 #endif // defined(DEBUG) || defined(OBJECT_PRINT) | 1330 #endif // defined(DEBUG) || defined(OBJECT_PRINT) |
1330 } // namespace internal | 1331 } // namespace internal |
1331 } // namespace v8 | 1332 } // namespace v8 |
OLD | NEW |