mirror of
https://github.com/irmen/prog8.git
synced 2026-10-22 05:02:58 +00:00
m68k: plan for optimized stack frame zeroing
This commit is contained in:
1 parent
125af552ff
commit
cc8df33418
5 files changed
+261
-2
No files matched your search
@@ -469,6 +469,10 @@ class StackFrameLayout(private val program: IRProgram, private val errors: IErro
|
||||
cursor = cursor.floorDiv(alignment) * alignment // align down (cursor grows negative)
|
||||
cursor -= size
|
||||
frameVars += FrameVar(name, cursor, elemDt, count, v.dirty)
|
||||
if (v.length != null && size > 8 && !v.dirty && v.initializationValue == null) {
|
||||
val shortName = name.substringAfterLast('.').removePrefix("p8v_")
|
||||
errors.warn("local array '$shortName' ($size bytes) in subroutine '${userName(sub)}' is zero-initialized on every call which can be costly; consider @dirty if you assign it before use", sub.position)
|
||||
}
|
||||
}
|
||||
// a subroutine that can be re-entered needs its virtual registers per-activation as well:
|
||||
// the flat program-static register file is shared by all activations of the same subroutine
|
||||
|
||||
Reference in new issue
Block a user