@@ -2634,16 +2634,50 @@ _interfaceSlotsUnavailable:
2634
2634
staddr r10, -8*ALen(J9SP) ! Replaced staddru r10, -8*ALen(J9SP) for P6 perf
2635
2635
staddr r9, -7*ALen(J9SP)
2636
2636
#ifndef NO_HELPER_LASTITABLE_CHECK
2637
- ! Before going to the VM helper, check if the receiver class lastITable matches the interface class
2638
- ! of the method being called and if so, use it to quickly look up the vtable offset and make the call
2637
+ ! Before iTable walk or going to the VM helper, check if the receiver class lastITable matches the interface
2638
+ ! class of the method being called and if so, use it to quickly look up the vtable offset and make the call
2639
2639
LOAD_CLASS(r10,r3) ! Load the class
2640
2640
maskVFT(r10)
2641
2641
laddr r12, 3*ALen(r11) ! Load the interface class of the method from the snippet
2642
2642
laddr r9, J9TR_J9Class_lastITable(r10) ! Load the cached last ITable
2643
2643
laddr r0, J9TR_J9ITable_interfaceClass(r9) ! Load the interface class whose ITable this is
2644
2644
cmpl cr0, CmpAddr, r12, r0
2645
+ #ifndef NO_ITABLEWALK_CHECK
2646
+ beq .L.hitITable
2647
+ ! Before going to the VM helper do iTable walk N times
2648
+ ! check iTable[0]
2649
+ laddr r9, J9TR_J9Class_iTable(r10) ! Load the iTable pointer
2650
+ cmpi cr0, CmpAddr, r9, 0 ! check iTable != null
2651
+ beq .L.callHelper
2652
+ laddr r0, J9TR_J9ITable_interfaceClass(r9) ! Load iTable class
2653
+ cmpl cr0, CmpAddr, r12, r0
2654
+ beq .L.hitITable
2655
+ ! check iTable[1]
2656
+ laddr r9, J9TR_J9ITable_next(r9) ! Load the next iTable pointer
2657
+ cmpi cr0, CmpAddr, r9, 0 ! check iTable != null
2658
+ beq .L.callHelper
2659
+ laddr r0, J9TR_J9ITable_interfaceClass(r9) ! Load iTable class
2660
+ cmpl cr0, CmpAddr, r12, r0
2661
+ beq .L.hitITable
2662
+ ! check iTable[2]
2663
+ laddr r9, J9TR_J9ITable_next(r9) ! Load the next iTable pointer
2664
+ cmpi cr0, CmpAddr, r9, 0 ! check iTable != null
2665
+ beq .L.callHelper
2666
+ laddr r0, J9TR_J9ITable_interfaceClass(r9) ! Load iTable class
2667
+ cmpl cr0, CmpAddr, r12, r0
2668
+ beq .L.hitITable
2669
+ ! check iTable[3]
2670
+ laddr r9, J9TR_J9ITable_next(r9) ! Load the next iTable pointer
2671
+ cmpi cr0, CmpAddr, r9, 0 ! check iTable != null
2672
+ beq .L.callHelper
2673
+ laddr r0, J9TR_J9ITable_interfaceClass(r9) ! Load iTable class
2674
+ cmpl cr0, CmpAddr, r12, r0
2675
+ bne .L.callHelper
2676
+ #else
2645
2677
bne .L.callHelper
2678
+ #endif /* ~NO_ITABLEWALK_CHECK */
2646
2679
! lastITable is a match
2680
+ .L.hitITable:
2647
2681
laddr r12, 4*ALen(r11) ! Load the itable offset from the snippet
2648
2682
andi. r0, r12, J9TR_J9_ITABLE_OFFSET_TAG_BITS ! Call the helper if the itable offset is tagged
2649
2683
bne .L.callHelper
0 commit comments