From 531567d8e7c1aac415477855e0f972006c24c301 Mon Sep 17 00:00:00 2001 From: Nevo Date: Thu, 18 Jun 2009 21:12:52 +0200 Subject: [PATCH] Implement LDC2_W bytecode --- src/interp/engine/interp_jem.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/interp/engine/interp_jem.c b/src/interp/engine/interp_jem.c index 257bf27..d0982fc 100644 --- a/src/interp/engine/interp_jem.c +++ b/src/interp/engine/interp_jem.c @@ -913,6 +913,23 @@ static int opc_getfield(struct intrp_ctx *ctx) } } +static int opc_ldc2_w(struct intrp_ctx *ctx) +{ + int idx; + ExecEnv *ee = ctx->ee; + + struct jem_state *jem = &ctx->jem; + idx = (jem->jecr & 0xffff); + + jam_dprintf("[OPC_LDC2_W] constant pool index %d\n", idx); + jem->operand.i = idx; + + //read long long from constant pool + uint64_t val = (uint64_t)CP_LONG(ctx->cp, DOUBLE_INDEX(jem)); + jam_dprintf("[OPC_LDC2_W] push constant %lld to stack\n", (long long)val); + return ostack_push_u64(ctx->frame->ostack, ctx->mb->max_stack, ctx->ostack, val); +} + static int opc_ldc_w_quick_jem(struct intrp_ctx *ctx) { struct jem_state *jem = &ctx->jem; @@ -1692,6 +1709,7 @@ static handler_fn *trap_handler_f[256] = { // [OPC_LDC_QUICK] = opc_ldc_quick, [OPC_LDC_W] = opc_ldc_w, [OPC_LDC] = opc_ldc, + [OPC_LDC2_W] = opc_ldc2_w, [OPC_MONITORENTER] = opc_monitorenter, [OPC_MONITOREXIT] = opc_monitorexit, [OPC_GETSTATIC] = opc_getstatic, -- 2.11.4.GIT