mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
stop passing stdlib (use lazy_static)
This commit is contained in:
parent
f25afe4629
commit
d8fa2b8d92
12 changed files with 14 additions and 89 deletions
|
@ -37,13 +37,12 @@ fn promote_expr_to_module(src: &str) -> String {
|
|||
pub fn compile_and_load<'a, T: Wasm32Result>(
|
||||
arena: &'a bumpalo::Bump,
|
||||
src: &str,
|
||||
stdlib: &'a roc_builtins::std::StdLib,
|
||||
_test_wrapper_type_info: PhantomData<T>,
|
||||
) -> wasmer::Instance {
|
||||
let platform_bytes = load_platform_and_builtins();
|
||||
|
||||
let compiled_bytes =
|
||||
compile_roc_to_wasm_bytes(arena, stdlib, &platform_bytes, src, _test_wrapper_type_info);
|
||||
compile_roc_to_wasm_bytes(arena, &platform_bytes, src, _test_wrapper_type_info);
|
||||
|
||||
if DEBUG_LOG_SETTINGS.keep_test_binary {
|
||||
let build_dir_hash = src_hash(src);
|
||||
|
@ -67,7 +66,6 @@ fn src_hash(src: &str) -> u64 {
|
|||
|
||||
fn compile_roc_to_wasm_bytes<'a, T: Wasm32Result>(
|
||||
arena: &'a bumpalo::Bump,
|
||||
stdlib: &'a roc_builtins::std::StdLib,
|
||||
preload_bytes: &[u8],
|
||||
src: &str,
|
||||
_test_wrapper_type_info: PhantomData<T>,
|
||||
|
@ -90,7 +88,6 @@ fn compile_roc_to_wasm_bytes<'a, T: Wasm32Result>(
|
|||
arena,
|
||||
filename,
|
||||
module_src,
|
||||
stdlib,
|
||||
src_dir,
|
||||
Default::default(),
|
||||
roc_target::TargetInfo::default_wasm32(),
|
||||
|
@ -183,10 +180,7 @@ where
|
|||
{
|
||||
let arena = bumpalo::Bump::new();
|
||||
|
||||
// NOTE the stdlib must be in the arena; just taking a reference will segfault
|
||||
let stdlib = arena.alloc(roc_builtins::std::standard_stdlib());
|
||||
|
||||
let instance = crate::helpers::wasm::compile_and_load(&arena, src, stdlib, phantom);
|
||||
let instance = crate::helpers::wasm::compile_and_load(&arena, src, phantom);
|
||||
|
||||
let memory = instance.exports.get_memory(MEMORY_NAME).unwrap();
|
||||
|
||||
|
@ -256,10 +250,7 @@ where
|
|||
{
|
||||
let arena = bumpalo::Bump::new();
|
||||
|
||||
// NOTE the stdlib must be in the arena; just taking a reference will segfault
|
||||
let stdlib = arena.alloc(roc_builtins::std::standard_stdlib());
|
||||
|
||||
let instance = crate::helpers::wasm::compile_and_load(&arena, src, stdlib, phantom);
|
||||
let instance = crate::helpers::wasm::compile_and_load(&arena, src, phantom);
|
||||
|
||||
let memory = instance.exports.get_memory(MEMORY_NAME).unwrap();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue