Cranelift: Add heap_load and heap_store instructions (#5300)
* Cranelift: Define `heap_load` and `heap_store` instructions
* Cranelift: Implement interpreter support for `heap_load` and `heap_store`
* Cranelift: Add a suite runtests for `heap_{load,store}`
There are so many knobs we can twist for heaps and I wanted to exhaustively test
all of them, so I wrote a script to generate the tests. I've checked in the
script in case we want to make any changes in the future, but I don't think it
is worth adding this to CI to check that scripts are up to date or anything like
that.
* Review feedback
This commit is contained in:
@@ -139,8 +139,8 @@ pub(crate) fn lower_insn_to_regs(
|
||||
panic!("Direct stack memory access not supported; should not be used by Wasm");
|
||||
}
|
||||
|
||||
Opcode::HeapAddr => {
|
||||
panic!("heap_addr should have been removed by legalization!");
|
||||
Opcode::HeapLoad | Opcode::HeapStore | Opcode::HeapAddr => {
|
||||
panic!("heap access instructions should have been removed by legalization!");
|
||||
}
|
||||
|
||||
Opcode::TableAddr => {
|
||||
|
||||
@@ -212,8 +212,8 @@ impl LowerBackend for S390xBackend {
|
||||
Opcode::StackLoad | Opcode::StackStore => {
|
||||
panic!("Direct stack memory access not supported; should not be used by Wasm");
|
||||
}
|
||||
Opcode::HeapAddr => {
|
||||
panic!("heap_addr should have been removed by legalization!");
|
||||
Opcode::HeapLoad | Opcode::HeapStore | Opcode::HeapAddr => {
|
||||
panic!("heap access instructions should have been removed by legalization!");
|
||||
}
|
||||
Opcode::TableAddr => {
|
||||
panic!("table_addr should have been removed by legalization!");
|
||||
|
||||
@@ -549,8 +549,8 @@ fn lower_insn_to_regs(
|
||||
panic!("global_value should have been removed by legalization!");
|
||||
}
|
||||
|
||||
Opcode::HeapAddr => {
|
||||
panic!("heap_addr should have been removed by legalization!");
|
||||
Opcode::HeapLoad | Opcode::HeapStore | Opcode::HeapAddr => {
|
||||
panic!("heap access instructions should have been removed by legalization!");
|
||||
}
|
||||
|
||||
Opcode::TableAddr => {
|
||||
|
||||
Reference in New Issue
Block a user