summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>2021-01-25 18:49:54 -0500
committerAlan Wu <XrXr@users.noreply.github.com>2021-10-20 18:19:27 -0400
commit36232a48a63923e6d3bd3ccad30a12a02b20e89b (patch)
tree2fd16bb3abdbabd43411a173ee53ec4b8d0c4110
parentc61238a2761ca8d9bbe56dc3b06aa07da5784c96 (diff)
downloadruby-36232a48a63923e6d3bd3ccad30a12a02b20e89b.tar.gz
Set T_FIXNUM type tags in opt_plus, opt_minus
-rw-r--r--ujit.rb7
-rw-r--r--ujit_codegen.c4
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
)
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)
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)
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;