# Path: pyjvm/bytecode.py
# def bytecode(code):
#     def cl(func):
#         BYTECODE[hex(code)] = func
#         return func
# 
#     return cl
# 
# Path: pyjvm/jassert.py
# def jassert_ref(ref):
#     assert ref is None or (type(ref) is tuple and ref[0] in ("ref", "vm_ref"))
# 
# Path: pyjvm/thread.py
# class SkipThreadCycle(Exception):
#     '''Thread may skip his execution quota in case when a monitor
#     is busy or sleep was called
#     '''
#     pass
# 
# Path: pyjvm/utils.py
# def category_type(value):
#     '''Get category type of a variable according to jdk specs
# 
#     long, double are 2, others are 1'''
#     if type(value) is tuple and value[0] in ('long', 'double'):
#         return 2
#     else:
#         return 1


import struct
from pyjvm.bytecode import bytecode
from pyjvm.jassert import jassert_ref
from pyjvm.thread import SkipThreadCycle
from pyjvm.utils import category_type
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
'''Java bytecode implementation'''




@bytecode(code=0x57)
def pop(frame):
    value = frame.stack.pop()
    assert category_type(value) == 1


@bytecode(code=0x58)
def pop2(frame):
    value = frame.stack.pop()
    if category_type(value) == 2:
        pass
    else:
        value = frame.stack.pop()
        assert category_type(value) == 1



# Path: pyjvm/bytecode.py
# def bytecode(code):
#     def cl(func):
#         BYTECODE[hex(code)] = func
#         return func
# 
#     return cl
# 
# Path: pyjvm/jassert.py
# def jassert_ref(ref):
#     assert ref is None or (type(ref) is tuple and ref[0] in ("ref", "vm_ref"))
# 
# Path: pyjvm/thread.py
# class SkipThreadCycle(Exception):
#     '''Thread may skip his execution quota in case when a monitor
#     is busy or sleep was called
#     '''
#     pass
# 
# Path: pyjvm/utils.py
# def category_type(value):
#     '''Get category type of a variable according to jdk specs
# 
#     long, double are 2, others are 1'''
#     if type(value) is tuple and value[0] in ('long', 'double'):
#         return 2
#     else:
#         return 1


# Path: pyjvm/ops/ops_misc.py
import struct
from pyjvm.bytecode import bytecode
from pyjvm.jassert import jassert_ref
from pyjvm.thread import SkipThreadCycle
from pyjvm.utils import category_type

# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
'''Java bytecode implementation'''




@bytecode(code=0x57)
def pop(frame):
    value = frame.stack.pop()
    assert category_type(value) == 1


@bytecode(code=0x58)
def pop2(frame):
    value = frame.stack.pop()
    if category_type(value) == 2:
        pass
    else:
        value = frame.stack.pop()
        assert category_type(value) == 1



@bytecode(code=0x59)