Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix and enable GC on new x64 backend. #2410

Merged
merged 1 commit into from
Nov 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions cranelift/codegen/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use crate::legalize_function;
use crate::legalizer::simple_legalize;
use crate::licm::do_licm;
use crate::loop_analysis::LoopAnalysis;
use crate::machinst::MachCompileResult;
use crate::machinst::{MachCompileResult, MachStackMap};
use crate::nan_canonicalization::do_nan_canonicalization;
use crate::postopt::do_postopt;
use crate::redundant_reload_remover::RedundantReloadRemover;
Expand Down Expand Up @@ -239,10 +239,23 @@ impl Context {
let mut sink = MemoryCodeSink::new(mem, relocs, traps, stack_maps);
if let Some(ref result) = &self.mach_compile_result {
result.buffer.emit(&mut sink);
let info = sink.info;
// New backends do not emit StackMaps through the `CodeSink` because its interface
// requires `Value`s; instead, the `StackMap` objects are directly accessible via
// `result.buffer.stack_maps()`.
for &MachStackMap {
offset_end,
ref stack_map,
..
} in result.buffer.stack_maps()
{
stack_maps.add_stack_map(offset_end, stack_map.clone());
}
info
} else {
isa.emit_function_to_memory(&self.func, &mut sink);
sink.info
}
sink.info
}

/// Creates unwind information for the function.
Expand Down
3 changes: 0 additions & 3 deletions tests/all/gc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ impl Drop for GcOnDrop {
}

#[test]
#[cfg_attr(feature = "experimental_x64", ignore)] // TODO #2079 investigate.
fn smoke_test_gc() -> anyhow::Result<()> {
let (store, module) = ref_types_module(
r#"
Expand Down Expand Up @@ -121,7 +120,6 @@ fn wasm_dropping_refs() -> anyhow::Result<()> {
}

#[test]
#[cfg_attr(feature = "experimental_x64", ignore)] // TODO #2079 investigate.
fn many_live_refs() -> anyhow::Result<()> {
let mut wat = r#"
(module
Expand Down Expand Up @@ -375,7 +373,6 @@ fn gc_during_gc_when_passing_refs_into_wasm() -> anyhow::Result<()> {
}

#[test]
#[cfg_attr(feature = "experimental_x64", ignore)] // TODO #2079 investigate.
fn gc_during_gc_from_many_table_gets() -> anyhow::Result<()> {
let (store, module) = ref_types_module(
r#"
Expand Down