示例#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
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
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
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
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
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
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
def pop(frame):
    value = frame.stack.pop()
    assert category_type(value) == 1
示例#14
0
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
def dup(frame):
    value = frame.stack.pop()
    assert category_type(value) == 1
    frame.stack.append(value)
    frame.stack.append(value)
示例#16
0
def dup(frame):
    value = frame.stack.pop()
    assert category_type(value) == 1
    frame.stack.append(value)
    frame.stack.append(value)
示例#17
0
def pop(frame):
    value = frame.stack.pop()
    assert category_type(value) == 1