-
Notifications
You must be signed in to change notification settings - Fork 54
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 label docs (and a couple of misc bits) #92
Conversation
``` $ cargo doc error: document output filename collision The bin `aarch64` in package `hello-world v0.1.0 (/home/vext01/source/dynasm-rs/doc/examples/hello-world)` has the same name as the bin `aarch64` in package `bf-jit v0.1.0 (/home/vext01/source/dynasm-rs/doc/examples/bf-jit)`. Only one may be documented at once since they output to the same path. Consider documenting only one, renaming one, or marking one with `doc = false` in Cargo.toml. ```
Recently Rust starting warning about redundant imports, e.g.: ``` warning: the item `Extend` is imported redundantly --> runtime/src/lib.rs:39:5 | 39 | use std::iter::Extend; | ^^^^^^^^^^^^^^^^^ ``` This change removes all such imports.
doc/langref_common.md
Outdated
Dynamic | dynamic | `=>expr` | `=>expr` | ||
Extern | dynamic | `-` | `extern expr` | ||
|
||
Static label kinds ("Local" and "Global") have their addresses resolved at the |
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.
Is this true?
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 doesn't seem correct. All label types are resolved at commit
time. Extern is also not a dynamic label, it's something completely different (it is literally just targetting a given address).
The difference between static and dynamic labels is that the identifier (name) is fixed at rustc compile time for static labels, while you can create new identifiers (basically just an incrementing integer) at runtime for dynamic labels.
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 must admit, there was a fair amount of guesswork going on here. I don't actually know how dynasm works under the hood!
What I'd like the docs to be able to tell me is which kinds of label can be looked up with LabelRegistry::resolve_static()
and what kinds can be looked up with LabelRegistry::resolve_dynamic()
.
I assume that local
and global
are for resolve_static()
, and that dynamic
is (guess what?) resolve_dynamic(). But what about extern
?
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.
Sorry for the delay, life has a way.
Anyway, extern
doesn't need a lookup. if you assemble jmp extern 0x1234
it'll literally insert a jump to 0x1234. This is mostly relevant to x86, as the default jump in x86 can access the entire address space, always. However, that jump is relative, so we need to know about it for when the buffer gets moved around.
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 think a544dea addresses the above comments.
Makes docs build on stable rust again. Fixes CensoredUsername#94.
I've pushed a few more commits. I'll wait for you response about the label types before attempting to fix that. I also notice that on nightly rust,
But removing them also isn't correct. I'm not sure about this... |
I'll likely look over this in the weekend. in the meantime, you should be able to generate the docs by running ./build_docs.sh |
Let me know and I can push changes to fix whatever I've misunderstood. |
Poke ;) could you fix the errors in the label documentation I mentioned? |
My apologies. I missed your message. I'll try to get to this soon. |
@CensoredUsername were those changes any good? |
Heya, sorry for the late reply. I want to merge this somewhere next week, it looks good 👍 |
I did some cleanup, and it's all merged into dev now. thanks! And apologies for the delay. |
Main work is in 8d5f2f2, as discussed in #91.
I was unable to check the rendered output of my non-sourcefile doc changes (e.g. language ref), as I don't know how to generate the html :)