3

我在 BCEL 中将整数压入堆栈时遇到问题。我有一个方法_square的 someClass 即“ mathClass

    ilist = new InstructionList();
    ilist.append(InstructionConstants.ALOAD_0);
    ilist.append(new GETFIELD(findex));
   //I am trying to push some value using createLoad but it is not working 

     ilist.append(InstructionConstants.ALOAD_1);
    ilist.append(ifact.createInvoke("mathClass", _square, Type.INT,
       new Type[] { Type.INT }, Constants.INVOKEVIRTUAL));

谢谢

4

1 回答 1

1

我用

new InstructionList.append(new PUSH(constantPool,23));

push 方法用于将原始类型数据推送到堆栈上。

于 2011-06-06T05:29:13.080 回答