m4_define([:m4svm_header:], [:m4svm_on(0)m4_dnl ; ------------------------------------------------------------------------- ; File: BytecodeVerification.j ; Author: Christian Arcand, 2003 ; Purpose: testing each bytecode instruction ; ------------------------------------------------------------------------- .class public classes.Test.BytecodeVerification .super java/lang/Object ; ; standard initializer .method public ()V .limit stack 1 .limit locals 1 aload_0 invokenonvirtual java/lang/Object/()V return .end method ; ; main method ;.method public static main([Ljava/lang/String;)V ; .limit stack 0 ; .limit locals 1 ; ; return ;.end method m4svm_off():]) m4_define([:m4svm_method_name:], [:[:[::]m4_ifelse( m4_substr($:][:1, 0, 2), ba, $:][:1_[::]m4svm_type(m4_substr($:][:4, 0, 1)), m4_substr($:][:1, 0, 3), ldc, $:][:1_[::]m4_ifelse( m4_substr($:][:4, 0, 1), L, String, m4svm_type(m4_substr($:][:4, 0, 1))), m4_substr($:][:1, 0, 3), get, $:][:1_[::]m4svm_type(m4_substr($:][:4, 0, 1)), $:][:1, newarray, $:][:1_$:][:5, $:][:1, multianewarray, $:][:1_[::]m4svm_type(m4_substr($:][:4, 2, 1)), m4_substr($:][:1, 0, 3), put, $:][:1_[::]m4svm_type(m4_substr($:][:4, 0, 1)), $:][:1):]:]) m4_define([:m4svm_type:], [:[:[::]m4_ifelse( $1, B, byte, $1, C, char, $1, D, double, $1, F, float, $1, I, int, $1, J, long, $1, L, object, $1, S, short, $1, Z, boolean, $1, [, array, String):]:]) m4_define([:m4svm_arglist:], [:[:m4svm_for([:arg:], 6, $:][:#, :]m4svm_lbkt[:m4svm_argn(arg, $:][:@)m4_dnl :]m4svm_rbkt[:):]:]) m4_define([:m4svm_parameters:], [:[:m4_ifelse($:][:1, iinc, , $:][:1, dup, [: iload_1 iload_0:], $:][:1, dup_x1, [: iload_1 iload_1 iload_0:], $:][:1, dup_x2, [: iload_1 iload_1 iload_1 iload_0:], $:][:1, dup2, [: iload_2 lload_0:], $:][:1, dup2_x1, [: iload_3 iload_2 lload_0:], $:][:1, dup2_x2, [: iload 4 lload_2 lload_0:], m4_substr($:][:1, 1, 4), load, , m4_substr($:][:1, 6, 4), load, , m4_substr($:][:1, 0, 11), wide_dstore, m4_ifelse( m4_substr($:][:1, 12, 1), 3, [: wide dload_0:], m4_substr($:][:1, 12, 1), 2, [: wide dload_0:], m4_substr($:][:1, 12, 1), 1, [: wide dload_3:], [: wide dload_2:]), m4_substr($:][:1, 0, 11), wide_lstore, m4_ifelse( m4_substr($:][:1, 12, 1), 3, [: wide lload_0:], m4_substr($:][:1, 12, 1), 2, [: wide lload_0:], m4_substr($:][:1, 12, 1), 1, [: wide lload_3:], [: wide lload_2:]), m4_substr($:][:1, 6, 7), store_0, [: wide m4_substr(:]$:][:1[:, 5, 1)load_1:], m4_substr($:][:1, 6, 5), store, [: wide m4_substr(:]$:][:1[:, 5, 1)load_0:], m4_substr($:][:1, 0, 6), dstore, m4_ifelse( m4_substr($:][:1, 7, 1), 3, [: dload_0:], m4_substr($:][:1, 7, 1), 2, [: dload_0:], m4_substr($:][:1, 7, 1), 1, [: dload_3:], [: dload_2:]), m4_substr($:][:1, 0, 6), lstore, m4_ifelse( m4_substr($:][:1, 7, 1), 3, [: lload_0:], m4_substr($:][:1, 7, 1), 2, [: lload_0:], m4_substr($:][:1, 7, 1), 1, [: lload_3:], [: lload_2:]), m4_substr($:][:1, 1, 7), store_0, [: m4_substr(:]$:][:1[:, 0, 1)load_1:], m4_substr($:][:1, 1, 5), store, [: m4_substr(:]$:][:1[:, 0, 1)load_0:], $:][:1, wide_iinc, , m4svm_for([:param:], 6, $:][:#, m4_dnl m4_ifdef([:local_var:],,m4_define([:local_var:], m4_eval(0))) m4_dnl :]m4svm_lbkt[:m4_ifelse( m4svm_argn(param, $:][:@), I, [: i:], m4svm_argn(param, $:][:@), F, [: f:], m4svm_argn(param, $:][:@), J, [: l:], m4svm_argn(param, $:][:@), D, [: d:], m4svm_argn(param, $:][:@), B, [: i:], m4svm_argn(param, $:][:@), C, [: i:], m4svm_argn(param, $:][:@), S, [: i:], m4svm_argn(param, $:][:@), Z, [: i:], [: a:])load local_var m4_ifelse( m4svm_argn(:]param[:, $:][:@), J, [:m4_pushdef([:local_var:], m4_eval(local_var + 2)):], m4svm_argn(:]param[:, $:][:@), D, [:m4_pushdef([:local_var:], m4_eval(local_var + 2)):], [:m4_pushdef([:local_var:], m4_eval(local_var + 1)):]):]m4svm_rbkt[:)m4_undefine([:local_var:])):]:]) m4_define([:m4svm_finalizing_operations:], [:[:m4_ifelse( $:][:1, checkcast, [: pop bipush 1:], $:][:1, iinc, [:1 iload_0:], $:][:1, dup, [: iload_0 if_icmpne notOk1 iload_0 if_icmpne notOk2 pop bipush 1 ireturn notOk1: pop notOk2: bipush 0:], $:][:1, dup_x1, [: iload_0 if_icmpne notOk1 iload_1 if_icmpne notOk2 iload_0 if_icmpne notOk3 pop bipush 1 ireturn notOk1: pop notOk2: pop notOk3: bipush 0:], $:][:1, dup_x2, [: iload_0 if_icmpne notOk1 iload_1 if_icmpne notOk2 iload_1 if_icmpne notOk3 iload_0 if_icmpne notOk4 pop bipush 1 ireturn notOk1: pop notOk2: pop notOk3: pop notOk4: bipush 0:], $:][:1, dup2, [: lload_0 lcmp ifne notOk1 lload_0 lcmp ifne notOk2 pop bipush 1 ireturn notOk1: pop2 notOk2: bipush 0:], $:][:1, dup2_x1, [: lload_0 lcmp ifne notOk1 iload_2 if_icmpne notOk2 lload_0 lcmp ifne notOk3 pop bipush 1 ireturn notOk1: pop notOk2: pop2 notOk3: bipush 0:], $:][:1, dup2_x2, [: lload_0 lcmp ifne notOk1 lload_2 lcmp ifne notOk2 lload_0 lcmp ifne notOk3 pop bipush 1 ireturn notOk1: pop2 notOk2: pop2 notOk3: bipush 0:], $:][:1, lookupswitch, [: 0 : label1 1 : label2 default : label3 label1: bipush 1 ireturn label2: bipush 0 ireturn label3: bipush -1:], $:][:1, putfield, [: aload_0 getfield :]$:][:5[::], $:][:1, putstatic, [: getstatic :]$:][:5[::], m4_substr($:][:1, 0, 4), goto, [: bipush 0 ireturn label1: bipush 1:], m4_substr($:][:1, 0, 2), if, [: bipush 0 ireturn label1: bipush 1:], $:][:1, monitorenter, [: aload_0 monitorexit aload_0:], $:][:1, new, [: dup invokenonvirtual java/lang/Object/()V:], $:][:1, tableswitch, [: label1 label2 default : label3 label1: bipush 1 ireturn label2: bipush 0 ireturn label3: bipush -1:], $:][:1, wide_iinc, [:1 wide iload_0:], m4_substr($:][:1, 6, 6), store_, [: wide m4_substr(:]$:][:1[:, 5, 1)load_[::]m4_substr(:]$:][:1[:, 12, 1):], m4_substr($:][:1, 0, 11), wide_dstore, [: wide dload_0:], m4_substr($:][:1, 0, 11), wide_lstore, [: wide lload_0:], m4_substr($:][:1, 6, 5), store, [: wide m4_substr(:]$:][:1[:, 5, 1)load_1:], m4_substr($:][:1, 1, 6), store_, [: m4_substr(:]$:][:1[:, 0, 1)load_[::]m4_substr(:]$:][:1[:, 7, 1):], m4_substr($:][:1, 0, 6), dstore, [: dload_0:], m4_substr($:][:1, 0, 6), lstore, [: lload_0:], m4_substr($:][:1, 1, 5), store, [: m4_substr(:]$:][:1[:, 0, 1)load_1:], m4_substr($:][:1, 1, 6), astore, [: aload 0 iload 1 m4_substr(:]$:][:1[:, 0, 1)aload:]):]:]) m4_define([:m4svm_return_type:], [:[:m4_ifelse( $:][:4, B, i, $:][:4, C, i, $:][:4, S, i, $:][:4, Z, i, $:][:4, V, , $:][:4, I, i, $:][:4, F, f, $:][:4, J, l, $:][:4, D, d, a):]:])