Get a compilation context or create a new one if none available.
(&self, translation: &ModuleTranslation)
| 46 | |
| 47 | /// Get a compilation context or create a new one if none available. |
| 48 | fn get_context(&self, translation: &ModuleTranslation) -> CompilationContext { |
| 49 | self.contexts.lock().unwrap().pop().unwrap_or_else(|| { |
| 50 | let pointer_size = self.isa.pointer_bytes(); |
| 51 | let vmoffsets = VMOffsets::new(pointer_size, &translation.module); |
| 52 | CompilationContext { |
| 53 | allocations: Default::default(), |
| 54 | builtins: BuiltinFunctions::new( |
| 55 | &vmoffsets, |
| 56 | self.isa.wasmtime_call_conv(), |
| 57 | CallingConvention::Default, |
| 58 | ), |
| 59 | } |
| 60 | }) |
| 61 | } |
| 62 | |
| 63 | /// Save a compilation context. |
| 64 | fn save_context(&self, mut context: CompilationContext, allocs: FuncValidatorAllocations) { |
no test coverage detected