Commit graph

34 commits

Author SHA1 Message Date
Alan Wu
7d1546ece5 Try to fix Windows build 2021-10-20 18:19:24 -04:00
Alan Wu
a3e58f4df8 Compile with MicroJIT disabled when scrape fails
This is just so we can build successfully on -O0 and other cases that
are not supported by the code scraper.
2021-10-20 18:19:24 -04:00
Maxime Chevalier-Boisvert
e3cd43e2bc Implemented opt_minus in MicroJIT 2021-10-20 18:19:24 -04:00
Maxime Chevalier-Boisvert
851ea46351 Added member_opnd() convenience macro 2021-10-20 18:19:24 -04:00
Aaron Patterson
d7f012666d Partially implement opt_send_without_block
It will read and check the inline cache now, but we need to actually
call the method.

Co-Authored-By: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
2021-10-20 18:19:24 -04:00
Maxime Chevalier-Boisvert
2c866ce8f0 Check if outlined code block has enough space too 2021-10-20 18:19:24 -04:00
Alan Wu
e8c914c250 Implement the --disable-ujit command line option 2021-10-20 18:19:24 -04:00
Maxime Chevalier-Boisvert
e0c5d4ecd9 Implemented side-exits to interpreter. setlocal_WC_0 2021-10-20 18:19:24 -04:00
Maxime Chevalier-Boisvert
4d72b9a2f7 Start implementing setlocal_wc0 2021-10-20 18:19:24 -04:00
Alan Wu
3d87eadf16 Refactor ujit_examples.h generator. Remove dwarfdump dependency 2021-10-20 18:19:24 -04:00
Alan Wu
2eaf55fcf1 Update PC in memory when exiting jitted code
Without this, the allocation tracker was inaccurate and
was causing a failure in `test/objspace/test_objspace.rb`.
2021-10-20 18:19:23 -04:00
Alan Wu
86c438d129 Revert "Add workaround for inserting into addr2insn mapping"
This reverts commit 6b765b7ca0.
It made things much slower and didn't fix the crash.
2021-10-20 18:19:23 -04:00
Alan Wu
5bcba2a5ee Add workaround for inserting into addr2insn mapping 2021-10-20 18:19:23 -04:00
Maxime Chevalier-Boisvert
304adba717 Add location hint to code block mmap call 2021-10-20 18:19:23 -04:00
Maxime Chevalier-Boisvert
c20066b24c Added method to align code block write position 2021-10-20 18:19:23 -04:00
Maxime Chevalier-Boisvert
30c4237b06 Fixed bug with ctx_stack_pop. Implemented dup bytecode. 2021-10-20 18:19:23 -04:00
Maxime Chevalier-Boisvert
d1c9ca86c1 Port print_int, movsx. Implement putself. 2021-10-20 18:19:23 -04:00
Maxime Chevalier-Boisvert
b8a3f2ed61 Add function to print strings from generated code 2021-10-20 18:19:23 -04:00
Maxime Chevalier-Boisvert
77cfdb24d4 Implemented delayed stack pointer adjustment optimization 2021-10-20 18:19:23 -04:00
Maxime Chevalier-Boisvert
038f5d964f Avoid recompiling overlapping instruction sequences in ujit 2021-10-20 18:19:23 -04:00
Maxime Chevalier-Boisvert
132f7e11fd Compile putnil 2021-10-20 18:19:23 -04:00
Maxime Chevalier-Boisvert
8a5ced8eb5 Chain compilation of adjacent instructions 2021-10-20 18:19:23 -04:00
Maxime Chevalier-Boisvert
7eb192d644 Testing lea instruction properly 2021-10-20 18:19:23 -04:00
Maxime Chevalier-Boisvert
16ddb422eb Complete refactoring to codegen functions 2021-10-20 18:19:23 -04:00
Maxime Chevalier-Boisvert
b0b7d0a87e Refactor MicroJIT codegen to use hash table of codegen functions 2021-10-20 18:19:23 -04:00
Maxime Chevalier-Boisvert
2811792f91 Compiling getlocal_WC_0 2021-10-20 18:19:23 -04:00
Maxime Chevalier-Boisvert
090255456a Ported neg, and, or instructions 2021-10-20 18:19:23 -04:00
Maxime Chevalier-Boisvert
3739588811 Remove PC argument from ujit instructions 2021-10-20 18:19:23 -04:00
Maxime Chevalier-Boisvert
ca47899ccf Small refactorings in ujit_compile.c 2021-10-20 18:19:23 -04:00
Maxime Chevalier-Boisvert
1879a123ca Added cmp, not. Generate code for nop instruction. 2021-10-20 18:19:23 -04:00
Maxime Chevalier-Boisvert
7d0df31d7a Ported inc/dec instructions 2021-10-20 18:19:23 -04:00
Maxime Chevalier-Boisvert
26fecc7236 Removed native_pop_code, ported call with label 2021-10-20 18:19:23 -04:00
Alan Wu
4929ba0a5c Generate multiple copies of native code for pop
Insert generated addresses into st_table for mapping native code
addresses back to info about VM instructions. Export `encoded_insn_data`
to do this. Also some style fixes.
2021-10-20 18:19:23 -04:00
Maxime Chevalier-Boisvert
1c8fb90f6b Add new files, ujit_compile.c, ujit_compile.h 2021-10-20 18:19:23 -04:00