Ejemplo n.º 1
0
 def do_call(self, args, calldescr):
     assert isinstance(calldescr, CallDescr)
     num_args = len(calldescr.args_indices)
     assert num_args == len(args) - 1
     loop = self._get_loop_for_call(num_args, calldescr)
     history.set_future_values(self, args)
     self.execute_operations(loop)
     # Note: if an exception is set, the rest of the code does a bit of
     # nonsense but nothing wrong (the return value should be ignored)
     if calldescr.res_index < 0:
         return None
     elif calldescr.res_index == self.SIZE_GCPTR:
         return BoxPtr(self.get_latest_value_ref(0))
     else:
         return BoxInt(self.get_latest_value_int(0))
Ejemplo n.º 2
0
 def do_call(self, args, calldescr):
     assert isinstance(calldescr, BaseCallDescr)
     assert len(args) == 1 + len(calldescr.arg_classes)
     if not we_are_translated():
         assert (list(
             calldescr.arg_classes) == [arg.type for arg in args[1:]])
     loop_token = calldescr.get_token_for_call(self)
     set_future_values(self, args)
     self.execute_token(loop_token)
     # Note: if an exception is set, the rest of the code does a bit of
     # nonsense but nothing wrong (the return value should be ignored)
     if calldescr.returns_a_pointer():
         return BoxPtr(self.get_latest_value_ref(0))
     elif calldescr.returns_a_float():
         return BoxFloat(self.get_latest_value_float(0))
     elif calldescr.get_result_size(self.translate_support_code) > 0:
         return BoxInt(self.get_latest_value_int(0))
     else:
         return None
Ejemplo n.º 3
0
 def do_call(self, args, calldescr):
     assert isinstance(calldescr, BaseCallDescr)
     assert len(args) == 1 + len(calldescr.arg_classes)
     if not we_are_translated():
         assert (list(calldescr.arg_classes) ==
                 [arg.type for arg in args[1:]])
     loop_token = calldescr.get_token_for_call(self)
     set_future_values(self, args)
     self.execute_token(loop_token)
     # Note: if an exception is set, the rest of the code does a bit of
     # nonsense but nothing wrong (the return value should be ignored)
     if calldescr.returns_a_pointer():
         return BoxPtr(self.get_latest_value_ref(0))
     elif calldescr.returns_a_float():
         return BoxFloat(self.get_latest_value_float(0))
     elif calldescr.get_result_size(self.translate_support_code) > 0:
         return BoxInt(self.get_latest_value_int(0))
     else:
         return None