Quickfix N2

This commit is contained in:
Ilmir Usmanov
2014-08-12 22:48:24 +04:00
parent 6f41c1c59b
commit 2e1da4cae5
11 changed files with 28 additions and 28 deletions
+1 -1
View File
@@ -145,7 +145,7 @@ dump_variable (T_IDX id)
__printf ("'%s'", deserialize_string_by_id (opcode.data.op.op2)); \ __printf ("'%s'", deserialize_string_by_id (opcode.data.op.op2)); \
__printf (": STRING"); \ __printf (": STRING"); \
} else if (opcode.data.op.type_value_right == OPCODE_ARG_TYPE_NUMBER) {\ } else if (opcode.data.op.type_value_right == OPCODE_ARG_TYPE_NUMBER) {\
__printf ("%d", deserialize_num_by_id (opcode.data.op.op2)); \ __printf ("%d", (int) deserialize_num_by_id (opcode.data.op.op2)); \
__printf (": NUMBER"); \ __printf (": NUMBER"); \
} else if (opcode.data.op.type_value_right == OPCODE_ARG_TYPE_SMALLINT) {\ } else if (opcode.data.op.type_value_right == OPCODE_ARG_TYPE_SMALLINT) {\
__printf ("%d", opcode.data.op.op2); \ __printf ("%d", opcode.data.op.op2); \
@@ -40,7 +40,7 @@ main( int __unused argc,
const char *strings[] = { "a", const char *strings[] = { "a",
"b" }; "b" };
int nums [] = { 2 }; ecma_number_t nums [] = { 2.0 };
uint16_t offset = serializer_dump_strings( strings, 2); uint16_t offset = serializer_dump_strings( strings, 2);
serializer_dump_nums( nums, 1, offset, 2); serializer_dump_nums( nums, 1, offset, 2);
+1 -1
View File
@@ -45,7 +45,7 @@ main( int __unused argc,
const char *strings[] = { "a", const char *strings[] = { "a",
"b" }; "b" };
int nums [] = { 2 }; ecma_number_t nums [] = { 2.0 };
uint16_t offset = serializer_dump_strings( strings, 2); uint16_t offset = serializer_dump_strings( strings, 2);
serializer_dump_nums( nums, 1, offset, 2); serializer_dump_nums( nums, 1, offset, 2);
+1 -1
View File
@@ -40,7 +40,7 @@ main( int __unused argc,
const char *strings[] = { "a", const char *strings[] = { "a",
"b" }; "b" };
int nums [] = { 2 }; ecma_number_t nums [] = { 2 };
uint16_t offset = serializer_dump_strings( strings, 2); uint16_t offset = serializer_dump_strings( strings, 2);
serializer_dump_nums( nums, 1, offset, 2); serializer_dump_nums( nums, 1, offset, 2);
+1 -1
View File
@@ -40,7 +40,7 @@ main( int __unused argc,
const char *strings[] = { "a", const char *strings[] = { "a",
"b" }; "b" };
int nums [] = { 2 }; ecma_number_t nums [] = { 2 };
uint16_t offset = serializer_dump_strings( strings, 2); uint16_t offset = serializer_dump_strings( strings, 2);
serializer_dump_nums( nums, 1, offset, 2); serializer_dump_nums( nums, 1, offset, 2);
+1 -1
View File
@@ -48,7 +48,7 @@ main( int __unused argc,
const char *strings[] = { "a", const char *strings[] = { "a",
"b" }; "b" };
int nums [] = { 2 }; ecma_number_t nums [] = { 2 };
serializer_init (true); serializer_init (true);
uint16_t offset = serializer_dump_strings (strings, 2); uint16_t offset = serializer_dump_strings (strings, 2);
serializer_dump_nums (nums, 1, offset, 2); serializer_dump_nums (nums, 1, offset, 2);
+18 -18
View File
@@ -33,7 +33,7 @@ main( int __unused argc,
char __unused **argv) char __unused **argv)
{ {
const char *strings[MAX_STRINGS]; const char *strings[MAX_STRINGS];
int32_t nums[MAX_NUMS]; ecma_number_t nums[MAX_NUMS];
uint8_t strings_num, nums_count; uint8_t strings_num, nums_count;
uint16_t offset; uint16_t offset;
const OPCODE *opcodes; const OPCODE *opcodes;
@@ -62,32 +62,32 @@ main( int __unused argc,
opcodes = deserialize_bytecode (); opcodes = deserialize_bytecode ();
serializer_print_opcodes (); serializer_print_opcodes ();
if (!opcodes_equal (opcodes, (OPCODE[]) { if (!opcodes_equal (opcodes, (OPCODE[]) {
[0] = getop_reg_var_decl (5, 8), // var tmp5 .. tmp8; [0] = getop_reg_var_decl (2, 5), // var tmp2 .. tmp5;
[1] = getop_var_decl (0), // var i; [1] = getop_var_decl (0), // var i;
[2] = getop_var_decl (1), // var j; [2] = getop_var_decl (1), // var j;
[3] = getop_assignment (5, 2, 2), // tmp5 = 0; [3] = getop_assignment (2, 1, 0), // tmp2 = 0;
[4] = getop_assignment (0, 4, 5), // i = tmp5; [4] = getop_assignment (0, 4, 2), // i = tmp2;
[5] = getop_assignment (7, 2, 4), // tmp7 = 10; [5] = getop_assignment (4, 1, 10),// tmp4 = 10;
[6] = getop_less_than (6, 0, 7), // tmp6 = i < tmp7; [6] = getop_less_than (3, 0, 4), // tmp3 = i < tmp4;
[7] = getop_is_false_jmp (6, 14), // if (!tmp6) goto 14; [7] = getop_is_false_jmp (3, 14), // if (!tmp3) goto 14;
[8] = getop_jmp_down (3), // goto 11; [8] = getop_jmp_down (3), // goto 11;
[9] = getop_post_incr (8, 0), // tmp8 = i ++; [9] = getop_post_incr (5, 0), // tmp5 = i ++;
[10] = getop_jmp_up (5), // goto 5; [10] = getop_jmp_up (5), // goto 5;
[11] = getop_assignment (5, 2, 4), // tmp5 = 10; [11] = getop_assignment (2, 1, 10),// tmp2 = 10;
[12] = getop_assignment (1, 4, 5), // j = tmp5; [12] = getop_assignment (1, 4, 2), // j = tmp2;
[13] = getop_jmp_up (5), // goto 8; [13] = getop_jmp_up (5), // goto 8;
[14] = getop_nop (), // ; [14] = getop_nop (), // ;
[15] = getop_assignment (5, 2, 2), // tmp5 = 0; [15] = getop_assignment (2, 1, 0), // tmp2 = 0;
[16] = getop_assignment (0, 4, 5), // i = tmp5; [16] = getop_assignment (0, 4, 2), // i = tmp2;
[17] = getop_assignment (7, 2, 4), // tmp7 = 10; [17] = getop_assignment (4, 1, 10),// tmp7 = 10;
[18] = getop_less_than (6, 0, 7), // tmp6 = i < tmp7; [18] = getop_less_than (3, 0, 4), // tmp3 = i < tmp7;
[19] = getop_is_false_jmp (6, 27), // if (!tmp6) goto 27; [19] = getop_is_false_jmp (3, 27), // if (!tmp3) goto 27;
[20] = getop_jmp_down (3), // goto 23; [20] = getop_jmp_down (3), // goto 23;
[21] = getop_post_incr (8, 0), // tmp8 = i ++; [21] = getop_post_incr (5, 0), // tmp5 = i ++;
[22] = getop_jmp_up (5), // goto 17; [22] = getop_jmp_up (5), // goto 17;
[23] = getop_nop (), // ; [23] = getop_nop (), // ;
[24] = getop_assignment (5, 2, 4), // tmp5 = 10; [24] = getop_assignment (2, 1, 10),// tmp2 = 10;
[25] = getop_assignment (1, 4, 5), // j = tmp5; [25] = getop_assignment (1, 4, 5), // j = tmp2;
[26] = getop_jmp_up (5), // goto 21; [26] = getop_jmp_up (5), // goto 21;
[27] = getop_exitval (0) // exit 0; [27] = getop_exitval (0) // exit 0;
}, 28)) }, 28))
+1 -1
View File
@@ -46,7 +46,7 @@ main( int __unused argc,
mem_init(); mem_init();
const char *strings[] = { "a", "b", "c", "use strict" }; const char *strings[] = { "a", "b", "c", "use strict" };
int nums [] = { 2 }; ecma_number_t nums [] = { 2 };
serializer_init (true); serializer_init (true);
uint16_t offset = serializer_dump_strings (strings, 4); uint16_t offset = serializer_dump_strings (strings, 4);
serializer_dump_nums (nums, 1, offset, 4); serializer_dump_nums (nums, 1, offset, 4);
+1 -1
View File
@@ -40,7 +40,7 @@ main( int __unused argc,
const char *strings[] = { "a", const char *strings[] = { "a",
"b" }; "b" };
int nums [] = { 2 }; ecma_number_t nums [] = { 2 };
uint16_t offset = serializer_dump_strings( strings, 2); uint16_t offset = serializer_dump_strings( strings, 2);
serializer_dump_nums( nums, 1, offset, 2); serializer_dump_nums( nums, 1, offset, 2);
+1 -1
View File
@@ -40,7 +40,7 @@ main( int __unused argc,
const char *strings[] = { "a", const char *strings[] = { "a",
"b" }; "b" };
int nums [] = { 2 }; ecma_number_t nums [] = { 2 };
uint16_t offset = serializer_dump_strings( strings, 2); uint16_t offset = serializer_dump_strings( strings, 2);
serializer_dump_nums( nums, 1, offset, 2); serializer_dump_nums( nums, 1, offset, 2);
@@ -38,7 +38,7 @@ main( int __unused argc,
const char *strings[] = { "a", const char *strings[] = { "a",
"b" }; "b" };
int nums [] = { 2 }; ecma_number_t nums [] = { 2 };
uint16_t offset = serializer_dump_strings( strings, 2); uint16_t offset = serializer_dump_strings( strings, 2);
serializer_dump_nums( nums, 1, offset, 2); serializer_dump_nums( nums, 1, offset, 2);