# Path: pyjvm/bytecode.py
# def bytecode(code):
#     def cl(func):
#         BYTECODE[hex(code)] = func
#         return func
# 
#     return cl
# 
# Path: pyjvm/jassert.py
# def jassert_array(array):
#     assert array is None or isinstance(array, JArray)
# 
# Path: pyjvm/jassert.py
# def jassert_float(value):
#     assert type(value) is tuple and value[0] == "float"
# 
# Path: pyjvm/jassert.py
# def jassert_double(value):
#     assert type(value) is tuple and value[0] == "double"
# 
# Path: pyjvm/jassert.py
# def jassert_int(value):
#     assert type(value) is int or type(value) is long
#     assert -2147483648 <= value <= 2147483647
# 
# Path: pyjvm/jassert.py
# def jassert_long(value):
#     assert type(value) is tuple and value[0] == "long"
#     assert -9223372036854775808 <= value[1] <= 9223372036854775807
# 
# 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/jvmo.py
# class JArray(object):
#     '''Java array
# 
#     Lives in heap and has corresponding java_class
#     '''
#     def __init__(self, jc, vm):
#         self.java_class = jc
#         self.fields = {}
#         self.values = []


import logging
from pyjvm.bytecode import bytecode
from pyjvm.jassert import jassert_array
from pyjvm.jassert import jassert_float
from pyjvm.jassert import jassert_double
from pyjvm.jassert import jassert_int
from pyjvm.jassert import jassert_long
from pyjvm.jassert import jassert_ref
from pyjvm.jvmo import JArray
    klass_name = frame.this_class.constant_pool[cp_item[1]][1]
    while klass_name[0] == '[':
        klass_name = klass_name[1:]

    counts = []
    for i in range(dims):
        counts.insert(0, frame.stack.pop())

    def mla(counts, klass_name):
        if len(counts) == 1:
            if klass_name in ('B', 'C', 'I', 'S', 'Z'):
                default = 0
            elif klass_name == 'D':
                default = ('double', 0.0)
            elif klass_name == 'F':
                default = ('float', 0.0)
            elif klass_name == 'J':
                default = ('long', 0)
            elif klass_name[0] == 'L':
                default = None
            array_class = frame.vm.get_class('[' + klass_name)
            array = JArray(array_class, frame.vm)
            values = [default] * counts[0]
            array.values = values
            ref = frame.vm.add_to_heap(array)
            return ref
        else:
            name = '[' * len(counts)
            name += klass_name
            array_class = frame.vm.get_class(name)

# Path: pyjvm/bytecode.py
# def bytecode(code):
#     def cl(func):
#         BYTECODE[hex(code)] = func
#         return func
# 
#     return cl
# 
# Path: pyjvm/jassert.py
# def jassert_array(array):
#     assert array is None or isinstance(array, JArray)
# 
# Path: pyjvm/jassert.py
# def jassert_float(value):
#     assert type(value) is tuple and value[0] == "float"
# 
# Path: pyjvm/jassert.py
# def jassert_double(value):
#     assert type(value) is tuple and value[0] == "double"
# 
# Path: pyjvm/jassert.py
# def jassert_int(value):
#     assert type(value) is int or type(value) is long
#     assert -2147483648 <= value <= 2147483647
# 
# Path: pyjvm/jassert.py
# def jassert_long(value):
#     assert type(value) is tuple and value[0] == "long"
#     assert -9223372036854775808 <= value[1] <= 9223372036854775807
# 
# 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/jvmo.py
# class JArray(object):
#     '''Java array
# 
#     Lives in heap and has corresponding java_class
#     '''
#     def __init__(self, jc, vm):
#         self.java_class = jc
#         self.fields = {}
#         self.values = []


# Path: pyjvm/ops/ops_arrays.py
import logging
from pyjvm.bytecode import bytecode
from pyjvm.jassert import jassert_array
from pyjvm.jassert import jassert_float
from pyjvm.jassert import jassert_double
from pyjvm.jassert import jassert_int
from pyjvm.jassert import jassert_long
from pyjvm.jassert import jassert_ref
from pyjvm.jvmo import JArray

    klass_name = frame.this_class.constant_pool[cp_item[1]][1]
    while klass_name[0] == '[':
        klass_name = klass_name[1:]

    counts = []
    for i in range(dims):
        counts.insert(0, frame.stack.pop())

    def mla(counts, klass_name):
        if len(counts) == 1:
            if klass_name in ('B', 'C', 'I', 'S', 'Z'):
                default = 0
            elif klass_name == 'D':
                default = ('double', 0.0)
            elif klass_name == 'F':
                default = ('float', 0.0)
            elif klass_name == 'J':
                default = ('long', 0)
            elif klass_name[0] == 'L':
                default = None
            array_class = frame.vm.get_class('[' + klass_name)
            array = JArray(array_class, frame.vm)
            values = [default] * counts[0]
            array.values = values
            ref = frame.vm.add_to_heap(array)
            return ref
        else:
            name = '[' * len(counts)
            name += klass_name
            array_class = frame.vm.get_class(name)

            array = JArray(array_class, frame.vm)