Mark loads from globals aligned and notrap.
Mark loads from globals generated by cton_wasm or by legalization as `aligned` and `notrap`, since memory for these globals should be allocated by the runtime environment for that purpose. This reduces the number of potentially trapping instructions, which can reduce the amount of metadata required by embedding environments.
This commit is contained in:
@@ -588,6 +588,9 @@ stack_check = Instruction(
|
||||
Read the stack limit from ``GV`` and compare it to the stack pointer. If
|
||||
the stack pointer has reached or exceeded the limit, generate a trap with a
|
||||
``stk_ovf`` code.
|
||||
|
||||
The global variable must be accessible and naturally aligned for a
|
||||
pointer-sized value.
|
||||
""",
|
||||
ins=GV, can_trap=True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user