Use same CompiledCode for import replacement (#478)
This commit allows CompiledCode to be re-used regardless of the existence of import replacement configs for instantiation. In order to achieve this, we introduce ModuleID, which is sha256 checksum calculated on source bytes, as a key for module compilation cache. Previously, we used*wasm.Module as keys for caches which differ before/after import replacement. Signed-off-by: Takeshi Yoneda takeshi@tetrate.io
This commit is contained in:
@@ -256,9 +256,7 @@ func (b *moduleBuilder) Build() (*CompiledCode, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
ret := &CompiledCode{module: module}
|
||||
ret.addCacheEntry(module, b.r.store.Engine)
|
||||
return &CompiledCode{module: module}, nil
|
||||
return &CompiledCode{module: module, compiledEngine: b.r.store.Engine}, nil
|
||||
}
|
||||
|
||||
// Instantiate implements ModuleBuilder.Instantiate
|
||||
|
||||
Reference in New Issue
Block a user