fun native_array_instance(elttype: MType, length: RuntimeVariable): RuntimeVariable is abstract
src/compiler/abstract_compiler.nit:1359,2--96
redef fun native_array_instance(elttype, length)
do
var mtype = mmodule.native_array_type(elttype)
self.require_declaration("NEW_{mtype.mclass.c_name}")
assert mtype isa MGenericType
var compiler = self.compiler
length = autobox(length, compiler.mainmodule.int_type)
if mtype.need_anchor then
hardening_live_open_type(mtype)
link_unresolved_type(self.frame.mpropdef.mclassdef, mtype)
var recv = self.frame.arguments.first
var recv_type_info = self.type_info(recv)
self.require_declaration(mtype.const_color)
return self.new_expr("NEW_{mtype.mclass.c_name}((int){length}, {recv_type_info}->resolution_table->types[{mtype.const_color}])", mtype)
end
compiler.undead_types.add(mtype)
self.require_declaration("type_{mtype.c_name}")
return self.new_expr("NEW_{mtype.mclass.c_name}((int){length}, &type_{mtype.c_name})", mtype)
end
src/compiler/separate_compiler.nit:2167,2--2185,4
redef fun native_array_instance(elttype, length)
do
var ret_type = mmodule.native_array_type(elttype)
ret_type = anchor(ret_type).as(MClassType)
length = autobox(length, compiler.mainmodule.int_type)
return self.new_expr("NEW_{ret_type.c_name}((int){length})", ret_type)
end
src/compiler/global_compiler.nit:445,2--451,4
redef fun native_array_instance(elttype, length)
do
var nclass = mmodule.native_array_class
var mtype = nclass.get_mtype([elttype])
var res = self.new_var(mtype)
res.is_exact = true
self.require_declaration("NEW_{nclass.c_name}")
length = autobox(length, compiler.mainmodule.int_type)
self.add("{res} = NEW_{nclass.c_name}({length});")
return res
end
src/compiler/separate_erasure_compiler.nit:711,2--721,4