Enable fast string compares for indexed list
This commit is contained in:
parent
fdb23b3a76
commit
09b1eb68ae
@ -3533,6 +3533,11 @@ class BytecodeCompiler(
|
|||||||
val elementClass = listElementClassBySlot[receiver.slot] ?: listElementClassFromReceiverRef(ref.targetRef)
|
val elementClass = listElementClassBySlot[receiver.slot] ?: listElementClassFromReceiverRef(ref.targetRef)
|
||||||
if (elementClass != null) {
|
if (elementClass != null) {
|
||||||
slotObjClass[dst] = elementClass
|
slotObjClass[dst] = elementClass
|
||||||
|
if (elementClass == ObjString.type && elementClass.isClosed) {
|
||||||
|
stableObjSlots.add(dst)
|
||||||
|
} else {
|
||||||
|
stableObjSlots.remove(dst)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return CompiledValue(dst, SlotType.OBJ)
|
return CompiledValue(dst, SlotType.OBJ)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,7 +16,8 @@ Candidates (not started)
|
|||||||
4) Range/loop hot path (done)
|
4) Range/loop hot path (done)
|
||||||
- Reuse a cached ObjVoid slot for if-statements in statement context (avoids per-iteration CONST_OBJ).
|
- Reuse a cached ObjVoid slot for if-statements in statement context (avoids per-iteration CONST_OBJ).
|
||||||
- MixedCompareBenchmarkTest: 249 ms -> 247 ms.
|
- MixedCompareBenchmarkTest: 249 ms -> 247 ms.
|
||||||
5) String ops
|
5) String ops (done)
|
||||||
- Extend fast path for string comparisons in hot loops.
|
- Mark GET_INDEX results as stable only for closed ObjString elements to enable fast compares.
|
||||||
|
- MixedCompareBenchmarkTest: 247 ms -> 240 ms.
|
||||||
6) Box/unbox audit
|
6) Box/unbox audit
|
||||||
- Identify remaining BOX_OBJ / OBJ_TO_* in inner loops and eliminate when safe.
|
- Identify remaining BOX_OBJ / OBJ_TO_* in inner loops and eliminate when safe.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user