ruby-changes:68723
From: Maxime <ko1@a...>
Date: Thu, 21 Oct 2021 08:12:36 +0900 (JST)
Subject: [ruby-changes:68723] 36232a48a6 (master): Set T_FIXNUM type tags in opt_plus, opt_minus
https://git.ruby-lang.org/ruby.git/commit/?id=36232a48a6 From 36232a48a63923e6d3bd3ccad30a12a02b20e89b Mon Sep 17 00:00:00 2001 From: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@s...> Date: Mon, 25 Jan 2021 18:49:54 -0500 Subject: Set T_FIXNUM type tags in opt_plus, opt_minus --- ujit.rb | 7 +++++++ ujit_codegen.c | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ujit.rb b/ujit.rb index 79eed46ff3..629ee6b0af 100644 --- a/ujit.rb +++ b/ujit.rb @@ -28,6 +28,13 @@ module UJIT https://github.com/ruby/ruby/blob/trunk/ujit.rb#L28 ) end end + + block_sizes = blocks.map { |block| block.code.length } + total_bytes = block_sizes.reduce(0, :+) + str << "\n" + str << "Total code size: #{total_bytes} bytes" + str << "\n" + str end if defined?(Disasm) end diff --git a/ujit_codegen.c b/ujit_codegen.c index c3e7f912d0..7c7866f403 100644 --- a/ujit_codegen.c +++ b/ujit_codegen.c @@ -611,7 +611,7 @@ gen_opt_minus(jitstate_t* jit, ctx_t* ctx) https://github.com/ruby/ruby/blob/trunk/ujit_codegen.c#L611 add(cb, REG0, imm_opnd(1)); // Push the output on the stack - x86opnd_t dst = ctx_stack_push(ctx, T_NONE); + x86opnd_t dst = ctx_stack_push(ctx, T_FIXNUM); mov(cb, dst, REG0); return true; @@ -657,7 +657,7 @@ gen_opt_plus(jitstate_t* jit, ctx_t* ctx) https://github.com/ruby/ruby/blob/trunk/ujit_codegen.c#L657 jo_ptr(cb, side_exit); // Push the output on the stack - x86opnd_t dst = ctx_stack_push(ctx, T_NONE); + x86opnd_t dst = ctx_stack_push(ctx, T_FIXNUM); mov(cb, dst, REG0); return true; -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/