예제 #1
0
파일: test_tlc.py 프로젝트: Debug-Orz/Sypy
def test_serialization():
    from pypy.jit.tl.tlopcode import serialize_program, decode_program
    pool = ConstantPool()
    bytecode = compile("""
        NEW foo,bar,meth=f
        SETATTR foobar
      f:
        RETURN
    """, pool)
    s = serialize_program(bytecode, pool)
    bytecode2, pool2 = decode_program(s)
    assert bytecode == bytecode2
    assert pool == pool2
예제 #2
0
def test_serialization():
    from pypy.jit.tl.tlopcode import serialize_program, decode_program
    pool = ConstantPool()
    bytecode = compile(
        """
        NEW foo,bar,meth=f
        SETATTR foobar
      f:
        RETURN
    """, pool)
    s = serialize_program(bytecode, pool)
    bytecode2, pool2 = decode_program(s)
    assert bytecode == bytecode2
    assert pool == pool2
예제 #3
0
파일: targettlc.py 프로젝트: Debug-Orz/Sypy
def load_bytecode(filename):
    from pypy.rlib.streamio import open_file_as_stream
    from pypy.jit.tl.tlopcode import decode_program
    f = open_file_as_stream(filename)
    return decode_program(f.readall())
예제 #4
0
파일: targettlc.py 프로젝트: njues/Sypy
def load_bytecode(filename):
    from pypy.rlib.streamio import open_file_as_stream
    from pypy.jit.tl.tlopcode import decode_program
    f = open_file_as_stream(filename)
    return decode_program(f.readall())