Alan Wu
9ce9f613b0
Update comment for `ujit_compile_insn`
2021-10-20 18:19:26 -04:00
Alan Wu
c378c7a7cb
MicroJIT: generate less code for CFUNCs
...
Added UJIT_CHECK_MODE. Set to 1 to double check method dispatch in
generated code.
It's surprising to me that we need to watch both cc and cme. There might
be opportunities to simplify there.
2021-10-20 18:19:26 -04:00
Maxime Chevalier-Boisvert
0c52371c47
Don't create a stack frame for Hash#key?
2021-10-20 18:19:25 -04:00
Maxime Chevalier-Boisvert
5413d0918b
Fix GCC warning
2021-10-20 18:19:25 -04:00
Maxime Chevalier-Boisvert
81e7091862
Added stack overflow check to MicroJIT CFUNC calls
2021-10-20 18:19:25 -04:00
Maxime Chevalier-Boisvert
8b8470d098
Added RUBY_VM_CHECK_INTS to CFUNC calls
2021-10-20 18:19:25 -04:00
Maxime Chevalier-Boisvert
5b6a963b71
Fix compiler warnings
2021-10-20 18:19:25 -04:00
Maxime Chevalier-Boisvert
b761f5c96f
Implemented mechanism for rel32 call
2021-10-20 18:19:25 -04:00
Alan Wu
498fe0fb52
Move MicroJIT compilation threshold into MicroJIT's header
2021-10-20 18:19:25 -04:00
Maxime Chevalier-Boisvert
809ecfb126
Fixed two CFUNC call bugs thanks to Alan & Aaron!
2021-10-20 18:19:25 -04:00
Alan Wu
c2cb6a6fd3
MicroJIT: Read pointer to call cache from call data
...
The call cache changes when the call site becomes polymophic and can
result in the generated code falsely assuming cd->cc->cme is not NULL.
Here is a crasher:
def body(thing)
thing.strip
end
str = ""
10.times { body(str) }
body(0) rescue p 'not found'
body(str)
2021-10-20 18:19:25 -04:00
Maxime Chevalier-Boisvert
d49edada2e
Fix MicroJIT argument copying for CFUNC calls
2021-10-20 18:19:25 -04:00
Maxime Chevalier-Boisvert
37e4350e80
Fixed two issues with MicroJIT CFUNC calls
2021-10-20 18:19:25 -04:00
Maxime Chevalier-Boisvert
35c0768473
First pass at CFUNC calls complete. Not yet functional.
2021-10-20 18:19:25 -04:00
Maxime Chevalier-Boisvert
ff73762bda
Refactor ujit, define named register constants, code cleanup
2021-10-20 18:19:25 -04:00
Alan Wu
6ca360aa47
MicroJIT: switch to example that passes ec as second argument
...
opt_send_without_block needs it. Ideally we would use this example
only when an instruction in the compiled sequence needs `ec`. We can
worry about that later.
2021-10-20 18:19:25 -04:00
Alan Wu
1ef2887bc1
MicroJIT: Use R9 in generated code for Ruby stack pointer
2021-10-20 18:19:25 -04:00
Alan Wu
11c1daea17
Add to the MicroJIT scraper an example that passes ec
2021-10-20 18:19:25 -04:00
Maxime Chevalier-Boisvert
008551decb
Commit before merge.
2021-10-20 18:19:25 -04:00
Maxime Chevalier-Boisvert
a88d6207dd
Updated C function call sketch
2021-10-20 18:19:25 -04:00
Maxime Chevalier-Boisvert
770f3929b3
Remove comment. Commit before rebase.
2021-10-20 18:19:25 -04:00
Alan Wu
595e3a94fd
Fix MicroJIT logic in MJIT exec
2021-10-20 18:19:25 -04:00
Alan Wu
6f4d17d622
Never compile with MicroJIT when MJIT is enabled
...
There is a crash in there that we don't want to worry about for now.
2021-10-20 18:19:25 -04:00
Alan Wu
12ba0c0815
Declare extern with RUBY_EXTERN for MJIT
2021-10-20 18:19:25 -04:00
Alan Wu
d9ab1e9563
Update dependencies
2021-10-20 18:19:25 -04:00
Alan Wu
93f6ac39f2
MicroJIT: Don't compile trace instructions
2021-10-20 18:19:25 -04:00
Alan Wu
ba45aff16b
Don't call MicroJIT from MJIT output
2021-10-20 18:19:25 -04:00
Alan Wu
a245db8df8
Export MicroJIT global used in MJIT
2021-10-20 18:19:25 -04:00
Maxime Chevalier-Boisvert
e677ca4af0
Fixed is-object check in opt_send_without_block
2021-10-20 18:19:25 -04:00
Maxime Chevalier-Boisvert
7c9fdb5dc9
Check receiver type and klass in MicroJIT
2021-10-20 18:19:25 -04:00
Alan Wu
7650352868
Take the VM lock when recompiling
2021-10-20 18:19:25 -04:00
Alan Wu
8bda11f690
MicroJIT: compile after ten calls
2021-10-20 18:19:25 -04:00
Maxime Chevalier-Boisvert
ef9eb83cbe
Commit before merge
2021-10-20 18:19:25 -04:00
Maxime Chevalier-Boisvert
2cb376a53f
Started refactoring opt_send_without_block with codegen-time checks
2021-10-20 18:19:25 -04:00
Maxime Chevalier-Boisvert
32a66b99f6
Add system to implement codegen preconditions in JIT
2021-10-20 18:19:25 -04:00
Maxime Chevalier-Boisvert
6f81bd2c76
Added print_ptr() util function for debugging
2021-10-20 18:19:25 -04:00
Maxime Chevalier-Boisvert
e5751768ba
Added int3() to x86 asm
2021-10-20 18:19:25 -04:00
Alan Wu
beab644408
Anonymous union is a C11 feature unavailable to us
2021-10-20 18:19:25 -04:00
Alan Wu
e84083593c
oops Direct threading should be default
2021-10-20 18:19:25 -04:00
Alan Wu
bab308b923
Explicitly convert function pointer to void pointer
2021-10-20 18:19:24 -04:00
Alan Wu
7662653b4c
Fix compilation for OPT_THREADED_CODE=2
2021-10-20 18:19:24 -04:00
Alan Wu
edede7733d
Explicitly convert function pointer to void pointer
2021-10-20 18:19:24 -04:00
Alan Wu
b8dff14afa
_GNU_SOURCE has to be before includes
2021-10-20 18:19:24 -04:00
Alan Wu
3c8a9da7ef
Bump executable memory allocation size
...
We run out it on CI in test-all.
2021-10-20 18:19:24 -04:00
Alan Wu
a132d69757
Get access to MAP_ANONYMOUS in pedantic compile mode
2021-10-20 18:19:24 -04:00
Alan Wu
df15dfa6fd
Don't put MicroJIT status in RUBY_DESCRIPTION
...
That messes with tests too much.
2021-10-20 18:19:24 -04:00
Alan Wu
2790428e55
Zero sized array are not standard C
2021-10-20 18:19:24 -04:00
Alan Wu
7e400ddc79
Try to fix Windows build
2021-10-20 18:19:24 -04:00
Alan Wu
805f49630d
Fix MicroJIT's putobject against GC copmaction
2021-10-20 18:19:24 -04:00
Alan Wu
e9ecf80d20
Respect redefinition in MicroJIT's opt_minus
2021-10-20 18:19:24 -04:00