Example #1
0
 def return_constant(self, v, forbidden_vars=[], selected_reg=None):
     self._check_type(v)
     if isinstance(v, Const):
         if isinstance(v, ConstPtr):
             tp = REF
         elif isinstance(v, ConstFloat):
             tp = FLOAT
         else:
             tp = INT
         loc = self.get_scratch_reg(tp,
                                    self.temp_boxes + forbidden_vars,
                                    selected_reg=selected_reg)
         immvalue = self.convert_to_imm(v)
         self.assembler.load(loc, immvalue)
         return loc
     else:
         return RegisterManager.return_constant(self, v, forbidden_vars,
                                                selected_reg)
Example #2
0
 def return_constant(self, v, forbidden_vars=[], selected_reg=None):
     self._check_type(v)
     if isinstance(v, Const):
         if isinstance(v, ConstPtr):
             tp = REF
         elif isinstance(v, ConstFloat):
             tp = FLOAT
         else:
             tp = INT
         loc = self.get_scratch_reg(tp,
                 self.temp_boxes + forbidden_vars,
                 selected_reg=selected_reg)
         immvalue = self.convert_to_imm(v)
         self.assembler.load(loc, immvalue)
         return loc
     else:
         return RegisterManager.return_constant(self, v,
                                 forbidden_vars, selected_reg)
Example #3
0
 def __init__(self, longevity, frame_manager=None, assembler=None):
     RegisterManager.__init__(self, longevity, frame_manager, assembler)
Example #4
0
 def __init__(self, longevity, frame_manager=None, assembler=None):
     RegisterManager.__init__(self, longevity, frame_manager, assembler)
Example #5
0
 def __init__(self, longevity, frame_manager=None, assembler=None):
     if isinstance(longevity, dict):
         longevity = LifetimeManager(longevity)
     BaseRegMan.__init__(self, longevity, frame_manager, assembler)