end
end
+redef class IStaticCall
+ redef fun dump_intern(icd)
+ do
+ return "STATIC_CALL {property.full_name}({icd.register_all(exprs)})"
+ end
+end
+
redef class IClosCall
redef fun dump_intern(icd)
do
icb.stmt(inew)
var iargs = [iself]
iargs.add_all(iparams)
- icb.stmt(new INative("{p.cname}(@@@{", @@@"*iparams.length}, init_table)", iargs))
- icb.stmt(new INative("CHECKNEW_{name}(@@@)", [iself]))
+ icb.stmt(new IStaticCall(p, iargs))
+ icb.stmt(new INative("CHECKNEW_{name}(@@@)", [iself]))
var cname = "NEW_{self}_{p.global.intro.cname}"
var new_args = iroutine.compile_signature_to_c(v, cname, "new {self} {p.full_name}", null, null)
var ctx_old = v.ctx
end
end
+redef class IStaticCall
+ redef fun compile_call_to_c(v, args)
+ do
+ var prop = property
+ if prop.global.is_init then args.add("init_table")
+ return "{property.cname}({args.join(", ")})"
+ end
+end
+
redef class INative
redef fun inner_compile_to_c(v)
do
end
end
+# A static call to a specific method
+class IStaticCall
+special IAbsCall
+ init(p: MMMethod, a: Sequence[IRegister]) do super
+end
+
# A closure call
# exprs are the arguments
class IClosCall
end
end
+redef class IStaticCall
+ redef fun inner_dup_with(d)
+ do
+ return new IStaticCall(property, d.dup_iregs(exprs))
+ end
+end
redef class IClosCall
redef fun dup_with(d)
do