Skip to content

Commit

Permalink
Revert "Windows FPRs preservation (bytecodealliance#1216)"
Browse files Browse the repository at this point in the history
This reverts commit 4cca510.
  • Loading branch information
CryZe committed Apr 25, 2020
1 parent e37b3b0 commit a1d9030
Show file tree
Hide file tree
Showing 15 changed files with 76 additions and 610 deletions.
11 changes: 0 additions & 11 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,17 +194,6 @@ fn ignore(testsuite: &str, testname: &str, strategy: &str) -> bool {
("reference_types", "table_copy_on_imported_tables") => return false,
("reference_types", _) => return true,

("misc_testsuite", "export_large_signature")
| ("spec_testsuite", "call")
| ("multi_value", "call")
| ("multi_value", "func") => {
// FIXME These involves functions with very large stack frames that Cranelift currently
// cannot compile using the fastcall (Windows) calling convention.
// See https://github.com/bytecodealliance/wasmtime/pull/1216.
#[cfg(windows)]
return true;
}

_ => {}
},
_ => panic!("unrecognized strategy"),
Expand Down
4 changes: 2 additions & 2 deletions cranelift/codegen/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ impl Context {
isa: &dyn TargetIsa,
kind: FrameUnwindKind,
sink: &mut dyn FrameUnwindSink,
) -> CodegenResult<()> {
isa.emit_unwind_info(&self.func, kind, sink)
) {
isa.emit_unwind_info(&self.func, kind, sink);
}

/// Run the verifier on the function.
Expand Down
3 changes: 1 addition & 2 deletions cranelift/codegen/src/isa/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,9 +398,8 @@ pub trait TargetIsa: fmt::Display + Send + Sync {
_func: &ir::Function,
_kind: binemit::FrameUnwindKind,
_sink: &mut dyn binemit::FrameUnwindSink,
) -> CodegenResult<()> {
) {
// No-op by default
Ok(())
}
}

Expand Down
241 changes: 21 additions & 220 deletions cranelift/codegen/src/isa/x86/abi.rs

Large diffs are not rendered by default.

13 changes: 3 additions & 10 deletions cranelift/codegen/src/isa/x86/fde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use crate::binemit::{FrameUnwindOffset, FrameUnwindSink, Reloc};
use crate::ir::{FrameLayoutChange, Function};
use crate::isa::fde::RegisterMappingError;
use crate::isa::{CallConv, RegUnit, TargetIsa};
use crate::result::CodegenResult;
use alloc::vec::Vec;
use core::convert::TryInto;
use gimli::write::{
Expand Down Expand Up @@ -179,11 +178,7 @@ fn to_cfi(
}

/// Creates FDE structure from FrameLayout.
pub fn emit_fde(
func: &Function,
isa: &dyn TargetIsa,
sink: &mut dyn FrameUnwindSink,
) -> CodegenResult<()> {
pub fn emit_fde(func: &Function, isa: &dyn TargetIsa, sink: &mut dyn FrameUnwindSink) {
assert!(isa.name() == "x86");

// Expecting function with System V prologue
Expand Down Expand Up @@ -271,8 +266,6 @@ pub fn emit_fde(

// Need 0 marker for GCC unwind to end FDE "list".
sink.bytes(&[0, 0, 0, 0]);

Ok(())
}

#[cfg(test)]
Expand Down Expand Up @@ -321,7 +314,7 @@ mod tests {
context.compile(&*isa).expect("expected compilation");

let mut sink = SimpleUnwindSink(Vec::new(), 0, Vec::new());
emit_fde(&context.func, &*isa, &mut sink).expect("can emit fde");
emit_fde(&context.func, &*isa, &mut sink);

assert_eq!(
sink.0,
Expand Down Expand Up @@ -383,7 +376,7 @@ mod tests {
context.compile(&*isa).expect("expected compilation");

let mut sink = SimpleUnwindSink(Vec::new(), 0, Vec::new());
emit_fde(&context.func, &*isa, &mut sink).expect("can emit fde");
emit_fde(&context.func, &*isa, &mut sink);

assert_eq!(
sink.0,
Expand Down
4 changes: 2 additions & 2 deletions cranelift/codegen/src/isa/x86/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ impl TargetIsa for Isa {
func: &ir::Function,
kind: FrameUnwindKind,
sink: &mut dyn FrameUnwindSink,
) -> CodegenResult<()> {
abi::emit_unwind_info(func, self, kind, sink)
) {
abi::emit_unwind_info(func, self, kind, sink);
}
}

Expand Down
Loading

0 comments on commit a1d9030

Please sign in to comment.