Esempio n. 1
0
 def rtype_hint(self, hop):
     hints = hop.args_s[-1].const
     optimized = getattr(self.listitem, 'hint_maxlength', False)
     if optimized and 'maxlength' in hints:
         return self.rtype_hint_maxlength(hop)
     elif 'fence' in hints:
         return self.rtype_hint_fence(hop)
     return AbstractBaseListRepr.rtype_hint(self, hop)
Esempio n. 2
0
 def rtype_hint(self, hop):
     hints = hop.args_s[-1].const
     optimized = getattr(self.listitem, 'hint_maxlength', False)
     if optimized and 'maxlength' in hints:
         return self.rtype_hint_maxlength(hop)
     elif 'fence' in hints:
         return self.rtype_hint_fence(hop)
     return AbstractBaseListRepr.rtype_hint(self, hop)
Esempio n. 3
0
 def rtype_hint(self, hop):
     hints = hop.args_s[-1].const
     if 'maxlength' in hints:
         v_list = hop.inputarg(self, arg=0)
         # XXX give a hint to pre-allocate the list (see lltypesystem/rlist)
         return v_list
     if 'fence' in hints:
         return hop.inputarg(self, arg=0)
     return AbstractBaseListRepr.rtype_hint(self, hop)
Esempio n. 4
0
 def rtype_hint(self, hop):
     hints = hop.args_s[-1].const
     if 'maxlength' in hints:
         v_list = hop.inputarg(self, arg=0)
         # XXX give a hint to pre-allocate the list (see lltypesystem/rlist)
         return v_list
     if 'fence' in hints:
         return hop.inputarg(self, arg=0)
     return AbstractBaseListRepr.rtype_hint(self, hop)
Esempio n. 5
0
 def rtype_hint(self, hop):
     hints = hop.args_s[-1].const
     if 'maxlength' in hints or 'fence' in hints:
         # see doc/discussion/list_comprehension_ootype.txt
         assert False, 'TODO'
     return AbstractBaseListRepr.rtype_hint(self, hop)