Esempio n. 1
0
    def __init__(self, rtyper, stats, opts, translate_support_code=False,
                 gcdescr=None):
        assert type(opts) is not bool
        self.opts = opts

        from pypy.jit.backend.llsupport.gc import get_ll_description
        AbstractCPU.__init__(self)
        self.rtyper = rtyper
        self.stats = stats
        self.translate_support_code = translate_support_code
        if translate_support_code:
            translator = rtyper.annotator.translator
        else:
            translator = None
        self.gc_ll_descr = get_ll_description(gcdescr, translator, rtyper)
        if translator and translator.config.translation.gcremovetypeptr:
            self.vtable_offset = None
        else:
            self.vtable_offset, _ = symbolic.get_field_token(rclass.OBJECT,
                                                             'typeptr',
                                                        translate_support_code)
        self._setup_prebuilt_error('ovf', OverflowError)
        self._setup_prebuilt_error('zer', ZeroDivisionError)
        if translate_support_code:
            self._setup_exception_handling_translated()
        else:
            self._setup_exception_handling_untranslated()
        self.saved_exc_value = lltype.nullptr(llmemory.GCREF.TO)
        self.asmmemmgr = AsmMemoryManager()
        self.setup()
        if translate_support_code:
            self._setup_on_leave_jitted_translated()
        else:
            self._setup_on_leave_jitted_untranslated()
Esempio n. 2
0
 def __init__(self,
              rtyper,
              stats,
              translate_support_code=False,
              gcdescr=None):
     from pypy.jit.backend.llsupport.gc import get_ll_description
     self.rtyper = rtyper
     self.stats = stats
     self.translate_support_code = translate_support_code
     if translate_support_code:
         translator = rtyper.annotator.translator
     else:
         translator = None
     self.gc_ll_descr = get_ll_description(gcdescr, translator)
     self.vtable_offset, _ = symbolic.get_field_token(
         rclass.OBJECT, 'typeptr', translate_support_code)
     self._setup_prebuilt_error('ovf', OverflowError)
     self._setup_prebuilt_error('zer', ZeroDivisionError)
     if translate_support_code:
         self._setup_exception_handling_translated()
     else:
         self._setup_exception_handling_untranslated()
     self.clear_exception()
     self.setup()
     if translate_support_code:
         self._setup_on_leave_jitted_translated()
     else:
         self._setup_on_leave_jitted_untranslated()
Esempio n. 3
0
    def __init__(self, rtyper, stats, opts, translate_support_code=False,
                 gcdescr=None):
        assert type(opts) is not bool
        self.opts = opts

        from pypy.jit.backend.llsupport.gc import get_ll_description
        AbstractCPU.__init__(self)
        self.rtyper = rtyper
        self.stats = stats
        self.translate_support_code = translate_support_code
        if translate_support_code:
            translator = rtyper.annotator.translator
        else:
            translator = None
        self.gc_ll_descr = get_ll_description(gcdescr, translator, rtyper)
        if translator and translator.config.translation.gcremovetypeptr:
            self.vtable_offset = None
        else:
            self.vtable_offset, _ = symbolic.get_field_token(rclass.OBJECT,
                                                             'typeptr',
                                                        translate_support_code)
        self._setup_prebuilt_error('ovf', OverflowError)
        self._setup_prebuilt_error('zer', ZeroDivisionError)
        if translate_support_code:
            self._setup_exception_handling_translated()
        else:
            self._setup_exception_handling_untranslated()
        self.saved_exc_value = lltype.nullptr(llmemory.GCREF.TO)
        self.asmmemmgr = AsmMemoryManager()
        self.setup()
        if translate_support_code:
            self._setup_on_leave_jitted_translated()
        else:
            self._setup_on_leave_jitted_untranslated()
Esempio n. 4
0
 def __init__(self, rtyper, stats, translate_support_code=False,
              gcdescr=None):
     from pypy.jit.backend.llsupport.gc import get_ll_description
     self.rtyper = rtyper
     self.stats = stats
     self.translate_support_code = translate_support_code
     if translate_support_code:
         translator = rtyper.annotator.translator
     else:
         translator = None
     self.gc_ll_descr = get_ll_description(gcdescr, translator)
     self.vtable_offset, _ = symbolic.get_field_token(rclass.OBJECT,
                                                      'typeptr',
                                                     translate_support_code)
     self._setup_prebuilt_error('ovf', OverflowError)
     self._setup_prebuilt_error('zer', ZeroDivisionError)
     if translate_support_code:
         self._setup_exception_handling_translated()
     else:
         self._setup_exception_handling_untranslated()
     self.clear_exception()
     self.setup()
     if translate_support_code:
         self._setup_on_leave_jitted_translated()
     else:
         self._setup_on_leave_jitted_untranslated()