Esempio n. 1
0
    def make_enter_function(self, jd):
        from rpython.jit.metainterp.warmstate import WarmEnterState
        state = WarmEnterState(self, jd)
        maybe_compile_and_run = state.make_entry_point()
        jd.warmstate = state

        def crash_in_jit(e):
            tb = not we_are_translated() and sys.exc_info()[2]
            try:
                raise e
            except jitexc.JitException:
                raise  # go through
            except MemoryError:
                raise  # go through
            except StackOverflow:
                raise  # go through
            except Exception, e:
                if not we_are_translated():
                    print "~~~ Crash in JIT!"
                    print '~~~ %s: %s' % (e.__class__, e)
                    if sys.stdout == sys.__stdout__:
                        import pdb
                        pdb.post_mortem(tb)
                    raise e.__class__, e, tb
                fatalerror('~~~ Crash in JIT! %s' % (e, ))
Esempio n. 2
0
    def make_enter_function(self, jd):
        from rpython.jit.metainterp.warmstate import WarmEnterState
        state = WarmEnterState(self, jd)
        maybe_compile_and_run, EnterJitAssembler = state.make_entry_point()
        jd.warmstate = state

        def crash_in_jit(e):
            tb = not we_are_translated() and sys.exc_info()[2]
            try:
                raise e
            except jitexc.JitException:
                raise     # go through
            except MemoryError:
                raise     # go through
            except StackOverflow:
                raise     # go through
            except Exception as e:
                if not we_are_translated():
                    print "~~~ Crash in JIT!"
                    print '~~~ %s: %s' % (e.__class__, e)
                    if sys.stdout == sys.__stdout__:
                        import pdb; pdb.post_mortem(tb)
                    raise e.__class__, e, tb
                fatalerror('~~~ Crash in JIT! %s' % (e,))
        crash_in_jit._dont_inline_ = True

        def maybe_enter_jit(*args):
            try:
                maybe_compile_and_run(state.increment_threshold, *args)
            except Exception as e:
                crash_in_jit(e)
        maybe_enter_jit._always_inline_ = True
        jd._maybe_enter_jit_fn = maybe_enter_jit
        jd._maybe_compile_and_run_fn = maybe_compile_and_run
        jd._EnterJitAssembler = EnterJitAssembler
Esempio n. 3
0
    def make_enter_function(self, jd):
        from rpython.jit.metainterp.warmstate import WarmEnterState
        state = WarmEnterState(self, jd)
        maybe_compile_and_run, EnterJitAssembler = state.make_entry_point()
        jd.warmstate = state

        def crash_in_jit(e):
            tb = not we_are_translated() and sys.exc_info()[2]
            try:
                raise e
            except jitexc.JitException:
                raise  # go through
            except MemoryError:
                raise  # go through
            except StackOverflow:
                raise  # go through
            except Exception as e:
                if not we_are_translated():
                    print "~~~ Crash in JIT!"
                    print '~~~ %s: %s' % (e.__class__, e)
                    if sys.stdout == sys.__stdout__:
                        import pdb
                        pdb.post_mortem(tb)
                    raise e.__class__, e, tb
                fatalerror('~~~ Crash in JIT! %s' % (e, ))

        crash_in_jit._dont_inline_ = True

        def maybe_enter_jit(*args):
            try:
                maybe_compile_and_run(state.increment_threshold, *args)
            except Exception as e:
                crash_in_jit(e)

        maybe_enter_jit._always_inline_ = True
        jd._maybe_enter_jit_fn = maybe_enter_jit
        jd._maybe_compile_and_run_fn = maybe_compile_and_run
        jd._EnterJitAssembler = EnterJitAssembler
Esempio n. 4
0
    def make_enter_function(self, jd):
        from rpython.jit.metainterp.warmstate import WarmEnterState
        state = WarmEnterState(self, jd)
        maybe_compile_and_run = state.make_entry_point()
        jd.warmstate = state

        def crash_in_jit(e):
            tb = not we_are_translated() and sys.exc_info()[2]
            try:
                raise e
            except jitexc.JitException:
                raise     # go through
            except MemoryError:
                raise     # go through
            except StackOverflow:
                raise     # go through
            except Exception, e:
                if not we_are_translated():
                    print "~~~ Crash in JIT!"
                    print '~~~ %s: %s' % (e.__class__, e)
                    if sys.stdout == sys.__stdout__:
                        import pdb; pdb.post_mortem(tb)
                    raise e.__class__, e, tb
                fatalerror('~~~ Crash in JIT! %s' % (e,))