Import shape constants with mjit-bindgen
This commit is contained in:
parent
80bab6c8ed
commit
a8537aa6a5
68
mjit_c.rb
68
mjit_c.rb
@ -4,41 +4,9 @@
|
|||||||
module RubyVM::MJIT
|
module RubyVM::MJIT
|
||||||
C = Object.new
|
C = Object.new
|
||||||
|
|
||||||
# This `class << C` section is for calling C functions.
|
# This `class << C` section is for calling C functions. For importing variables
|
||||||
# For variables/macros, please consider using tool/mjit/bindgen.rb instead.
|
# or macros as is, please consider using tool/mjit/bindgen.rb instead.
|
||||||
class << C
|
class << C
|
||||||
def SHAPE_BITS
|
|
||||||
Primitive.cexpr! 'UINT2NUM(SHAPE_BITS)'
|
|
||||||
end
|
|
||||||
|
|
||||||
def SHAPE_FLAG_SHIFT
|
|
||||||
Primitive.cexpr! 'UINT2NUM(SHAPE_FLAG_SHIFT)'
|
|
||||||
end
|
|
||||||
|
|
||||||
def SHAPE_ROOT
|
|
||||||
Primitive.cexpr! 'UINT2NUM(SHAPE_ROOT)'
|
|
||||||
end
|
|
||||||
|
|
||||||
def SHAPE_IVAR
|
|
||||||
Primitive.cexpr! 'UINT2NUM(SHAPE_IVAR)'
|
|
||||||
end
|
|
||||||
|
|
||||||
def SHAPE_FROZEN
|
|
||||||
Primitive.cexpr! 'UINT2NUM(SHAPE_FROZEN)'
|
|
||||||
end
|
|
||||||
|
|
||||||
def SHAPE_CAPACITY_CHANGE
|
|
||||||
Primitive.cexpr! 'UINT2NUM(SHAPE_CAPACITY_CHANGE)'
|
|
||||||
end
|
|
||||||
|
|
||||||
def SHAPE_IVAR_UNDEF
|
|
||||||
Primitive.cexpr! 'UINT2NUM(SHAPE_IVAR_UNDEF)'
|
|
||||||
end
|
|
||||||
|
|
||||||
def SHAPE_INITIAL_CAPACITY
|
|
||||||
Primitive.cexpr! 'UINT2NUM(SHAPE_INITIAL_CAPACITY)'
|
|
||||||
end
|
|
||||||
|
|
||||||
def ROBJECT_EMBED_LEN_MAX
|
def ROBJECT_EMBED_LEN_MAX
|
||||||
Primitive.cexpr! 'INT2NUM(RBIMPL_EMBED_LEN_MAX_OF(VALUE))'
|
Primitive.cexpr! 'INT2NUM(RBIMPL_EMBED_LEN_MAX_OF(VALUE))'
|
||||||
end
|
end
|
||||||
@ -198,6 +166,38 @@ module RubyVM::MJIT
|
|||||||
Primitive.cexpr! %q{ INT2NUM(VM_METHOD_TYPE_ISEQ) }
|
Primitive.cexpr! %q{ INT2NUM(VM_METHOD_TYPE_ISEQ) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def C.SHAPE_BITS
|
||||||
|
Primitive.cexpr! %q{ UINT2NUM(SHAPE_BITS) }
|
||||||
|
end
|
||||||
|
|
||||||
|
def C.SHAPE_CAPACITY_CHANGE
|
||||||
|
Primitive.cexpr! %q{ UINT2NUM(SHAPE_CAPACITY_CHANGE) }
|
||||||
|
end
|
||||||
|
|
||||||
|
def C.SHAPE_FLAG_SHIFT
|
||||||
|
Primitive.cexpr! %q{ UINT2NUM(SHAPE_FLAG_SHIFT) }
|
||||||
|
end
|
||||||
|
|
||||||
|
def C.SHAPE_FROZEN
|
||||||
|
Primitive.cexpr! %q{ UINT2NUM(SHAPE_FROZEN) }
|
||||||
|
end
|
||||||
|
|
||||||
|
def C.SHAPE_INITIAL_CAPACITY
|
||||||
|
Primitive.cexpr! %q{ UINT2NUM(SHAPE_INITIAL_CAPACITY) }
|
||||||
|
end
|
||||||
|
|
||||||
|
def C.SHAPE_IVAR
|
||||||
|
Primitive.cexpr! %q{ UINT2NUM(SHAPE_IVAR) }
|
||||||
|
end
|
||||||
|
|
||||||
|
def C.SHAPE_IVAR_UNDEF
|
||||||
|
Primitive.cexpr! %q{ UINT2NUM(SHAPE_IVAR_UNDEF) }
|
||||||
|
end
|
||||||
|
|
||||||
|
def C.SHAPE_ROOT
|
||||||
|
Primitive.cexpr! %q{ UINT2NUM(SHAPE_ROOT) }
|
||||||
|
end
|
||||||
|
|
||||||
def C.INVALID_SHAPE_ID
|
def C.INVALID_SHAPE_ID
|
||||||
Primitive.cexpr! %q{ ULONG2NUM(INVALID_SHAPE_ID) }
|
Primitive.cexpr! %q{ ULONG2NUM(INVALID_SHAPE_ID) }
|
||||||
end
|
end
|
||||||
|
@ -341,6 +341,16 @@ generator = BindingGenerator.new(
|
|||||||
VM_METHOD_TYPE_CFUNC
|
VM_METHOD_TYPE_CFUNC
|
||||||
VM_METHOD_TYPE_ISEQ
|
VM_METHOD_TYPE_ISEQ
|
||||||
],
|
],
|
||||||
|
UINT: %w[
|
||||||
|
SHAPE_BITS
|
||||||
|
SHAPE_CAPACITY_CHANGE
|
||||||
|
SHAPE_FLAG_SHIFT
|
||||||
|
SHAPE_FROZEN
|
||||||
|
SHAPE_INITIAL_CAPACITY
|
||||||
|
SHAPE_IVAR
|
||||||
|
SHAPE_IVAR_UNDEF
|
||||||
|
SHAPE_ROOT
|
||||||
|
],
|
||||||
ULONG: %w[
|
ULONG: %w[
|
||||||
INVALID_SHAPE_ID
|
INVALID_SHAPE_ID
|
||||||
SHAPE_MASK
|
SHAPE_MASK
|
||||||
|
Loading…
x
Reference in New Issue
Block a user