Skip to content

Commit 6cc2ea1

Browse files
committed
address more of Alex' comments
1 parent 754ef09 commit 6cc2ea1

File tree

8 files changed

+18
-18
lines changed

8 files changed

+18
-18
lines changed

crates/cli-flags/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,9 +1005,6 @@ impl CommonOptions {
10051005
("gc", gc, wasm_gc)
10061006
("gc", reference_types, wasm_reference_types)
10071007
("gc", function_references, wasm_function_references)
1008-
// FIXME(frank-emrich): If function-references depends on the gc
1009-
// feature, and stack-switching requires function-references, that
1010-
// probably means that stack-switching should depend on gc.
10111008
("stack-switching", stack_switching, wasm_stack_switching)
10121009
}
10131010
Ok(())

crates/cranelift/src/func_environ.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2287,7 +2287,6 @@ impl FuncEnvironment<'_> {
22872287
WasmHeapTopType::Any | WasmHeapTopType::Extern => pos.ins().iconst(types::I32, 0),
22882288
WasmHeapTopType::Cont => {
22892289
let zero = pos.ins().iconst(self.pointer_type(), 0);
2290-
// TODO do this nicer
22912290
stack_switching::fatpointer::construct(self, &mut pos, zero, zero)
22922291
}
22932292
})

crates/cranelift/src/gc/enabled.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,10 @@ fn read_field_at_addr(
149149
builder.func.dfg.first_result(call_inst)
150150
}
151151
WasmHeapTopType::Cont => {
152-
unimplemented!("Stack switching feature not compatible with GC, yet")
152+
// TODO(#10248) GC integration for stack switching
153+
return Err(wasmtime_environ::WasmError::Unsupported(
154+
"Stack switching feature not compatbile with GC, yet".to_string(),
155+
));
153156
}
154157
},
155158
},
@@ -1068,7 +1071,7 @@ pub fn translate_ref_test(
10681071
func_env.is_subtype(builder, actual_shared_ty, expected_shared_ty)
10691072
}
10701073
WasmHeapType::ConcreteCont(_) => {
1071-
// TODO(#10248)
1074+
// TODO(#10248) GC integration for stack switching
10721075
return Err(wasmtime_environ::WasmError::Unsupported(
10731076
"Stack switching feature not compatbile with GC, yet".to_string(),
10741077
));

crates/cranelift/src/stack_switching/fatpointer.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ pub(crate) fn deconstruct<'a>(
2222
) -> (ir::Value, ir::Value) {
2323
debug_assert_eq!(pos.func.dfg.value_type(contobj), POINTER_TYPE);
2424

25-
let lsbs = pos.ins().ireduce(I64, contobj);
26-
let msbs = pos.ins().ushr_imm(contobj, 64);
27-
let msbs = pos.ins().ireduce(I64, msbs);
25+
let (lsbs, msbs) = pos.ins().isplit(contobj);
2826

2927
let (revision_counter, contref) = match env.isa.endianness() {
3028
ir::Endianness::Little => (lsbs, msbs),

crates/wasmtime/src/runtime/externals/global.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,10 @@ impl Global {
130130
})
131131
.into(),
132132
),
133-
HeapType::NoCont | HeapType::ConcreteCont(_) | HeapType::Cont => todo!(
134-
"Embedder support for continuations has not yet been implemented!"
135-
),
133+
HeapType::NoCont | HeapType::ConcreteCont(_) | HeapType::Cont => {
134+
// TODO(#10248) Required to support stack switching in the embedder API.
135+
unimplemented!()
136+
}
136137

137138
HeapType::NoExtern => Ref::Extern(None),
138139

crates/wasmtime/src/runtime/externals/table.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,10 @@ impl Table {
189189
}
190190
}
191191

192-
runtime::TableElement::ContRef(_c) => todo!(), // TODO(dhil): Required for the embedder API.
192+
runtime::TableElement::ContRef(_c) => {
193+
// TODO(#10248) Required to support stack switching in the embedder API.
194+
unimplemented!()
195+
}
193196
}
194197
}
195198
}

crates/wasmtime/src/runtime/values.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,9 @@ impl Val {
281281
HeapType::NoFunc => Ref::Func(None),
282282

283283
HeapType::NoCont | HeapType::ConcreteCont(_) | HeapType::Cont => {
284+
// TODO(#10248): Required to support stack switching in the embedder API.
284285
unimplemented!()
285-
} // TODO(dhil): Need to do this for the embedder API.
286+
}
286287

287288
HeapType::Extern => ExternRef::_from_raw(store, raw.get_externref()).into(),
288289

crates/wast-util/src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,8 @@ impl Compiler {
305305
if config.threads() {
306306
return true;
307307
}
308-
// Unsupported proposals. Note that other proposals have partial
309-
// support at this time (pulley is a work-in-progress) and so
310-
// individual tests are listed below as "should fail" even if
311-
// they're not covered in this list.
308+
309+
// Stack switching is not supported by Pulley.
312310
if config.stack_switching() {
313311
return true;
314312
}

0 commit comments

Comments
 (0)