997066e2cd
The Dart language semantics requires global / static fields to be lazily
initialized on first access.
Though if the initializer expression does not have any side-effects, an
implementation may take the liberty to initialize a global earlier. The
downside of that is that if the initializer (despite being side-effect
free) is costly, the startup cost may suffer.
We introduce a `@pragma('wasm:initialize-at-startup')` that allows us to
explicitly opt-into running a global field's initializer at starutp.
This will mean we don't have to pay the lazy-initialization cost at
access time anymore. So when we before did this:
```
block X
global.get GX
br_on_non_null
call initializer
end
```
we now do this:
```
global.get GX
```
we also get rid of the initializer function.
We start to make use of this pragma in 3 places:
* hash map code that checks for deleted marker
* double to string cache
* string interning cache
Change-Id: I172ecda33fad8fab1a02b48b16784f8a9c89d205
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410340
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>