Did I find the right examples for you? yes no

All Samples(0)  |  Call(0)  |  Derive(0)  |  Import(0)

src/s/y/Sypy-HEAD/interpreter/astcompiler/assemble.py   Sypy(Download)
        if not self.is_dead_code():
            self.instrs.append(instr)
            if op == ops.RETURN_VALUE:
                self.current_block.have_return = True
        return instr
                                    instr.opcode = ops.JUMP_ABSOLUTE
                                    absolute = True
                                elif target_op == ops.RETURN_VALUE:
                                    # Replace JUMP_* to a RETURN into just a RETURN
                                    instr.opcode = ops.RETURN_VALUE
            if self.add_none_to_final_return:
                self.load_const(self.space.w_None)
            self.emit_op(ops.RETURN_VALUE)
        # Set the first lineno if it is not already explicitly set.
        if self.first_lineno == -1:
 
    ops.LOAD_LOCALS : 1,
    ops.RETURN_VALUE : -1,
    ops.EXEC_STMT : -3,
    ops.YIELD_VALUE : 0,

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/interpreter/astcompiler/assemble.py   plexnet(Download)
            self.lineno_set = True
        self.instrs.append(instr)
        if op == ops.RETURN_VALUE:
            self.current_block.have_return = True
        return instr
            if self.add_none_to_final_return:
                self.load_const(self.space.w_None)
            self.emit_op(ops.RETURN_VALUE)
        # Set the first lineno if it is not already explicitly set.
        if self.first_lineno == -1:
 
    ops.LOAD_LOCALS : 1,
    ops.RETURN_VALUE : -1,
    ops.EXEC_STMT : -3,
    ops.YIELD_VALUE : 0,

src/s/y/Sypy-HEAD/interpreter/astcompiler/codegen.py   Sypy(Download)
        self.add_const(self.space.w_None)
        lam.body.walkabout(self)
        self.emit_op(ops.RETURN_VALUE)
 
 
    def _end_comp(self):
        self.emit_op(ops.RETURN_VALUE)
 
 
class GenExpCodeGenerator(ComprehensionCodeGenerator):
        self._handle_body(cls.body)
        self.emit_op(ops.LOAD_LOCALS)
        self.emit_op(ops.RETURN_VALUE)
 

src/p/l/plexnet-HEAD/third_party/generic/pypy/pypy/interpreter/astcompiler/codegen.py   plexnet(Download)
            self.argcount = len(lam.args.args)
        lam.body.walkabout(self)
        self.emit_op(ops.RETURN_VALUE)
 
 
        self._handle_body(cls.body)
        self.emit_op(ops.LOAD_LOCALS)
        self.emit_op(ops.RETURN_VALUE)
 

src/s/y/Sypy-HEAD/interpreter/astcompiler/test/test_compiler.py   Sypy(Download)
        assert ops.JUMP_FORWARD not in counts
        assert ops.JUMP_ABSOLUTE not in counts
        assert counts[ops.RETURN_VALUE] == 2
 
    def test_const_fold_subscr(self):
        source = """def f():
        return (0, 1)[0]
        """
        counts = self.count_instructions(source)
        assert counts == {ops.LOAD_CONST: 1, ops.RETURN_VALUE: 1}
        counts = self.count_instructions(source)
        if 0:   # xxx later?
            assert counts == {ops.LOAD_CONST: 1, ops.RETURN_VALUE: 1}
 
        # getitem outside of the BMP should not be optimized
        counts = self.count_instructions(source)
        assert counts == {ops.LOAD_CONST: 2, ops.BINARY_SUBSCR: 1,
                          ops.RETURN_VALUE: 1}
 
        source = """def f():
        return u"\U00012345abcdef"[3]
        """
        counts = self.count_instructions(source)
        assert counts == {ops.LOAD_CONST: 2, ops.BINARY_SUBSCR: 1,
                          ops.RETURN_VALUE: 1}