diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2022-11-14 00:24:08 -0800 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2022-11-14 00:24:08 -0800 |
commit | 80bab6c8eddbb225c88155f2eb456a4d937294c7 (patch) | |
tree | 6ce6dae48c63bb34aabd6399d0f851925d9798da /mjit_c.rb | |
parent | e4e2ff76a8415e4d2db88c1f2b0c4742cb6184c1 (diff) |
Import class constants with mjit-bindgen
Diffstat (limited to 'mjit_c.rb')
-rw-r--r-- | mjit_c.rb | 33 |
1 files changed, 26 insertions, 7 deletions
@@ -4,6 +4,8 @@ module RubyVM::MJIT C = Object.new + # This `class << C` section is for calling C functions. + # For variables/macros, please consider using tool/mjit/bindgen.rb instead. class << C def SHAPE_BITS Primitive.cexpr! 'UINT2NUM(SHAPE_BITS)' @@ -156,13 +158,6 @@ module RubyVM::MJIT return Qnil; } end - - def rb_cFalseClass; Primitive.cexpr! 'PTR2NUM(rb_cFalseClass)' end - def rb_cNilClass; Primitive.cexpr! 'PTR2NUM(rb_cNilClass)' end - def rb_cTrueClass; Primitive.cexpr! 'PTR2NUM(rb_cTrueClass)' end - def rb_cInteger; Primitive.cexpr! 'PTR2NUM(rb_cInteger)' end - def rb_cSymbol; Primitive.cexpr! 'PTR2NUM(rb_cSymbol)' end - def rb_cFloat; Primitive.cexpr! 'PTR2NUM(rb_cFloat)' end end ### MJIT bindgen begin ### @@ -211,6 +206,30 @@ module RubyVM::MJIT Primitive.cexpr! %q{ ULONG2NUM(SHAPE_MASK) } end + def C.rb_cFalseClass + Primitive.cexpr! %q{ PTR2NUM(rb_cFalseClass) } + end + + def C.rb_cFloat + Primitive.cexpr! %q{ PTR2NUM(rb_cFloat) } + end + + def C.rb_cInteger + Primitive.cexpr! %q{ PTR2NUM(rb_cInteger) } + end + + def C.rb_cNilClass + Primitive.cexpr! %q{ PTR2NUM(rb_cNilClass) } + end + + def C.rb_cSymbol + Primitive.cexpr! %q{ PTR2NUM(rb_cSymbol) } + end + + def C.rb_cTrueClass + Primitive.cexpr! %q{ PTR2NUM(rb_cTrueClass) } + end + def C.CALL_DATA @CALL_DATA ||= self.rb_call_data end |