Skip to content

Commit

Permalink
Set T_FIXNUM type tags in opt_plus, opt_minus
Browse files Browse the repository at this point in the history
  • Loading branch information
maximecb authored and XrXr committed Oct 19, 2021
1 parent ec2820f commit 6478b37
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions ujit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ def self.disasm(iseq)
)
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
4 changes: 2 additions & 2 deletions ujit_codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 6478b37

Please sign in to comment.