Пример #1
0
 def __init__(self, genoo):
     OODatabase.__init__(self, genoo)
     self.classes = {}  # INSTANCE --> class_name
     self.classnames = set()  # (namespace, name)
     self.recordnames = {}  # RECORD --> name
     self.functions = {}  # graph --> function_name
     self.methods = {}  # graph --> method_name
     self.consts = {}  # value --> AbstractConst
     self.delegates = {}  # StaticMethod --> type_name
     self.const_count = Counter()  # store statistics about constants
Пример #2
0
 def __init__(self, genoo):
     OODatabase.__init__(self, genoo)
     self.classes = {} # INSTANCE --> class_name
     self.classnames = set() # (namespace, name)
     self.recordnames = {} # RECORD --> name
     self.functions = {} # graph --> function_name
     self.methods = {} # graph --> method_name
     self.consts = {}  # value --> AbstractConst
     self.delegates = {} # StaticMethod --> type_name
     self.const_count = Counter() # store statistics about constants
Пример #3
0
    def __init__(self, genoo):
        OODatabase.__init__(self, genoo)
        
        # Private attributes:
        self._jasmin_files = [] # list of strings --- .j files we made
        self._classes = {} # Maps ootype class objects to node.Class objects,
                           # and JvmType objects as well
        self._functions = {}      # graph -> jvm.Method

        # (jargtypes, jrettype) -> node.StaticMethodInterface
        self._delegates = {}

        # (INSTANCE, method_name) -> node.StaticMethodImplementation
        self._bound_methods = {}

        self._function_names = {} # graph --> function_name

        self._constants = {}      # flowmodel.Variable --> jvm.Const

        # Create information about the Main class we will build:
        #
        #    It will have two static fields, 'ilink' and 'pypy'.  The
        #    first points to an instance of the interface pypy.Interlink
        #    which we will be generated.  The second points to an instance
        #    of pypy.PyPy which was created with this Interlink instance.
        #
        #    The Interlink class provides the bridge between static helper
        #    code and dynamically generated classes.  Since there is one
        #    Main per set of translated code, this also allows multiple
        #    PyPy interpreters to overlap with one another.
        #
        #    These are public attributes that are referenced from
        #    elsewhere in the code using
        #    jvm.Generator.push_interlink() and .push_pypy().
        self.jPyPyMain = jvm.JvmClassType(self._pkg('Main'))
        self.pypy_field = jvm.Field.s(self.jPyPyMain, 'pypy', jvm.jPyPy)
        self.interlink_field = jvm.Field.s(self.jPyPyMain, 'ilink',
                                           jvm.jPyPyInterlink)