Difference between revisions of "WebAssembly/Internals"

From Free Pascal wiki
Jump to navigationJump to search
(Created page with "==Code Branching/Flow Control== ''todo: rewrite to the better explanation'' WebAssembly doesn't allow direct jumps to (address/label)/or jump by offset. It only allows to ju...")
 
Line 5: Line 5:
 
It only allows to jump "out-of" a code block, where the code block would be identified by a label. I.e. beginning of the loop label (for '''continue''') or end of the loop label (for '''break'''). Loop itself is a single code block, known as "loop" in WebAssembly ).
 
It only allows to jump "out-of" a code block, where the code block would be identified by a label. I.e. beginning of the loop label (for '''continue''') or end of the loop label (for '''break'''). Loop itself is a single code block, known as "loop" in WebAssembly ).
  
 +
FPC basic implementation is based of the ability of conditional jump instructions to a specified label. For that reason, the default implementation of TCGIfNode doesn't apply.
 +
Also, not every conditional jump instructions can have a label assign to it. Only instructions that jump out of the block are should use labels. Other, simply rely on the fact, that the next instruction IS the point they needs to be.
  
 
==See Also==
 
==See Also==
 
* [[WebAssembly]]
 
* [[WebAssembly]]
 
[[Category:WebAssembly]]
 
[[Category:WebAssembly]]

Revision as of 16:33, 9 September 2019

Code Branching/Flow Control

todo: rewrite to the better explanation

WebAssembly doesn't allow direct jumps to (address/label)/or jump by offset. It only allows to jump "out-of" a code block, where the code block would be identified by a label. I.e. beginning of the loop label (for continue) or end of the loop label (for break). Loop itself is a single code block, known as "loop" in WebAssembly ).

FPC basic implementation is based of the ability of conditional jump instructions to a specified label. For that reason, the default implementation of TCGIfNode doesn't apply. Also, not every conditional jump instructions can have a label assign to it. Only instructions that jump out of the block are should use labels. Other, simply rely on the fact, that the next instruction IS the point they needs to be.

See Also