-
Notifications
You must be signed in to change notification settings - Fork 824
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1870: Added basic AddressMap support for singlepass r=syrusakbary a=syrusakbary <!-- Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test: https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests --> # Description This PR should fix #1856 and #1523 by adding address maps with the locations related to the traps. The PR makes the following command to pass (in debug mode): ``` cargo test --features "singlepass" --features "test-singlepass test-jit" ``` <!-- Provide details regarding the change including motivation, links to related issues, and the context of the PR. --> # Review - [ ] Add a short description of the the change to the CHANGELOG.md file Co-authored-by: Syrus <[email protected]> Co-authored-by: Syrus Akbary <[email protected]>
- Loading branch information
Showing
5 changed files
with
107 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use wasmer_compiler::{FunctionAddressMap, FunctionBodyData, InstructionAddressMap, SourceLoc}; | ||
|
||
pub fn get_function_address_map<'data>( | ||
instructions: Vec<InstructionAddressMap>, | ||
data: &FunctionBodyData<'data>, | ||
body_len: usize, | ||
) -> FunctionAddressMap { | ||
// Generate source loc for a function start/end to identify boundary within module. | ||
// It will wrap around if byte code is larger than 4 GB. | ||
let start_srcloc = SourceLoc::new(data.module_offset as u32); | ||
let end_srcloc = SourceLoc::new((data.module_offset + data.data.len()) as u32); | ||
|
||
FunctionAddressMap { | ||
instructions, | ||
start_srcloc, | ||
end_srcloc, | ||
body_offset: 0, | ||
body_len, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters