Files
sdk/pkg/dart2wasm/lib
Martin Kustermann 997066e2cd [dart2wasm] Avoid lazy initialization checks for certain performance critical globals
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>
2025-02-18 13:06:43 -08:00
..
2025-02-11 13:59:46 -08:00
2025-02-11 13:59:46 -08:00
2025-02-11 13:59:46 -08:00
2025-02-11 13:59:46 -08:00
2025-02-11 13:59:46 -08:00
2025-02-11 13:59:46 -08:00
2025-02-11 13:59:46 -08:00
2025-02-11 13:59:46 -08:00
2025-02-11 13:59:46 -08:00
2025-02-11 13:59:46 -08:00
2025-01-21 14:08:20 -08:00
2024-03-05 16:57:47 +00:00
2025-02-11 13:59:46 -08:00
2025-02-11 13:59:46 -08:00
2025-02-11 13:59:46 -08:00