def dreturn(frame): value = frame.stack.pop() logger.debug("To be returned {0}".format(value)) jassert_double(value) frame.ret = value frame.has_result = True frame.pc = len(frame.code) + 1
def dadd(frame): value2 = frame.stack.pop() value1 = frame.stack.pop() jassert_double(value1) jassert_double(value2) result = value1[1] + value2[1] frame.stack.append(("double", result))
def op_0x63(frame): # dadd value2 = frame.stack.pop() value1 = frame.stack.pop() jassert_double(value1) jassert_double(value2) result = value1[1] + value2[1] frame.stack.append(("double", result))
def dmul(frame): value2 = frame.stack.pop() value1 = frame.stack.pop() jassert_double(value1) jassert_double(value2) result = value1[1] * value2[1] frame.stack.append(("double", result))
def op_0x6f(frame): # ddiv value2 = frame.stack.pop() value1 = frame.stack.pop() jassert_double(value1) jassert_double(value2) if value2[1] == 0: frame.stack.append(("double", float("inf"))) return result = value1[1] / value2[1] frame.stack.append(("double", result))
def ddiv(frame): value2 = frame.stack.pop() value1 = frame.stack.pop() jassert_double(value1) jassert_double(value2) if value2[1] == 0: frame.stack.append(("double", float("inf"))) return result = value1[1] / value2[1] frame.stack.append(("double", result))
def op_0x98(frame): # dcmpl value2 = frame.stack.pop() value1 = frame.stack.pop() jassert_double(value1) jassert_double(value2) if value1[1] > value2[1]: frame.stack.append(1) elif value1 == value2: frame.stack.append(0) else: frame.stack.append(-1)
def dcmpl(frame): value2 = frame.stack.pop() value1 = frame.stack.pop() jassert_double(value1) jassert_double(value2) if value1[1] > value2[1]: frame.stack.append(1) elif value1 == value2: frame.stack.append(0) else: frame.stack.append(-1)
def d2i(frame): value = frame.stack.pop() jassert_double(value) if value[1] is None: frame.stack.append(0) else: if value[1] < -2147483648: # -1 * math.pow(2, 31) result = -2147483648 elif value[1] > 2147483647: # math.pow(2, 31) - 1 result = 2147483647 else: result = int(value[1]) jassert_int(result) frame.stack.append(result)
def d2l(frame): value = frame.stack.pop() jassert_double(value) if value[1] is None: frame.stack.append(("long", 0)) else: min_value = long(-1 * math.pow(2, 63)) max_value = long(math.pow(2, 63) - 1) if value[1] < min_value: result = min_value elif value[1] > max_value: result = max_value else: result = long(value[1]) jassert_long(("long", result)) frame.stack.append(("long", result))
def dastore(frame): value = frame.stack.pop() index = frame.stack.pop() ref = frame.stack.pop() jassert_double(value) jassert_int(index) if ref is None: frame.vm.raise_exception(frame, "java/lang/NullPointerException") return jassert_ref(ref) array = frame.vm.heap[ref[1]] jassert_array(array) values = array.values if index < 0 or index >= len(values): frame.vm.raise_exception(frame, "java/lang/ArrayIndexOutOfBoundsException") return values[index] = value
def op_0x26(frame): # dload_0 value = frame.args[0] jassert_double(value) frame.stack.append(value)
def op_0x18(frame): # dload index = ord(frame.code[frame.pc]) frame.pc += 1 value = frame.args[index] jassert_double(value) frame.stack.append(value)
def d2f(frame): value = frame.stack.pop() jassert_double(value) frame.stack.append(("float", value[1]))
def op_0x76(frame): # fneg value = frame.stack.pop() jassert_double(value) result = value[1] * -1 frame.stack.append(("float", result))
def op_0x29(frame): # dload_3 value = frame.args[3] jassert_double(value) frame.stack.append(value)
def dneg(frame): value = frame.stack.pop() jassert_double(value) result = value[1] * -1 frame.stack.append(("double", result))
def op_0x49(frame): # dstore_2 value = frame.stack.pop() jassert_double(value) frame.args[2] = value
def op_0x47(frame): # dstore_0 value = frame.stack.pop() jassert_double(value) frame.args[0] = value
def op_0x90(frame): # d2f value = frame.stack.pop() jassert_double(value) frame.stack.append(("float", value[1]))
def op_0x27(frame): # dload_1 value = frame.args[1] jassert_double(value) frame.stack.append(value)
def dstore(frame): index = ord(frame.code[frame.pc]) frame.pc += 1 value = frame.stack.pop() jassert_double(value) frame.args[index] = value
def op_0x28(frame): # dload_2 value = frame.args[2] jassert_double(value) frame.stack.append(value)
def dstore_3(frame): value = frame.stack.pop() jassert_double(value) frame.args[3] = value
def op_0x39(frame): # dstore index = ord(frame.code[frame.pc]) frame.pc += 1 value = frame.stack.pop() jassert_double(value) frame.args[index] = value
def op_0x77(frame): # dneg value = frame.stack.pop() jassert_double(value) result = value[1] * -1 frame.stack.append(("double", result))
def op_0x48(frame): # dstore_1 value = frame.stack.pop() jassert_double(value) frame.args[1] = value
def dload(frame): index = ord(frame.code[frame.pc]) frame.pc += 1 value = frame.args[index] jassert_double(value) frame.stack.append(value)
def op_0x4a(frame): # dstore_3 value = frame.stack.pop() jassert_double(value) frame.args[3] = value
def dload_3(frame): value = frame.args[3] jassert_double(value) frame.stack.append(value)