コード例 #1
0
ファイル: ops_misc.py プロジェクト: googya/pyjvm
def op_0x58(frame):  # pop2
    value = frame.stack.pop()
    if category_type(value) == 2:
        pass
    else:
        value = frame.stack.pop()
        assert category_type(value) == 1
コード例 #2
0
ファイル: ops_misc.py プロジェクト: MatevzFa/pyjvm
def pop2(frame):
    value = frame.stack.pop()
    if category_type(value) == 2:
        pass
    else:
        value = frame.stack.pop()
        assert category_type(value) == 1
コード例 #3
0
ファイル: ops_misc.py プロジェクト: ajgappmark/pyjvm
def pop2(frame):
    value = frame.stack.pop()
    if category_type(value) == 2:
        pass
    else:
        value = frame.stack.pop()
        assert category_type(value) == 1
コード例 #4
0
ファイル: ops_misc.py プロジェクト: MatevzFa/pyjvm
def dup_x1(frame):
    value1 = frame.stack.pop()
    value2 = frame.stack.pop()
    assert category_type(value1) == 1
    assert category_type(value2) == 1
    frame.stack.append(value1)
    frame.stack.append(value2)
    frame.stack.append(value1)
コード例 #5
0
ファイル: ops_misc.py プロジェクト: ajgappmark/pyjvm
def dup_x1(frame):
    value1 = frame.stack.pop()
    value2 = frame.stack.pop()
    assert category_type(value1) == 1
    assert category_type(value2) == 1
    frame.stack.append(value1)
    frame.stack.append(value2)
    frame.stack.append(value1)
コード例 #6
0
ファイル: ops_misc.py プロジェクト: googya/pyjvm
def op_0x5a(frame):  # dup_x1
    value1 = frame.stack.pop()
    value2 = frame.stack.pop()
    assert category_type(value1) == 1
    assert category_type(value2) == 1
    frame.stack.append(value1)
    frame.stack.append(value2)
    frame.stack.append(value1)
コード例 #7
0
ファイル: ops_misc.py プロジェクト: MatevzFa/pyjvm
def dup2(frame):
    value1 = frame.stack.pop()
    if category_type(value1) == 2:
        # form 2
        frame.stack.append(value1)
        frame.stack.append(value1)
        return
    value2 = frame.stack.pop()
    if category_type(value1) == 1 and category_type(value2) == 1:
        # form 1
        frame.stack.append(value2)
        frame.stack.append(value1)
        frame.stack.append(value2)
        frame.stack.append(value1)
        return
    assert False  # should never get here
コード例 #8
0
ファイル: ops_misc.py プロジェクト: googya/pyjvm
def op_0x5c(frame):  # dup2
    value1 = frame.stack.pop()
    if category_type(value1) == 2:
        # form 2
        frame.stack.append(value1)
        frame.stack.append(value1)
        return
    value2 = frame.stack.pop()
    if category_type(value1) == 1 and category_type(value2) == 1:
        # form 1
        frame.stack.append(value2)
        frame.stack.append(value1)
        frame.stack.append(value2)
        frame.stack.append(value1)
        return
    assert False  # should never get here
コード例 #9
0
ファイル: ops_misc.py プロジェクト: ajgappmark/pyjvm
def dup_x2(frame):
    value1 = frame.stack.pop()
    value2 = frame.stack.pop()
    if category_type(value1) == 1 and category_type(value2) == 2:
        # form2
        frame.stack.append(value1)
        frame.stack.append(value2)
        frame.stack.append(value1)
        return
    value3 = frame.stack.pop()
    if category_type(value1) == 1 and category_type(value2) == 1 and category_type(value3 == 1):
        # form 1
        frame.stack.append(value1)
        frame.stack.append(value3)
        frame.stack.append(value2)
        frame.stack.append(value1)
        return
    assert False  # should never get here
コード例 #10
0
ファイル: ops_misc.py プロジェクト: googya/pyjvm
def op_0x59(frame):  # dup
    value = frame.stack.pop()
    assert category_type(value) == 1
    frame.stack.append(value)
    frame.stack.append(value)
コード例 #11
0
ファイル: ops_misc.py プロジェクト: googya/pyjvm
def op_0x57(frame):  # pop
    value = frame.stack.pop()
    assert category_type(value) == 1
コード例 #12
0
ファイル: ops_misc.py プロジェクト: googya/pyjvm
def op_0x5e(frame):  # dup2_x2
    value1 = frame.stack.pop()
    value2 = frame.stack.pop()
    if category_type(value1) == 2 and category_type(value2) == 2:
        # form 4
        frame.stack.append(value1)
        frame.stack.append(value2)
        frame.stack.append(value1)
        return
    value3 = frame.stack.pop()
    if (category_type(value1) == 1 and category_type(value2) == 1 and
            category_type(value3) == 2):
        # form 3
        frame.stack.append(value2)
        frame.stack.append(value1)
        frame.stack.append(value3)
        frame.stack.append(value2)
        frame.stack.append(value1)
        return
    if (category_type(value1) == 2 and category_type(value2) == 1 and
            category_type(value3) == 1):
        # form 2
        frame.stack.append(value1)
        frame.stack.append(value3)
        frame.stack.append(value2)
        frame.stack.append(value1)
        return
    value4 = frame.stack.pop()
    if (category_type(value1) == 1 and category_type(value2) == 1 and
            category_type(value3) == 1 and category_type(value4) == 1):
        # form 1
        frame.stack.append(value2)
        frame.stack.append(value1)
        frame.stack.append(value4)
        frame.stack.append(value3)
        frame.stack.append(value2)
        frame.stack.append(value1)
        return
    assert False  # should never get here
コード例 #13
0
ファイル: ops_misc.py プロジェクト: MatevzFa/pyjvm
def pop(frame):
    value = frame.stack.pop()
    assert category_type(value) == 1
コード例 #14
0
ファイル: ops_misc.py プロジェクト: MatevzFa/pyjvm
def dup2_x2(frame):
    value1 = frame.stack.pop()
    value2 = frame.stack.pop()
    if category_type(value1) == 2 and category_type(value2) == 2:
        # form 4
        frame.stack.append(value1)
        frame.stack.append(value2)
        frame.stack.append(value1)
        return
    value3 = frame.stack.pop()
    if (category_type(value1) == 1 and category_type(value2) == 1
            and category_type(value3) == 2):
        # form 3
        frame.stack.append(value2)
        frame.stack.append(value1)
        frame.stack.append(value3)
        frame.stack.append(value2)
        frame.stack.append(value1)
        return
    if (category_type(value1) == 2 and category_type(value2) == 1
            and category_type(value3) == 1):
        # form 2
        frame.stack.append(value1)
        frame.stack.append(value3)
        frame.stack.append(value2)
        frame.stack.append(value1)
        return
    value4 = frame.stack.pop()
    if (category_type(value1) == 1 and category_type(value2) == 1
            and category_type(value3) == 1 and category_type(value4) == 1):
        # form 1
        frame.stack.append(value2)
        frame.stack.append(value1)
        frame.stack.append(value4)
        frame.stack.append(value3)
        frame.stack.append(value2)
        frame.stack.append(value1)
        return
    assert False  # should never get here
コード例 #15
0
ファイル: ops_misc.py プロジェクト: ajgappmark/pyjvm
def dup(frame):
    value = frame.stack.pop()
    assert category_type(value) == 1
    frame.stack.append(value)
    frame.stack.append(value)
コード例 #16
0
ファイル: ops_misc.py プロジェクト: MatevzFa/pyjvm
def dup(frame):
    value = frame.stack.pop()
    assert category_type(value) == 1
    frame.stack.append(value)
    frame.stack.append(value)
コード例 #17
0
ファイル: ops_misc.py プロジェクト: ajgappmark/pyjvm
def pop(frame):
    value = frame.stack.pop()
    assert category_type(value) == 1