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 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 os << "\n Slot " << i << " [" << GetIndex(slot) | 563 os << "\n Slot " << i << " [" << GetIndex(slot) |
564 << "]: " << Brief(Get(slot)); | 564 << "]: " << Brief(Get(slot)); |
565 } | 565 } |
566 } | 566 } |
567 | 567 |
568 if (ICSlots() > 0) { | 568 if (ICSlots() > 0) { |
569 DCHECK(elements_per_ic_slot() == 2); | 569 DCHECK(elements_per_ic_slot() == 2); |
570 | 570 |
571 for (int i = 0; i < ICSlots(); i++) { | 571 for (int i = 0; i < ICSlots(); i++) { |
572 FeedbackVectorICSlot slot(i); | 572 FeedbackVectorICSlot slot(i); |
573 Code::Kind kind = GetKind(slot); | 573 FeedbackVectorSlotKind kind = GetKind(slot); |
574 os << "\n ICSlot " << i; | 574 os << "\n ICSlot " << i << " " << kind << " "; |
575 if (kind == Code::LOAD_IC) { | 575 switch (kind) { |
576 LoadICNexus nexus(this, slot); | 576 case FeedbackVectorSlotKind::LOAD_IC: { |
577 os << " LOAD_IC " << Code::ICState2String(nexus.StateFromFeedback()); | 577 LoadICNexus nexus(this, slot); |
578 } else if (kind == Code::KEYED_LOAD_IC) { | 578 os << Code::ICState2String(nexus.StateFromFeedback()); |
579 KeyedLoadICNexus nexus(this, slot); | 579 break; |
580 os << " KEYED_LOAD_IC " | 580 } |
581 << Code::ICState2String(nexus.StateFromFeedback()); | 581 case FeedbackVectorSlotKind::KEYED_LOAD_IC: { |
582 } else if (kind == Code::CALL_IC) { | 582 KeyedLoadICNexus nexus(this, slot); |
583 CallICNexus nexus(this, slot); | 583 os << Code::ICState2String(nexus.StateFromFeedback()); |
584 os << " CALL_IC " << Code::ICState2String(nexus.StateFromFeedback()); | 584 break; |
585 } else if (kind == Code::STORE_IC) { | 585 } |
586 StoreICNexus nexus(this, slot); | 586 case FeedbackVectorSlotKind::CALL_IC: { |
587 os << " STORE_IC " << Code::ICState2String(nexus.StateFromFeedback()); | 587 CallICNexus nexus(this, slot); |
588 } else { | 588 os << Code::ICState2String(nexus.StateFromFeedback()); |
589 DCHECK(kind == Code::KEYED_STORE_IC); | 589 break; |
590 KeyedStoreICNexus nexus(this, slot); | 590 } |
591 os << " KEYED_STORE_IC " | 591 case FeedbackVectorSlotKind::STORE_IC: { |
592 << Code::ICState2String(nexus.StateFromFeedback()); | 592 StoreICNexus nexus(this, slot); |
| 593 os << Code::ICState2String(nexus.StateFromFeedback()); |
| 594 break; |
| 595 } |
| 596 case FeedbackVectorSlotKind::KEYED_STORE_IC: { |
| 597 KeyedStoreICNexus nexus(this, slot); |
| 598 os << Code::ICState2String(nexus.StateFromFeedback()); |
| 599 break; |
| 600 } |
| 601 case FeedbackVectorSlotKind::UNUSED: |
| 602 case FeedbackVectorSlotKind::KINDS_NUMBER: |
| 603 UNREACHABLE(); |
| 604 break; |
593 } | 605 } |
594 | 606 |
595 os << "\n [" << GetIndex(slot) << "]: " << Brief(Get(slot)); | 607 os << "\n [" << GetIndex(slot) << "]: " << Brief(Get(slot)); |
596 os << "\n [" << (GetIndex(slot) + 1) | 608 os << "\n [" << (GetIndex(slot) + 1) |
597 << "]: " << Brief(get(GetIndex(slot) + 1)); | 609 << "]: " << Brief(get(GetIndex(slot) + 1)); |
598 } | 610 } |
599 } | 611 } |
600 os << "\n"; | 612 os << "\n"; |
601 } | 613 } |
602 | 614 |
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1288 } | 1300 } |
1289 } | 1301 } |
1290 | 1302 |
1291 | 1303 |
1292 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT | 1304 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT |
1293 TransitionArray::PrintTransitions(os, map()->raw_transitions()); | 1305 TransitionArray::PrintTransitions(os, map()->raw_transitions()); |
1294 } | 1306 } |
1295 #endif // defined(DEBUG) || defined(OBJECT_PRINT) | 1307 #endif // defined(DEBUG) || defined(OBJECT_PRINT) |
1296 } // namespace internal | 1308 } // namespace internal |
1297 } // namespace v8 | 1309 } // namespace v8 |
OLD | NEW |