Ejemplo n.º 1
0
 def _expand_info(self, arg, infos):
     if isinstance(arg, AbstractResOp) and arg.is_same_as():
         info = self.optimizer.getinfo(arg.getarg(0))
     else:
         info = self.optimizer.getinfo(arg)
     if arg in infos:
         return
     if info:
         infos[arg] = info
         if info.is_virtual():
             self._expand_infos_from_virtual(info, infos)
Ejemplo n.º 2
0
 def _expand_info(self, arg, infos):
     if isinstance(arg, AbstractResOp) and rop.is_same_as(arg.opnum):
         info = self.optimizer.getinfo(arg.getarg(0))
     else:
         info = self.optimizer.getinfo(arg)
     if arg in infos:
         return
     if info:
         infos[arg] = info
         if info.is_virtual():
             self._expand_infos_from_virtual(info, infos)
Ejemplo n.º 3
0
 def _expand_info(self, arg, infos):
     arg1 = self.optimizer.as_operation(arg)
     if arg1 is not None and rop.is_same_as(arg1.opnum):
         info = self.optimizer.getinfo(arg1.getarg(0))
     else:
         info = self.optimizer.getinfo(arg)
     if arg in infos:
         return
     if info:
         infos[arg] = info
         if info.is_virtual():
             self._expand_infos_from_virtual(info, infos)
Ejemplo n.º 4
0
 def force_box_for_end_of_preamble(self, box):
     if box.type == "r":
         info = self.getptrinfo(box)
         if info is not None and info.is_virtual():
             rec = {}
             return info.force_at_the_end_of_preamble(box, self.optearlyforce, rec)
         return box
     if box.type == "i":
         info = self.getrawptrinfo(box)
         if info is not None:
             return info.force_at_the_end_of_preamble(box, self.optearlyforce, None)
     return box
Ejemplo n.º 5
0
 def optimize_CALL_N(self, op):
     effectinfo = op.getdescr().get_extra_info()
     if effectinfo.oopspecindex == EffectInfo.OS_RAW_MALLOC_VARSIZE_CHAR:
         return self.do_RAW_MALLOC_VARSIZE_CHAR(op)
     elif effectinfo.oopspecindex == EffectInfo.OS_RAW_FREE:
         return self.do_RAW_FREE(op)
     elif effectinfo.oopspecindex == EffectInfo.OS_JIT_FORCE_VIRTUALIZABLE:
         # we might end up having CALL here instead of COND_CALL
         info = getptrinfo(op.getarg(1))
         if info and info.is_virtual():
             return
     else:
         return self.emit(op)
Ejemplo n.º 6
0
 def optimize_CALL_N(self, op):
     effectinfo = op.getdescr().get_extra_info()
     if effectinfo.oopspecindex == EffectInfo.OS_RAW_MALLOC_VARSIZE_CHAR:
         self.do_RAW_MALLOC_VARSIZE_CHAR(op)
     elif effectinfo.oopspecindex == EffectInfo.OS_RAW_FREE:
         self.do_RAW_FREE(op)
     elif effectinfo.oopspecindex == EffectInfo.OS_JIT_FORCE_VIRTUALIZABLE:
         # we might end up having CALL here instead of COND_CALL
         info = self.getptrinfo(op.getarg(1))
         if info and info.is_virtual():
             return
     else:
         self.emit_operation(op)
Ejemplo n.º 7
0
 def force_box_for_end_of_preamble(self, box):
     if box.type == 'r':
         info = getptrinfo(box)
         if info is not None and info.is_virtual():
             rec = {}
             return info.force_at_the_end_of_preamble(
                 box, self.optearlyforce, rec)
         return box
     if box.type == 'i':
         info = getrawptrinfo(box)
         if info is not None:
             return info.force_at_the_end_of_preamble(
                 box, self.optearlyforce, None)
     return box