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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 if (is_the_hole(i)) { | 532 if (is_the_hole(i)) { |
533 os << "<the hole>"; | 533 os << "<the hole>"; |
534 } else { | 534 } else { |
535 os << get_scalar(i); | 535 os << get_scalar(i); |
536 } | 536 } |
537 } | 537 } |
538 os << "\n"; | 538 os << "\n"; |
539 } | 539 } |
540 | 540 |
541 | 541 |
| 542 void TypeFeedbackMetadata::Print() { |
| 543 OFStream os(stdout); |
| 544 TypeFeedbackMetadataPrint(os); |
| 545 os << std::flush; |
| 546 } |
| 547 |
| 548 |
| 549 void TypeFeedbackMetadata::TypeFeedbackMetadataPrint( |
| 550 std::ostream& os) { // NOLINT |
| 551 HeapObject::PrintHeader(os, "TypeFeedbackMetadata"); |
| 552 os << " - length: " << length(); |
| 553 if (length() == 0) { |
| 554 os << " (empty)\n"; |
| 555 return; |
| 556 } |
| 557 |
| 558 TypeFeedbackMetadataIterator iter(this); |
| 559 while (iter.HasNext()) { |
| 560 FeedbackVectorSlot slot = iter.Next(); |
| 561 FeedbackVectorSlotKind kind = iter.kind(); |
| 562 os << "\n Slot " << slot << " " << kind; |
| 563 } |
| 564 os << "\n"; |
| 565 } |
| 566 |
| 567 |
542 void TypeFeedbackVector::Print() { | 568 void TypeFeedbackVector::Print() { |
543 OFStream os(stdout); | 569 OFStream os(stdout); |
544 TypeFeedbackVectorPrint(os); | 570 TypeFeedbackVectorPrint(os); |
545 os << std::flush; | 571 os << std::flush; |
546 } | 572 } |
547 | 573 |
548 | 574 |
549 void TypeFeedbackVector::TypeFeedbackVectorPrint(std::ostream& os) { // NOLINT | 575 void TypeFeedbackVector::TypeFeedbackVectorPrint(std::ostream& os) { // NOLINT |
550 HeapObject::PrintHeader(os, "TypeFeedbackVector"); | 576 HeapObject::PrintHeader(os, "TypeFeedbackVector"); |
551 os << " - length: " << length(); | 577 os << " - length: " << length(); |
552 if (length() == 0) { | 578 if (length() == 0) { |
553 os << " (empty)\n"; | 579 os << " (empty)\n"; |
554 return; | 580 return; |
555 } | 581 } |
556 | 582 |
557 os << "\n - ics with type info: " << ic_with_type_info_count(); | 583 os << "\n - ics with type info: " << ic_with_type_info_count(); |
558 os << "\n - generic ics: " << ic_generic_count(); | 584 os << "\n - generic ics: " << ic_generic_count(); |
559 | 585 |
560 TypeFeedbackMetadataIterator iter(this); | 586 TypeFeedbackMetadataIterator iter(metadata()); |
561 while (iter.HasNext()) { | 587 while (iter.HasNext()) { |
562 FeedbackVectorSlot slot = iter.Next(); | 588 FeedbackVectorSlot slot = iter.Next(); |
563 FeedbackVectorSlotKind kind = iter.kind(); | 589 FeedbackVectorSlotKind kind = iter.kind(); |
564 | 590 |
565 os << "\n ICSlot " << slot.ToInt() << " " << kind << " "; | 591 os << "\n Slot " << slot << " " << kind << " "; |
566 switch (kind) { | 592 switch (kind) { |
567 case FeedbackVectorSlotKind::LOAD_IC: { | 593 case FeedbackVectorSlotKind::LOAD_IC: { |
568 LoadICNexus nexus(this, slot); | 594 LoadICNexus nexus(this, slot); |
569 os << Code::ICState2String(nexus.StateFromFeedback()); | 595 os << Code::ICState2String(nexus.StateFromFeedback()); |
570 break; | 596 break; |
571 } | 597 } |
572 case FeedbackVectorSlotKind::KEYED_LOAD_IC: { | 598 case FeedbackVectorSlotKind::KEYED_LOAD_IC: { |
573 KeyedLoadICNexus nexus(this, slot); | 599 KeyedLoadICNexus nexus(this, slot); |
574 os << Code::ICState2String(nexus.StateFromFeedback()); | 600 os << Code::ICState2String(nexus.StateFromFeedback()); |
575 break; | 601 break; |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1294 } | 1320 } |
1295 } | 1321 } |
1296 | 1322 |
1297 | 1323 |
1298 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT | 1324 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT |
1299 TransitionArray::PrintTransitions(os, map()->raw_transitions()); | 1325 TransitionArray::PrintTransitions(os, map()->raw_transitions()); |
1300 } | 1326 } |
1301 #endif // defined(DEBUG) || defined(OBJECT_PRINT) | 1327 #endif // defined(DEBUG) || defined(OBJECT_PRINT) |
1302 } // namespace internal | 1328 } // namespace internal |
1303 } // namespace v8 | 1329 } // namespace v8 |
OLD | NEW |