registerBridgeTypeLazy method

void registerBridgeTypeLazy(
  1. Type nativeType,
  2. BridgedClass thunk()
)

Lazy variant of registerBridgeType: registers a deferred thunk under nativeType in the type-only lookup without building the BridgedClass until the type is first resolved by toBridgedInstance.

Used by the warm-parent / baseline registration so importing a bridge package registers the type baseline without forcing every one of the package's classes to build up front (import-optimization plan step #17).

Implementation

void registerBridgeTypeLazy(Type nativeType, BridgedClass Function() thunk) {
  _bridgedClassesLookupByTypeOrNew.putThunk(nativeType, thunk);
  _invalidateResolutionCache();
}