Skip to content

Commit b852196

Browse files
committed
[WIP] Update to Cranelift 0.137
1 parent 0540977 commit b852196

4 files changed

Lines changed: 74 additions & 72 deletions

File tree

‎Cargo.lock‎

Lines changed: 47 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,28 @@ crate-type = ["dylib"]
88

99
[dependencies]
1010
# These have to be in sync with each other
11-
cranelift-codegen = { version = "0.135.0", default-features = false, features = ["std", "timing", "unwind", "all-native-arch"] }
12-
cranelift-frontend = { version = "0.135.0" }
13-
cranelift-module = { version = "0.135.0" }
14-
cranelift-native = { version = "0.135.0" }
15-
cranelift-jit = { version = "0.135.0", optional = true }
16-
cranelift-object = { version = "0.135.0", default-features = false }
11+
cranelift-codegen = { version = "0.137.0-rc.1", default-features = false, features = ["std", "timing", "unwind", "all-native-arch"] }
12+
cranelift-frontend = { version = "0.137.0-rc.1" }
13+
cranelift-module = { version = "0.137.0-rc.1" }
14+
cranelift-native = { version = "0.137.0-rc.1" }
15+
cranelift-jit = { version = "0.137.0-rc.1", optional = true }
16+
cranelift-object = { version = "0.137.0-rc.1", default-features = false }
1717
target-lexicon = "0.13"
1818
gimli = { version = "0.33", default-features = false, features = ["write"] }
19-
object = { version = "0.39.1", default-features = false, features = ["std", "read_core", "write", "archive", "coff", "elf", "macho", "pe"] }
19+
object = { version = "0.40.0", default-features = false, features = ["std", "read_core", "write", "archive", "coff", "elf", "macho", "pe"] }
2020

2121
indexmap = "2.0.0"
2222
libloading = { version = "0.9.0", optional = true }
2323
smallvec = "1.8.1"
2424

2525
# Uncomment to use an unreleased version of cranelift
2626
#[patch.crates-io]
27-
#cranelift-codegen = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-48.0.0" }
28-
#cranelift-frontend = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-48.0.0" }
29-
#cranelift-module = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-48.0.0" }
30-
#cranelift-native = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-48.0.0" }
31-
#cranelift-jit = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-48.0.0" }
32-
#cranelift-object = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-48.0.0" }
27+
#cranelift-codegen = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-50.0.0" }
28+
#cranelift-frontend = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-50.0.0" }
29+
#cranelift-module = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-50.0.0" }
30+
#cranelift-native = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-50.0.0" }
31+
#cranelift-jit = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-50.0.0" }
32+
#cranelift-object = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "release-50.0.0" }
3333

3434
# Uncomment to use local checkout of cranelift
3535
#cranelift-codegen = { path = "../wasmtime/cranelift/codegen" }

‎src/debuginfo/line_info.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ impl FunctionDebugContext {
168168

169169
let mcr = context.compiled_code().unwrap();
170170
for &MachSrcLoc { start, end, loc } in mcr.buffer.get_srclocs_sorted() {
171+
let loc = loc.as_abs();
171172
debug_context.dwarf.unit.line_program.row().address_offset = u64::from(start);
172173
if !loc.is_default() {
173174
let source_loc = self.source_loc_set[loc.bits() as usize];

‎src/debuginfo/unwind.rs‎

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Unwind info generation (`.eh_frame`)
22
3-
use cranelift_codegen::FinalizedMachExceptionHandler;
3+
use cranelift_codegen::MachExceptionHandler;
44
use cranelift_codegen::ir::Endianness;
55
use cranelift_codegen::isa::unwind::UnwindInfo;
66
use cranelift_module::DataId;
@@ -172,26 +172,19 @@ impl UnwindContext {
172172
}
173173
for &handler in call_site.exception_handlers {
174174
match handler {
175-
FinalizedMachExceptionHandler::Tag(tag, landingpad) => {
176-
match tag.as_u32() {
177-
EXCEPTION_HANDLER_CLEANUP => {
178-
gcc_except_table_data.call_sites.0.push(CallSite {
179-
start: u64::from(call_site.ret_addr - 1),
180-
length: 1,
181-
landing_pad: u64::from(landingpad),
182-
action_entry: None,
183-
})
184-
}
185-
EXCEPTION_HANDLER_CATCH => {
186-
gcc_except_table_data.call_sites.0.push(CallSite {
187-
start: u64::from(call_site.ret_addr - 1),
188-
length: 1,
189-
landing_pad: u64::from(landingpad),
190-
action_entry: Some(catch_action),
191-
})
192-
}
175+
MachExceptionHandler::Tag(tag, landingpad) => {
176+
let landing_pad = u64::from(landingpad.as_offset());
177+
let action_entry = match tag.as_u32() {
178+
EXCEPTION_HANDLER_CLEANUP => None,
179+
EXCEPTION_HANDLER_CATCH => Some(catch_action),
193180
_ => unreachable!(),
194-
}
181+
};
182+
gcc_except_table_data.call_sites.0.push(CallSite {
183+
start: u64::from(call_site.ret_addr - 1),
184+
length: 1,
185+
landing_pad,
186+
action_entry,
187+
});
195188
}
196189
_ => unreachable!(),
197190
}

0 commit comments

Comments
 (0)