mirror of
https://github.com/irmen/prog8.git
synced 2025-08-09 19:25:22 +00:00
rollback binexpr splitting, caused slowdowns
This commit is contained in:
@@ -58,19 +58,19 @@ X = BinExpr X = LeftExpr
|
|||||||
if(rightBx!=null && (!rightBx.left.isSimple || !rightBx.right.isSimple))
|
if(rightBx!=null && (!rightBx.left.isSimple || !rightBx.right.isSimple))
|
||||||
return noModifications
|
return noModifications
|
||||||
|
|
||||||
// TODO below attempts to remove stack-based evaluated expressions, but sometimes the resulting code is BIGGER.
|
// TODO below attempts to remove stack-based evaluated expressions, but often the resulting code is BIGGER, and SLOWER.
|
||||||
val dt = assignment.target.inferType(program)
|
// val dt = assignment.target.inferType(program)
|
||||||
if(!dt.isInteger)
|
// if(!dt.isInteger)
|
||||||
return noModifications
|
// return noModifications
|
||||||
val tempVar = IdentifierReference(getTempVarName(dt), binExpr.right.position)
|
// val tempVar = IdentifierReference(getTempVarName(dt), binExpr.right.position)
|
||||||
val assignTempVar = Assignment(
|
// val assignTempVar = Assignment(
|
||||||
AssignTarget(tempVar, null, null, binExpr.right.position),
|
// AssignTarget(tempVar, null, null, binExpr.right.position),
|
||||||
binExpr.right, binExpr.right.position
|
// binExpr.right, binExpr.right.position
|
||||||
)
|
// )
|
||||||
return listOf(
|
// return listOf(
|
||||||
IAstModification.InsertBefore(assignment, assignTempVar, assignment.parent as IStatementContainer),
|
// IAstModification.InsertBefore(assignment, assignTempVar, assignment.parent as IStatementContainer),
|
||||||
IAstModification.ReplaceNode(binExpr.right, tempVar.copy(), binExpr)
|
// IAstModification.ReplaceNode(binExpr.right, tempVar.copy(), binExpr)
|
||||||
)
|
// )
|
||||||
}
|
}
|
||||||
|
|
||||||
if(binExpr.right.isSimple) {
|
if(binExpr.right.isSimple) {
|
||||||
|
Reference in New Issue
Block a user