Example #1
0
 private static void genLongHashCode(MethodVisitor mv, InstructionAdapter iv) {
   iv.dup2();
   iv.iconst(32);
   iv.ushr(Type.LONG_TYPE);
   iv.xor(Type.LONG_TYPE);
   mv.visitInsn(L2I);
 }
Example #2
0
  private void generateStaticInitializer() {
    if (staticInitializerChunks.size() > 0) {
      MethodVisitor mv = v.newMethod(null, ACC_PUBLIC | ACC_STATIC, "<clinit>", "()V", null, null);
      if (state.getClassBuilderMode() == ClassBuilderMode.FULL) {
        mv.visitCode();

        InstructionAdapter v = new InstructionAdapter(mv);

        for (CodeChunk chunk : staticInitializerChunks) {
          chunk.generate(v);
        }

        mv.visitInsn(RETURN);
        FunctionCodegen.endVisit(v, "static initializer", myClass);
      }
    }
  }
 public static JetValueParameterAnnotationWriter visitParameterAnnotation(
     MethodVisitor mv, int n) {
   return new JetValueParameterAnnotationWriter(
       mv.visitParameterAnnotation(n, JvmStdlibNames.JET_VALUE_PARAMETER.getDescriptor(), true));
 }
Example #4
0
 public static void genMethodThrow(MethodVisitor mv, String exception, String message) {
   mv.visitCode();
   genThrow(mv, exception, message);
   mv.visitMaxs(-1, -1);
   mv.visitEnd();
 }