Exemplo n.º 1
0
    def finish(self):
        #
        def force_virtualizable_if_necessary(virtualizable):
            if virtualizable.vable_token:
                self.force_now(virtualizable)

        force_virtualizable_if_necessary._always_inline_ = True
        #
        all_graphs = self.warmrunnerdesc.translator.graphs
        ts = self.warmrunnerdesc.cpu.ts
        (_, FUNCPTR) = ts.get_FuncType([self.VTYPEPTR], lltype.Void)
        funcptr = self.warmrunnerdesc.helper_func(
            FUNCPTR, force_virtualizable_if_necessary)
        rvirtualizable.replace_force_virtualizable_with_call(
            all_graphs, self.VTYPEPTR, funcptr)
        (_, FUNCPTR) = ts.get_FuncType([llmemory.GCREF], lltype.Void)
        self.clear_vable_ptr = self.warmrunnerdesc.helper_func(
            FUNCPTR, self.clear_vable_token)
        FUNC = FUNCPTR.TO
        ei = EffectInfo([], [], [], [], [], [],
                        EffectInfo.EF_CANNOT_RAISE,
                        can_invalidate=False,
                        oopspecindex=EffectInfo.OS_JIT_FORCE_VIRTUALIZABLE)

        self.clear_vable_descr = self.cpu.calldescrof(FUNC, FUNC.ARGS,
                                                      FUNC.RESULT, ei)
Exemplo n.º 2
0
    def replace_force_virtualizable(self, rtyper, graphs):
        from rpython.annotator import model as annmodel
        from rpython.rtyper.annlowlevel import MixLevelHelperAnnotator
        graph = graphs[0]

        for block, op in graph.iterblockops():
            if op.opname == 'jit_force_virtualizable':
                v_inst_ll_type = op.args[0].concretetype
                break

        def mycall(vinst_ll):
            if vinst_ll.vable_token:
                raise ValueError
        annhelper = MixLevelHelperAnnotator(rtyper)
        s_vinst = SomePtr(v_inst_ll_type)
        funcptr = annhelper.delayedfunction(mycall, [s_vinst], annmodel.s_None)
        annhelper.finish()
        replace_force_virtualizable_with_call(graphs, v_inst_ll_type, funcptr)
        return funcptr
Exemplo n.º 3
0
    def replace_force_virtualizable(self, rtyper, graphs):
        from rpython.annotator import model as annmodel
        from rpython.rtyper.annlowlevel import MixLevelHelperAnnotator
        graph = graphs[0]

        for block, op in graph.iterblockops():
            if op.opname == 'jit_force_virtualizable':
                v_inst_ll_type = op.args[0].concretetype
                break

        def mycall(vinst_ll):
            if vinst_ll.vable_token:
                raise ValueError

        annhelper = MixLevelHelperAnnotator(rtyper)
        s_vinst = SomePtr(v_inst_ll_type)
        funcptr = annhelper.delayedfunction(mycall, [s_vinst], annmodel.s_None)
        annhelper.finish()
        replace_force_virtualizable_with_call(graphs, v_inst_ll_type, funcptr)
        return funcptr
Exemplo n.º 4
0
    def finish(self):
        #
        def force_virtualizable_if_necessary(virtualizable):
            if virtualizable.vable_token:
                self.force_now(virtualizable)
        force_virtualizable_if_necessary._always_inline_ = True
        #
        all_graphs = self.warmrunnerdesc.translator.graphs
        ts = self.warmrunnerdesc.cpu.ts
        (_, FUNCPTR) = ts.get_FuncType([self.VTYPEPTR], lltype.Void)
        funcptr = self.warmrunnerdesc.helper_func(
            FUNCPTR, force_virtualizable_if_necessary)
        rvirtualizable.replace_force_virtualizable_with_call(
            all_graphs, self.VTYPEPTR, funcptr)
        (_, FUNCPTR) = ts.get_FuncType([llmemory.GCREF], lltype.Void)
        self.clear_vable_ptr = self.warmrunnerdesc.helper_func(
            FUNCPTR, self.clear_vable_token)
        FUNC = FUNCPTR.TO
        ei = EffectInfo([], [], [], [], [], [], EffectInfo.EF_CANNOT_RAISE,
                        can_invalidate=False,
                        oopspecindex=EffectInfo.OS_JIT_FORCE_VIRTUALIZABLE)

        self.clear_vable_descr = self.cpu.calldescrof(FUNC, FUNC.ARGS,
                                                      FUNC.RESULT, ei)