Cranellift: remove Baldrdash support and related features. (#4571)
* Cranellift: remove Baldrdash support and related features.
As noted in Mozilla's bugzilla bug 1781425 [1], the SpiderMonkey team
has recently determined that their current form of integration with
Cranelift is too hard to maintain, and they have chosen to remove it
from their codebase. If and when they decide to build updated support
for Cranelift, they will adopt different approaches to several details
of the integration.
In the meantime, after discussion with the SpiderMonkey folks, they
agree that it makes sense to remove the bits of Cranelift that exist
to support the integration ("Baldrdash"), as they will not need
them. Many of these bits are difficult-to-maintain special cases that
are not actually tested in Cranelift proper: for example, the
Baldrdash integration required Cranelift to emit function bodies
without prologues/epilogues, and instead communicate very precise
information about the expected frame size and layout, then stitched
together something post-facto. This was brittle and caused a lot of
incidental complexity ("fallthrough returns", the resulting special
logic in block-ordering); this is just one example. As another
example, one particular Baldrdash ABI variant processed stack args in
reverse order, so our ABI code had to support both traversal
orders. We had a number of other Baldrdash-specific settings as well
that did various special things.
This PR removes Baldrdash ABI support, the `fallthrough_return`
instruction, and pulls some threads to remove now-unused bits as a
result of those two, with the understanding that the SpiderMonkey folks
will build new functionality as needed in the future and we can perhaps
find cleaner abstractions to make it all work.
[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1781425
* Review feedback.
* Fix (?) DWARF debug tests: add `--disable-cache` to wasmtime invocations.
The debugger tests invoke `wasmtime` from within each test case under
the control of a debugger (gdb or lldb). Some of these tests started to
inexplicably fail in CI with unrelated changes, and the failures were
only inconsistently reproducible locally. It seems to be cache related:
if we disable cached compilation on the nested `wasmtime` invocations,
the tests consistently pass.
* Review feedback.
This commit is contained in:
@@ -215,11 +215,6 @@ impl fmt::Display for AbiParam {
|
||||
/// particulars of the target's ABI, and the CLIF should be platform-independent, these attributes
|
||||
/// specify *how* to extend (according to the signedness of the original program) rather than
|
||||
/// *whether* to extend.
|
||||
///
|
||||
/// For example, on x86-64, the SystemV ABI does not require extensions of narrow values, so these
|
||||
/// `ArgumentExtension` attributes are ignored; but in the Baldrdash (SpiderMonkey) ABI on the same
|
||||
/// platform, all narrow values *are* extended, so these attributes may lead to extra
|
||||
/// zero/sign-extend instructions in the generated machine code.
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
|
||||
#[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))]
|
||||
pub enum ArgumentExtension {
|
||||
@@ -297,20 +292,6 @@ pub enum ArgumentPurpose {
|
||||
/// This is a pointer to a stack limit. It is used to check the current stack pointer
|
||||
/// against. Can only appear once in a signature.
|
||||
StackLimit,
|
||||
|
||||
/// A callee TLS value.
|
||||
///
|
||||
/// In the Baldrdash-2020 calling convention, the stack upon entry to the callee contains the
|
||||
/// TLS-register values for the caller and the callee. This argument is used to provide the
|
||||
/// value for the callee.
|
||||
CalleeTLS,
|
||||
|
||||
/// A caller TLS value.
|
||||
///
|
||||
/// In the Baldrdash-2020 calling convention, the stack upon entry to the callee contains the
|
||||
/// TLS-register values for the caller and the callee. This argument is used to provide the
|
||||
/// value for the caller.
|
||||
CallerTLS,
|
||||
}
|
||||
|
||||
impl fmt::Display for ArgumentPurpose {
|
||||
@@ -325,8 +306,6 @@ impl fmt::Display for ArgumentPurpose {
|
||||
Self::VMContext => "vmctx",
|
||||
Self::SignatureId => "sigid",
|
||||
Self::StackLimit => "stack_limit",
|
||||
Self::CalleeTLS => "callee_tls",
|
||||
Self::CallerTLS => "caller_tls",
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -447,9 +426,6 @@ mod tests {
|
||||
CallConv::Cold,
|
||||
CallConv::SystemV,
|
||||
CallConv::WindowsFastcall,
|
||||
CallConv::BaldrdashSystemV,
|
||||
CallConv::BaldrdashWindows,
|
||||
CallConv::Baldrdash2020,
|
||||
] {
|
||||
assert_eq!(Ok(cc), cc.to_string().parse())
|
||||
}
|
||||
@@ -457,18 +433,15 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn signatures() {
|
||||
let mut sig = Signature::new(CallConv::BaldrdashSystemV);
|
||||
assert_eq!(sig.to_string(), "() baldrdash_system_v");
|
||||
let mut sig = Signature::new(CallConv::WindowsFastcall);
|
||||
assert_eq!(sig.to_string(), "() windows_fastcall");
|
||||
sig.params.push(AbiParam::new(I32));
|
||||
assert_eq!(sig.to_string(), "(i32) baldrdash_system_v");
|
||||
assert_eq!(sig.to_string(), "(i32) windows_fastcall");
|
||||
sig.returns.push(AbiParam::new(F32));
|
||||
assert_eq!(sig.to_string(), "(i32) -> f32 baldrdash_system_v");
|
||||
assert_eq!(sig.to_string(), "(i32) -> f32 windows_fastcall");
|
||||
sig.params.push(AbiParam::new(I32.by(4).unwrap()));
|
||||
assert_eq!(sig.to_string(), "(i32, i32x4) -> f32 baldrdash_system_v");
|
||||
assert_eq!(sig.to_string(), "(i32, i32x4) -> f32 windows_fastcall");
|
||||
sig.returns.push(AbiParam::new(B8));
|
||||
assert_eq!(
|
||||
sig.to_string(),
|
||||
"(i32, i32x4) -> f32, b8 baldrdash_system_v"
|
||||
);
|
||||
assert_eq!(sig.to_string(), "(i32, i32x4) -> f32, b8 windows_fastcall");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user