Liste des Groupes | Revenir à cl c |
On 12/18/2024 6:08 AM, bart wrote:
Well, this is pretty much what I do in stack code. I consider it impure, as in needing artificial hints, but also the simplest solution.With stack code, the result conveniently ends up on top of the stack whichever path is taken, which is a big advantage. Unless you then have to convert that to register code, and need to ensure the values end up in the same register when the control paths join up again.With JVM, the rule was that all paths landing at the same label need to have the same stack depth and same types.
>
With .NET, the rule was that the stack was always empty, any merging would need to be done using variables.
BGBCC is sorta mixed:
In most cases, it follows the .NET rule;
A special-case exception exists mostly for implementing the ?: operation (which in turn has special stack operations to signal its use).
BEGINU // start a ?: operator
L0:
... //one case
SETU
JMP L2
L1:
... //other case
SETU
JMP L2
ENDU
L2:
This is a bit of wonk,
if I were designing it now, would likely do it the same as .NET, and use temporary variables.In 3AC then it's easy, all paths write to the same temporary.
Les messages affichés proviennent d'usenet.