mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 16:21:11 +00:00
Remove no-longer-necessary ReferenceCount uses in wasm
This commit is contained in:
parent
d9b8cec74d
commit
1ef5d785c0
3 changed files with 5 additions and 6 deletions
|
@ -7,7 +7,6 @@ The user needs to analyse the Wasm module's memory to decode the result.
|
||||||
use bumpalo::{collections::Vec, Bump};
|
use bumpalo::{collections::Vec, Bump};
|
||||||
use roc_builtins::bitcode::{FloatWidth, IntWidth};
|
use roc_builtins::bitcode::{FloatWidth, IntWidth};
|
||||||
use roc_mono::layout::{Builtin, Layout, UnionLayout};
|
use roc_mono::layout::{Builtin, Layout, UnionLayout};
|
||||||
use roc_std::ReferenceCount;
|
|
||||||
use roc_target::TargetInfo;
|
use roc_target::TargetInfo;
|
||||||
|
|
||||||
use crate::wasm32_sized::Wasm32Sized;
|
use crate::wasm32_sized::Wasm32Sized;
|
||||||
|
@ -197,7 +196,7 @@ impl Wasm32Result for RocStr {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: Wasm32Result + ReferenceCount> Wasm32Result for RocList<T> {
|
impl<T: Wasm32Result> Wasm32Result for RocList<T> {
|
||||||
fn build_wrapper_body(code_builder: &mut CodeBuilder, main_function_index: u32) {
|
fn build_wrapper_body(code_builder: &mut CodeBuilder, main_function_index: u32) {
|
||||||
build_wrapper_body_stack_memory(code_builder, main_function_index, 12)
|
build_wrapper_body_stack_memory(code_builder, main_function_index, 12)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use roc_std::{ReferenceCount, RocDec, RocList, RocOrder, RocStr};
|
use roc_std::{RocDec, RocList, RocOrder, RocStr};
|
||||||
|
|
||||||
pub trait Wasm32Sized: Sized {
|
pub trait Wasm32Sized: Sized {
|
||||||
const SIZE_OF_WASM: usize;
|
const SIZE_OF_WASM: usize;
|
||||||
|
@ -35,7 +35,7 @@ impl Wasm32Sized for RocStr {
|
||||||
const ALIGN_OF_WASM: usize = 4;
|
const ALIGN_OF_WASM: usize = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: Wasm32Sized + ReferenceCount> Wasm32Sized for RocList<T> {
|
impl<T: Wasm32Sized> Wasm32Sized for RocList<T> {
|
||||||
const SIZE_OF_WASM: usize = 12;
|
const SIZE_OF_WASM: usize = 12;
|
||||||
const ALIGN_OF_WASM: usize = 4;
|
const ALIGN_OF_WASM: usize = 4;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use roc_gen_wasm::wasm32_sized::Wasm32Sized;
|
use roc_gen_wasm::wasm32_sized::Wasm32Sized;
|
||||||
use roc_std::{ReferenceCount, RocDec, RocList, RocOrder, RocStr};
|
use roc_std::{RocDec, RocList, RocOrder, RocStr};
|
||||||
use std::convert::TryInto;
|
use std::convert::TryInto;
|
||||||
|
|
||||||
pub trait FromWasmerMemory: Wasm32Sized {
|
pub trait FromWasmerMemory: Wasm32Sized {
|
||||||
|
@ -74,7 +74,7 @@ impl FromWasmerMemory for RocStr {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: FromWasmerMemory + Clone + ReferenceCount> FromWasmerMemory for RocList<T> {
|
impl<T: FromWasmerMemory + Clone> FromWasmerMemory for RocList<T> {
|
||||||
fn decode(memory: &wasmer::Memory, offset: u32) -> Self {
|
fn decode(memory: &wasmer::Memory, offset: u32) -> Self {
|
||||||
let bytes = <u64 as FromWasmerMemory>::decode(memory, offset);
|
let bytes = <u64 as FromWasmerMemory>::decode(memory, offset);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue