示例#1
0
 def fn(flag):
     if flag:
         cls = cInt32
     else:
         cls = cString
     clitype = class2type(cls)
     return clitype.get_FullName()
示例#2
0
文件: test_dotnet.py 项目: sota/pypy
 def fn(flag):
     if flag:
         cls = cInt32
     else:
         cls = cString
     clitype = class2type(cls)
     return clitype.get_FullName()
示例#3
0
 def compute_types(self):
     box2classes = {}  # box --> [ootype.Class]
     self._collect_types(self.cliloop.operations, box2classes)
     for box, classes in box2classes.iteritems():
         cls = classes[0]
         for cls2 in classes[1:]:
             if ootype.subclassof(cls, cls2):
                 cls = cls2
             else:
                 assert ootype.subclassof(cls2, cls)
         self.box2type[box] = dotnet.class2type(cls)
示例#4
0
文件: method.py 项目: sota/pypy
 def compute_types(self):
     box2classes = {}  # box --> [ootype.Class]
     self._collect_types(self.cliloop.operations, box2classes)
     for box, classes in box2classes.iteritems():
         cls = classes[0]
         for cls2 in classes[1:]:
             if ootype.subclassof(cls, cls2):
                 cls = cls2
             else:
                 assert ootype.subclassof(cls2, cls)
         self.box2type[box] = dotnet.class2type(cls)
示例#5
0
 def emit_op_guard_exception(self, op):
     il_label = self.newbranch(op)
     classbox = op.args[0]
     assert isinstance(classbox, ConstObj)
     oocls = classbox.getref(ootype.Class)
     clitype = dotnet.class2type(oocls)
     self.av_inputargs.load(self)
     self.il.Emit(OpCodes.Ldfld, self.exc_value_field)
     self.il.Emit(OpCodes.Isinst, clitype)
     self.il.Emit(OpCodes.Brfalse, il_label)
     # the guard succeeded, store the result
     self.av_inputargs.load(self)
     self.il.Emit(OpCodes.Ldfld, self.exc_value_field)
     self.store_result(op)
示例#6
0
文件: method.py 项目: sota/pypy
 def emit_op_guard_exception(self, op):
     il_label = self.newbranch(op)
     classbox = op.args[0]
     assert isinstance(classbox, ConstObj)
     oocls = classbox.getref(ootype.Class)
     clitype = dotnet.class2type(oocls)
     self.av_inputargs.load(self)
     self.il.Emit(OpCodes.Ldfld, self.exc_value_field)
     self.il.Emit(OpCodes.Isinst, clitype)
     self.il.Emit(OpCodes.Brfalse, il_label)
     # the guard succeeded, store the result
     self.av_inputargs.load(self)
     self.il.Emit(OpCodes.Ldfld, self.exc_value_field)
     self.store_result(op)
示例#7
0
 def get_self_clitype(self):
     return dotnet.class2type(self.selfclass)
示例#8
0
 def get_meth_info(self):
     clitype = dotnet.class2type(cpypyString)
     return clitype.GetMethod(self.methname + '')
示例#9
0
 def get_delegate_clitype(self):
     return dotnet.class2type(self.funcclass)
示例#10
0
 def get_clitype(self):
     return dotnet.class2type(self.ooclass)
示例#11
0
 def _get_meth_wrapper(self):
     restype = dotnet.class2type(cVoid)
     args = self._get_args_array([dotnet.typeof(InputArgs)])
     return get_method_wrapper(self.name, restype, args)
示例#12
0
文件: method.py 项目: sota/pypy
 def _get_meth_wrapper(self):
     restype = dotnet.class2type(cVoid)
     args = self._get_args_array([dotnet.typeof(InputArgs)])
     return get_method_wrapper(self.name, restype, args)
示例#13
0
文件: runner.py 项目: sota/pypy
 def get_self_clitype(self):
     return dotnet.class2type(self.selfclass)
示例#14
0
文件: runner.py 项目: sota/pypy
 def get_meth_info(self):
     clitype = dotnet.class2type(cpypyString)
     return clitype.GetMethod(self.methname+'')
示例#15
0
文件: runner.py 项目: sota/pypy
 def get_delegate_clitype(self):
     return dotnet.class2type(self.funcclass)
示例#16
0
文件: runner.py 项目: sota/pypy
 def get_clitype(self):
     return dotnet.class2type(self.ooclass)