summaryrefslogtreecommitdiff
path: root/common.mk
AgeCommit message (Collapse)Author
2021-10-20Directly link libcapstone for easier developmentAaron Patterson
This lets us use libcapstone directly from miniruby so we don't need a Ruby Gem to to dev work. Example usage: ```ruby def foo(x) if x < 1 "wow" else "neat" end end iseq = RubyVM::InstructionSequence.of(method(:foo)) puts UJIT.disasm(iseq) 100.times { foo 1 } puts UJIT.disasm(iseq) ``` Then in the terminal ``` $ ./miniruby test.rb == disasm: #<ISeq:foo@test.rb:1 (1,0)-(7,3)> (catch: FALSE) local table (size: 1, argc: 1 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1]) [ 1] x@0<Arg> 0000 getlocal_WC_0 x@0 ( 2)[LiCa] 0002 putobject_INT2FIX_1_ 0003 opt_lt <calldata!mid:<, argc:1, ARGS_SIMPLE> 0005 branchunless 10 0007 putstring "wow" ( 3)[Li] 0009 leave ( 7)[Re] 0010 putstring "neat" ( 5)[Li] 0012 leave ( 7)[Re] == ISEQ RANGE: 10 -> 10 ======================================================== 0x0: movabs rax, 0x7fe816e2d1a0 0xa: mov qword ptr [rdi], rax 0xd: mov r8, rax 0x10: mov r9, rax 0x13: mov r11, r12 0x16: jmp qword ptr [rax] == ISEQ RANGE: 0 -> 7 ========================================================== 0x0: mov rax, qword ptr [rdi + 0x20] 0x4: mov rax, qword ptr [rax - 0x18] 0x8: mov qword ptr [rdx], rax 0xb: mov qword ptr [rdx + 8], 3 0x13: movabs rax, 0x7fe817808200 0x1d: test byte ptr [rax + 0x3e6], 1 0x24: jne 0x3ffff7b 0x2a: test byte ptr [rdx], 1 0x2d: je 0x3ffff7b 0x33: test byte ptr [rdx + 8], 1 0x37: je 0x3ffff7b 0x3d: mov rax, qword ptr [rdx] 0x40: cmp rax, qword ptr [rdx + 8] 0x44: movabs rax, 0 0x4e: movabs rcx, 0x14 0x58: cmovl rax, rcx 0x5c: mov qword ptr [rdx], rax 0x5f: test qword ptr [rdx], -9 0x66: jne 0x3ffffd5 ``` Make sure to `brew install pkg-config capstone`
2021-10-20Update dependenciesAlan Wu
2021-10-20Refactor uJIT code into more files for readabilityMaxime Chevalier-Boisvert
2021-10-20Update dependenciesAlan Wu
2021-10-20Update dependencyAlan Wu
2021-10-20Run ruby tool/update-deps --fixAlan Wu
2021-10-20Refactor ujit_examples.h generator. Remove dwarfdump dependencyAlan Wu
2021-10-20Don't assume srcdir is cwdAlan Wu
2021-10-20Add function to print strings from generated codeMaxime Chevalier-Boisvert
2021-10-20Fix typoAlan Wu
2021-10-20Fix dependency for ujit_examples.hAlan Wu
Once this works on GNU/Linux this could be done semi automatically.
2021-10-20Add new files, ujit_compile.c, ujit_compile.hMaxime Chevalier-Boisvert
2021-10-20Progress on x86 assembler. Encode a few simple instructions.Maxime Chevalier-Boisvert
2021-10-20Progress on porting x86 assembler for MicroJITMaxime Chevalier-Boisvert
2021-10-20Yeah, this actually works!Alan Wu
2021-10-12Suppress some messages on building mjit headerKazuhiro NISHIYAMA
2021-10-05marshal.c Marshal.load accepts a freeze: true option.Jean Boussier
Fixes [Feature #18148] When set, all the loaded objects are returned as frozen. If a proc is provided, it is called with the objects already frozen.
2021-10-05ruby tool/update-deps --fix卜部昌平
Notes: Merged: https://github.com/ruby/ruby/pull/4909
2021-10-05introduce debug.gemKoichi Sasada
For the `test-bundled-gems`, make `debug.so` with extconf.rb and `make` command directly because `rake-compiler` assume ruby is installed (but `test-bundled-gems` can run without installation). Notes: Merged: https://github.com/ruby/ruby/pull/4804
2021-10-02Restore Hash#compare_by_identity mode [Bug #18171]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4893
2021-09-28lldb: Show encoding of String [ci skip]Nobuyoshi Nakada
2021-09-26Fix dependency of verconf.hNobuyoshi Nakada
template/verconf.h.tmpl reads rbconfig.rb.
2021-09-21Explicit the target of do-install-all as the same as dont-install-allNobuyoshi Nakada
2021-09-21Ripper source on mswinNobuyoshi Nakada
* Get rid of command substitution for cmd.exe. * Separate RM1 command to remove single file sans directory.
2021-09-20Add gvl and fiber assertions to scheduler interface to catch invalid usage.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/4656
2021-09-11Check ruby-related includes only [ci skip]Nobuyoshi Nakada
2021-09-11Removed minitest dir from make taskHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/4813
2021-09-10common.mk: update dependencies卜部昌平
Notes: Merged: https://github.com/ruby/ruby/pull/4815
2021-08-27Update the list of replacing objects under missingNobuyoshi Nakada
2021-08-27Use C99-defined macros to classify a floating-point numberNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4783
2021-08-25tool/test-bundled-gems.rb: Use the bundled RBS code to test TypeProfYusuke Endoh
Formerly, TypeProf was tested with the latest RBS code during `make test-bundled-gems`. However, when a new version of rbs is released, and if it is incompatible with TypeProf, `make test-bundled-gems` starts failing, which was annoying. By this change, TypeProf is tested with the bundled version of RBS. Notes: Merged: https://github.com/ruby/ruby/pull/4774
2021-08-24Revert "tool/test-bundled-gems.rb: Use the bundled RBS code to test TypeProf"Yusuke Endoh
This reverts commit 22deda43cb98aa3cee48d0bebbff7c4db1d7652a. It was incomplete. Sorry!
2021-08-24tool/test-bundled-gems.rb: Use the bundled RBS code to test TypeProfYusuke Endoh
Formerly, TypeProf was tested with the latest RBS code during `make test-bundled-gems`. However, when a new version of rbs is released, and if it is incompatible with TypeProf, `make test-bundled-gems` starts failing, which was annoying. By this change, TypeProf is tested with the bundled version of RBS.
2021-08-24Moved exported symbols in internal/util.h to ruby/util.hNobuyoshi Nakada
[Feature #18051] Notes: Merged: https://github.com/ruby/ruby/pull/4763
2021-08-13ruby/spec no longer needs webrick to runBenoit Daloze
2021-08-07Group commands on GitHub ActionsNobuyoshi Nakada
2021-07-27Change Unicode Emoji Version from 13.0 to 13.1Martin Dürst
2021-07-19Remove unneeded quotes [ci skip]Nobuyoshi Nakada
2021-07-16Add debug assertion in `rb_funcall*` that the current thread has the gvl.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/4657
2021-07-08Update common.mk to deal with Unicode version 13.0.0Martin Dürst
- Change Unicode version to 13.0.0 - Change Emoji version to 13.0 - Adjust to moved locations of emoji-data.txt and emoji-variation-sequences.txt by splitting these files from $(UNICODE_EMOJI_FILES) and putting them into a new group $(UNICODE_UCD_EMOJI_FILES)
2021-07-05programs will be made from extsNobuyoshi Nakada
`programs` after `exts` overwrites programs built with extension libraries when static-linked-ext.
2021-07-03goruby.c: include golf_prelude.c to get rid of overwriting EXTOBJSNobuyoshi Nakada
2021-06-30"nodoc" needs to exclude "doc" [ci skip]Nobuyoshi Nakada
2021-06-18Add a cache for class variableseileencodes
Redo of 34a2acdac788602c14bf05fb616215187badd504 and 931138b00696419945dc03e10f033b1f53cd50f3 which were reverted. GitHub PR #4340. This change implements a cache for class variables. Previously there was no cache for cvars. Cvar access is slow due to needing to travel all the way up th ancestor tree before returning the cvar value. The deeper the ancestor tree the slower cvar access will be. The benefits of the cache are more visible with a higher number of included modules due to the way Ruby looks up class variables. The benchmark here includes 26 modules and shows with the cache, this branch is 6.5x faster when accessing class variables. ``` compare-ruby: ruby 3.1.0dev (2021-03-15T06:22:34Z master 9e5105c) [x86_64-darwin19] built-ruby: ruby 3.1.0dev (2021-03-15T12:12:44Z add-cache-for-clas.. c6be009) [x86_64-darwin19] | |compare-ruby|built-ruby| |:--------|-----------:|---------:| |vm_cvar | 5.681M| 36.980M| | | -| 6.51x| ``` Benchmark.ips calling `ActiveRecord::Base.logger` from within a Rails application. ActiveRecord::Base.logger has 71 ancestors. The more ancestors a tree has, the more clear the speed increase. IE if Base had only one ancestor we'd see no improvement. This benchmark is run on a vanilla Rails application. Benchmark code: ```ruby require "benchmark/ips" require_relative "config/environment" Benchmark.ips do |x| x.report "logger" do ActiveRecord::Base.logger end end ``` Ruby 3.0 master / Rails 6.1: ``` Warming up -------------------------------------- logger 155.251k i/100ms Calculating ------------------------------------- ``` Ruby 3.0 with cvar cache / Rails 6.1: ``` Warming up -------------------------------------- logger 1.546M i/100ms Calculating ------------------------------------- logger 14.857M (± 4.8%) i/s - 74.198M in 5.006202s ``` Lastly we ran a benchmark to demonstate the difference between master and our cache when the number of modules increases. This benchmark measures 1 ancestor, 30 ancestors, and 100 ancestors. Ruby 3.0 master: ``` Warming up -------------------------------------- 1 module 1.231M i/100ms 30 modules 432.020k i/100ms 100 modules 145.399k i/100ms Calculating ------------------------------------- 1 module 12.210M (± 2.1%) i/s - 61.553M in 5.043400s 30 modules 4.354M (± 2.7%) i/s - 22.033M in 5.063839s 100 modules 1.434M (± 2.9%) i/s - 7.270M in 5.072531s Comparison: 1 module: 12209958.3 i/s 30 modules: 4354217.8 i/s - 2.80x (± 0.00) slower 100 modules: 1434447.3 i/s - 8.51x (± 0.00) slower ``` Ruby 3.0 with cvar cache: ``` Warming up -------------------------------------- 1 module 1.641M i/100ms 30 modules 1.655M i/100ms 100 modules 1.620M i/100ms Calculating ------------------------------------- 1 module 16.279M (± 3.8%) i/s - 82.038M in 5.046923s 30 modules 15.891M (± 3.9%) i/s - 79.459M in 5.007958s 100 modules 16.087M (± 3.6%) i/s - 81.005M in 5.041931s Comparison: 1 module: 16279458.0 i/s 100 modules: 16087484.6 i/s - same-ish: difference falls within error 30 modules: 15891406.2 i/s - same-ish: difference falls within error ``` Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org> Notes: Merged: https://github.com/ruby/ruby/pull/4544
2021-06-16Make ext directory before extinit.c when out-of-place buildNobuyoshi Nakada
2021-06-10Add missing dependenciesTakashi Kokubun
https://github.com/ruby/ruby/runs/2791163586?check_suite_focus=true
2021-06-10Avoid enqueueing the same ISeq twiceTakashi Kokubun
by a race condition by multiple Ractors. Atmically incrementing body->total_calls may have its own cost, so for now we intentionally leave the unreliable total_calls. So we allow an ISeq to be never pushed when you use multiple Ractors. However, if you enqueue a single ccan node twice, get_from_list loops infinitely. Thus this patch takes care of such a situation.
2021-06-02Implemented some NilClass method in Ruby code is faster [Feature #17054] (#3366)S.H
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2021-05-30Mark inlined ISeqs during MJIT compilation (#4539)Takashi Kokubun
[Bug #17584] Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2021-05-12cdhash_cmp: can take rational literals卜部昌平
Rational literals are those integers suffixed with `r`. They tend to be a part of more complex expressions like `123/456r`, but in theory they can live alone. When such "bare" rational literals are passed to case-when branch, we have to take care of them. Fixes [Bug #17854] Notes: Merged: https://github.com/ruby/ruby/pull/4469