ruby-changes:73691
From: Takashi <ko1@a...>
Date: Fri, 23 Sep 2022 06:45:01 +0900 (JST)
Subject: [ruby-changes:73691] e81a612413 (master): Auto-generate mjit_c.rb.erb
https://git.ruby-lang.org/ruby.git/commit/?id=e81a612413 From e81a612413500caa6763a765d12255ea7f150f68 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun <takashikkbn@g...> Date: Sun, 18 Sep 2022 22:32:21 +0900 Subject: Auto-generate mjit_c.rb.erb --- .github/workflows/mjit-bindgen.yml | 5 +---- tool/mjit/bindgen.rb | 10 ++++++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/mjit-bindgen.yml b/.github/workflows/mjit-bindgen.yml index 33a1650f92..04c9ac4a9f 100644 --- a/.github/workflows/mjit-bindgen.yml +++ b/.github/workflows/mjit-bindgen.yml @@ -23,9 +23,6 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/mjit-bindgen.yml#L23 matrix: include: - task: mjit-bindgen - configure: '--enable-yjit=dev_nodebug' - - task: mjit-bindgen - arch: i686 fail-fast: false env: SETARCH: ${{ matrix.arch && format('setarch {0}', matrix.arch) }} @@ -74,7 +71,7 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/mjit-bindgen.yml#L71 env: arch: ${{ matrix.arch }} run: >- - $SETARCH ../src/configure -C --disable-install-doc --prefix=$(pwd)/install ${{ matrix.configure }} + $SETARCH ../src/configure -C --disable-install-doc --prefix=$(pwd)/install --enable-yjit=dev_nodebug ${arch:+--target=$arch-$OSTYPE --host=$arch-$OSTYPE} - run: $SETARCH make incs - run: $SETARCH make diff --git a/tool/mjit/bindgen.rb b/tool/mjit/bindgen.rb index 8bc537f0d1..c35a6dfcde 100755 --- a/tool/mjit/bindgen.rb +++ b/tool/mjit/bindgen.rb @@ -336,7 +336,13 @@ class BindingGenerator https://github.com/ruby/ruby/blob/trunk/tool/mjit/bindgen.rb#L336 @references = Set.new end - def generate(nodes) + def generate(_nodes) + println "module RubyVM::MJIT" + println " C = Object.new" + println "end if RubyVM::MJIT.enabled?" + end + + def legacy_generate(nodes) # TODO: Support nested declarations nodes_index = nodes.group_by(&:spelling).transform_values(&:last) @@ -589,4 +595,4 @@ generator = BindingGenerator.new( https://github.com/ruby/ruby/blob/trunk/tool/mjit/bindgen.rb#L595 ) generator.generate(nodes) -File.write(File.join(src_dir, "lib/mjit/c_#{arch_bits}.rb"), generator.src) +File.write(File.join(src_dir, 'tool/ruby_vm/views/mjit_c.rb.erb'), generator.src) -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/