-
Notifications
You must be signed in to change notification settings - Fork 833
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
Feature/llvm pic mcsmall #1607
Feature/llvm pic mcsmall #1607
Conversation
There's no connection the target pointer size and which relocations exist. Relocations may affect as many bytes, or even just bits, as they like.
…uous region. Work in progress commit.
Return custom sections from JITEngineInner::allocate. In CodeMemory, move the `mmap` member after the `unwind_registries` member. The UnwindRegistry registers by pointer into the memory owned by the Mmap, once the Mmap is deleted, this is gone. (Yes, this means that the Arc<> here is somewhat fictitious, if unwind_registries haven't been dropped before this point then attempting to drop them after mmap will dereference a dangling pointer.) Make SectionBodyPtr a full wrapper type instead of a type alias so that we can use SectionBodyPtr(expr) syntax.
Codecov Report
@@ Coverage Diff @@
## master #1607 +/- ##
==========================================
- Coverage 31.76% 31.72% -0.05%
==========================================
Files 185 185
Lines 27017 26995 -22
==========================================
- Hits 8583 8564 -19
+ Misses 18434 18431 -3
Continue to review full report at Codecov.
|
@@ -37,22 +37,18 @@ fn apply_relocation( | |||
}; | |||
|
|||
match r.kind { | |||
#[cfg(target_pointer_width = "64")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was intentional. JIT can only support the target pointer widths for the target architecture.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The relocation specifies how many bits it modifies, regardless of the pointer width on the machine. For example AArch64 has LD_PREL_LO19 which edits exactly 19 bits of the value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I understand that.
What I mean is, before if you were trying to run code compiled for a 64 bit machine, in a 32 bit machine, it would have fall back to a panic!
->
wasmer/lib/engine-jit/src/link.rs
Lines 57 to 60 in 742d73d
kind => panic!( | |
"Relocation kind unsupported in the current architecture {}", | |
kind | |
), |
By removing the cfg
macro, it will silently fail until you actually try to run it. Which I think is a worse developer experience.
lib/engine-jit/src/engine.rs
Outdated
@@ -157,7 +157,7 @@ pub struct JITEngineInner { | |||
features: Features, | |||
/// The code memory is responsible of publishing the compiled | |||
/// functions to memory. | |||
code_memory: CodeMemory, | |||
code_memory: Vec<CodeMemory>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying to understand the needs/implications of this. I guess now each artifact will have its own CodeMemory
?
Is that assumption accurate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, and each CodeMemory
has one Mmap
. To get small code model to work, everything a compiled module needs is within a single 32-bit region.
Marking this as obsolete as this have changed |
Description
Review