Exemple #1
0
 def load(self, v):
     if isinstance(v, flowmodel.Variable):
         if v.concretetype is ootype.Void:
             return  # ignore it
         if v.name in self.argset:
             selftype, selfname = self.args[0]
             if self.is_method and v.name == selfname:
                 self.ilasm.load_self()  # special case for 'self'
             else:
                 self.ilasm.load_arg(v)
         else:
             self.ilasm.load_local(v)
     elif isinstance(v, SubOperation):
         render_sub_op(v, self.db, self.generator)
     else:
         super(Function, self).load(v)
Exemple #2
0
 def load(self, v):
     if isinstance(v, flowmodel.Variable):
         if v.concretetype is ootype.Void:
             return  # ignore it
         if v.name in self.argset:
             selftype, selfname = self.args[0]
             if self.is_method and v.name == selfname:
                 self.ilasm.load_self()  # special case for 'self'
             else:
                 self.ilasm.load_arg(v)
         else:
             self.ilasm.load_local(v)
     elif isinstance(v, SubOperation):
         render_sub_op(v, self.db, self.generator)
     else:
         super(Function, self).load(v)
Exemple #3
0
    def load(self, value):
        if isinstance(value, flowmodel.Variable):
            jty, idx = self._var_data(value)
            return self.load_jvm_var(jty, idx)

        if isinstance(value, SubOperation):
            return render_sub_op(value, self.db, self)

        if isinstance(value, flowmodel.Constant):
            return push_constant(self.db, value.concretetype, value.value, self)
            
        raise Exception('Unexpected type for v in load(): '+
                        repr(value.concretetype) + " v=" + repr(value))