def do_call(self, args, calldescr): assert isinstance(calldescr, Descr) func = args[0].getint() for arg in args[1:]: if arg.type == REF: llimpl.do_call_pushptr(arg.getref_base()) elif arg.type == FLOAT: llimpl.do_call_pushfloat(arg.getfloat()) else: llimpl.do_call_pushint(arg.getint()) if calldescr.typeinfo == REF: return history.BoxPtr(llimpl.do_call_ptr(func, self.memo_cast)) elif calldescr.typeinfo == INT: return history.BoxInt(llimpl.do_call_int(func, self.memo_cast)) elif calldescr.typeinfo == FLOAT: return history.BoxFloat(llimpl.do_call_float(func, self.memo_cast)) elif calldescr.typeinfo == 'v': # void llimpl.do_call_void(func, self.memo_cast) else: raise NotImplementedError
def bh_call_i(self, func, calldescr, args_i, args_r, args_f): self._prepare_call(INT, calldescr, args_i, args_r, args_f) return llimpl.do_call_int(func)