summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d079335)
raw | patch | inline | side by side (parent: d079335)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Wed, 8 Mar 2017 11:06:41 +0000 (14:06 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Wed, 8 Mar 2017 11:06:41 +0000 (14:06 +0300) |
mpc/structures/block.c | patch | blob | history |
diff --git a/mpc/structures/block.c b/mpc/structures/block.c
index 1b55eeae2479366bf16c2474d8e1981b4ad7c303..0922765234cdd4ea50d81deb0b5c99e33bff40c4 100644 (file)
--- a/mpc/structures/block.c
+++ b/mpc/structures/block.c
/* create the code */
bytecode_append(code, invokestatic$);
bytecode_append_short_int(code, cp_add_methodref("M", "R", "()V"));
-
- bytecode_append(code, goto$);
- bytecode_append_short_int(code, 4);
-
- bytecode_append(code, pop$); /* the exception handler */
-
bytecode_append(code, return$);
/* write the method headers */
/* write the Code attribute */
write_short_int(fp, cp_add_utf8("Code"));
- write_long_int(fp, code->bytecode_pos + 20 + 38); /* 38 = stackmap size */
+ write_long_int(fp, code->bytecode_pos + 12);
/* write the max stack */
write_short_int(fp, 2);
/* max locals for program block */
- write_short_int(fp, 1);
+ write_short_int(fp, 2);
+
/* code length */
write_long_int(fp, code->bytecode_pos);
bytecode_destroy(code);
- /* write exception table length*/
- write_short_int(fp, 1);
-
- /* write the exception table */
write_short_int(fp, 0);
- write_short_int(fp, 3);
- write_short_int(fp, 6);
- write_short_int(fp, cp_add_class("java/lang/Exception"));
-
-
- /* StackMap attribute */
- write_short_int(fp, 1);
-
- write_short_int(fp, cp_add_utf8("StackMap"));
- write_long_int(fp, 32);
-
- /* 2 frames*/
- write_short_int(fp, 3);
-
- /* write the frame 0 */
- write_short_int(fp, 0);
-
- /* write the locals */
- write_short_int(fp, 1);
- tag = 7;
- if (fp != NULL)
- fwrite(&tag, 1, 1, fp);
- write_short_int(fp, cp_add_class("M"));
-
-
- /* 0 stack entries */
- write_short_int(fp, 0);
-
- /* write the frame 1 */
- write_short_int(fp, 6);
-
- /* write the locals*/
- write_short_int(fp, 1);
- tag = 7;
- if (fp != NULL)
- fwrite(&tag, 1, 1, fp);
- write_short_int(fp, cp_add_class("M"));
-
- /* 1 stack entry */
- write_short_int(fp, 1);
- tag = 7;
- if (fp != NULL)
- fwrite(&tag, 1, 1, fp);
- write_short_int(fp, cp_add_class("java/lang/Exception"));
-
-
- /* write the frame 2 */
- write_short_int(fp, 7);
-
- /* write the locals */
- write_short_int(fp, 1);
- tag = 7;
- if (fp != NULL)
- fwrite(&tag, 1, 1, fp);
- write_short_int(fp, cp_add_class("M"));
-
- /* 0 stack entries */
- write_short_int(fp, 0);
-
+ write_short_int(fp, 0);
}