Use fast compare for stable obj temps
This commit is contained in:
parent
44f9573eec
commit
e8f5c9eaf4
@ -1683,12 +1683,12 @@ class BytecodeCompiler(
|
|||||||
val left = ensureObjSlot(a)
|
val left = ensureObjSlot(a)
|
||||||
val right = ensureObjSlot(b)
|
val right = ensureObjSlot(b)
|
||||||
val opcode = when {
|
val opcode = when {
|
||||||
isExactNonNullSlotClass(left.slot, ObjString.type) &&
|
isExactNonNullSlotClassOrTemp(left.slot, ObjString.type) &&
|
||||||
isExactNonNullSlotClass(right.slot, ObjString.type) -> stringOp
|
isExactNonNullSlotClassOrTemp(right.slot, ObjString.type) -> stringOp
|
||||||
isExactNonNullSlotClass(left.slot, ObjInt.type) &&
|
isExactNonNullSlotClassOrTemp(left.slot, ObjInt.type) &&
|
||||||
isExactNonNullSlotClass(right.slot, ObjInt.type) -> intOp
|
isExactNonNullSlotClassOrTemp(right.slot, ObjInt.type) -> intOp
|
||||||
isExactNonNullSlotClass(left.slot, ObjReal.type) &&
|
isExactNonNullSlotClassOrTemp(left.slot, ObjReal.type) &&
|
||||||
isExactNonNullSlotClass(right.slot, ObjReal.type) -> realOp
|
isExactNonNullSlotClassOrTemp(right.slot, ObjReal.type) -> realOp
|
||||||
else -> objOp
|
else -> objOp
|
||||||
}
|
}
|
||||||
builder.emit(opcode, left.slot, right.slot, out)
|
builder.emit(opcode, left.slot, right.slot, out)
|
||||||
|
|||||||
@ -4,8 +4,9 @@ Baseline
|
|||||||
- See `notes/nested_range_baseline.md`
|
- See `notes/nested_range_baseline.md`
|
||||||
|
|
||||||
Candidates (not started)
|
Candidates (not started)
|
||||||
1) Primitive comparisons
|
1) Primitive comparisons (done)
|
||||||
- Emit fast CMP variants for known ObjString/ObjInt/ObjReal/ObjBool across all comparison operators.
|
- Emit fast CMP variants for known ObjString/ObjInt/ObjReal using temp/stable slots.
|
||||||
|
- MixedCompareBenchmarkTest: 374 ms -> 347 ms.
|
||||||
2) Mixed numeric ops
|
2) Mixed numeric ops
|
||||||
- Ensure INT+REAL arithmetic uses INT_TO_REAL + REAL op with no extra moves/boxing.
|
- Ensure INT+REAL arithmetic uses INT_TO_REAL + REAL op with no extra moves/boxing.
|
||||||
3) Boolean conversion
|
3) Boolean conversion
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user