зеркало из https://github.com/github/ruby.git
Import class constants with mjit-bindgen
This commit is contained in:
Родитель
e4e2ff76a8
Коммит
80bab6c8ed
33
mjit_c.rb
33
mjit_c.rb
|
@ -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
|
||||
|
|
|
@ -345,6 +345,14 @@ generator = BindingGenerator.new(
|
|||
INVALID_SHAPE_ID
|
||||
SHAPE_MASK
|
||||
],
|
||||
PTR: %w[
|
||||
rb_cFalseClass
|
||||
rb_cFloat
|
||||
rb_cInteger
|
||||
rb_cNilClass
|
||||
rb_cSymbol
|
||||
rb_cTrueClass
|
||||
],
|
||||
},
|
||||
types: %w[
|
||||
CALL_DATA
|
||||
|
|
Загрузка…
Ссылка в новой задаче