title: Create new object using ASM
body: <p>I have been trying to use ASM framework to inject bytecode at my interested location and I have been successful till now.Currently I am trying to inject code which basically creates a new instance/object of a class and after reading a bit I found that this can be achieved using INVOKESPECIAL (I hope my understanding was right of INVOKESPECIAL "INVOKESPECIAL for private methods and constructors").</p>
  
  <p>Below is the code snippet I used to create instance </p>
  
  <pre><code>visitor.visitLdcInsn(System.currentTimeMillis());
  visitor.visitLdcInsn(System.currentTimeMillis());
  visitor.visitLdcInsn(_type);
  visitor.visitVarInsn(ALOAD, metanamevarindex);
  
  eventObject = newLocal(Type.getType("com/vish/RequestTrackerEvent"));
  
  visitor.visitMethodInsn(Opcodes.INVOKESPECIAL, "com/vish/RequestTrackerEvent", "&lt;init&gt;",
                              "(JJLjava/lang/String;Ljava/lang/String;)V");
  
  visitor.visitVarInsn(ASTORE, eventObject);
  </code></pre>
  
  <p>The constructor of the class takes in 4 arguments (long,long,String,String) 
  But whenever I do this I get an exception like below</p>
  
  <pre><code>java.lang.VerifyError: JVMVRFY036 stack underflow;
      at java.lang.J9VMInternals.verifyImpl(Native Method)
      at java.lang.J9VMInternals.verify(J9VMInternals.java:72)
      at java.lang.J9VMInternals.verify(J9VMInternals.java:70)
      at java.lang.J9VMInternals.initialize(J9VMInternals.java:134)
  </code></pre>
  
  <p>Can anyone help me in understanding whether my usage/understanding of INVOKESPECIAL is right, if right then where am I doing wrong?</p>
  
  <p>Thanks</p>