-
Notifications
You must be signed in to change notification settings - Fork 79
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
Refactor SLJIT's documentation #292
base: master
Are you sure you want to change the base?
Conversation
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.
Thank you for working on this. The change is very large, and it is hard to track what is changed in the reworked files. Is it worth to split it into a few smaller PRs?
Do we need to add docs/website/package-lock.json ? Looks very big.
|
||
## 🚀 Quickstart | ||
|
||
Copy the `sljit_src` directory into your project's source directory and include [`sljitLir.h`](./sljit_src/sljitLir.h): |
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 would not add code examples to readme. A comment could be added to a file which contains a basic example.
|
||
--- | ||
|
||
## 👉 Purpose |
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 usually don't prefer the colorful characters. Please remove them.
The CPU has: | ||
- integer registers, which can store either an `int32_t` (4 byte) or `intptr_t` (4 or 8 byte) value | ||
- floating point registers, which can store either a single (4 byte) or double (8 byte) precision value | ||
- boolean status flags |
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.
Some cpus have vector registers as well. On others vector registers also contain the floating point values.
@@ -0,0 +1,8 @@ | |||
{ |
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 file used by some generator?
| `MIPS` | ✅[^3] | ✅[^3] | | ||
|
||
[^1]: only on certain platforms | ||
[^2]: ARM-v5, ARM-v7 and Thumb2 instruction sets |
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.
ARM-v6 now is the minimum. ARM-v5 is 25 years old, and probably not used by high performance use cases anymore.
|
||
# Bytecode Interpreters | ||
|
||
SLJIT's approach is very effective for bytecode interpreters, since their machine-independent bytecode (middle-level representation) typically contains instructions which either can be easly translated to machine code, or which are not worth to translate to machine code in the first place. |
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.
When I wrote that part, I just added some words, but never be happy about it. If you have a better idea about explaining this, it could be better. Or perhaps we could delete the whole thing.
|
||
SLJIT tries to strike a good balance between performance and maintainability. | ||
The LIR code can be compiled to many CPU architectures, and the performance of the generated code is very close to code written in native assembly languages. | ||
Although SLJIT does not support higher level features such as automatic register allocation, it can be a code generation backend for other JIT compiler libraries. |
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.
We could mention that there are simple register allocation algorithms, such as linear scan, which is not difficult to implement.
This is the first part of the changes discussed in #285. This PR pretty much only covers refactoring the existing stuff for now.
An overview of the changes:
doc
folder todocs
, which I though was more canonical. Can be easily changed back todoc
though if you want to keep it.README
,doc/overview.txt
and the website and compiled it into markdown files indocs
.docs/website
. The generator will use the markdown files indocs
. You can preview the website by following the instructions indocs/website/README.md
.Still to do:
Open questions: