Question

Je suis confronté à un problème dans le contexte de poussant un entier sur la pile dans BCEL . J'ai une méthode _square de soméclasse, c'est-à-dire "< 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));

merci

Était-ce utile?

La solution

J'utilise

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

La méthode de la poussée utilise pour appuyer sur les données de type primitif sur la pile.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top