# wasm: Re-use genTypedValue for constants · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/b9fe6a93ff51ecb5ce770c78f463c38a0620de49)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: b9fe6a93ff51ecb5ce770c78f463c38a0620de49

Requested commit: b9fe6a93ff51ecb5ce770c78f463c38a0620de49

Commit: b9fe6a93ff51ecb5ce770c78f463c38a0620de49

Tree: a155cb583568eb2136dfb8fd42ff40b9c41245f1

Author: Luuk de Gram

Committer: Luuk de Gram

## Message

```
wasm: Re-use genTypedValue for constants

When a constant will be passed by reference, such as a struct, we will call into genTypedValue
to lower the constant to bytes and store them into the `rodata` section. We will then return the address
of this constant as a `WValue`.
This change means we will have all constants lowered during compilation time, and no longer have
to sacrifice runtime to lower them onto the stack.

```

## Parents

- [1fe1e4d29207de8c972fcc1b61266fbaddb07d63](https://git.cafe/gitcafe/zig/commit/1fe1e4d29207de8c972fcc1b61266fbaddb07d63?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/b9fe6a93ff51ecb5ce770c78f463c38a0620de49?format=markdown)
