@@ -95,23 +95,22 @@ tmp_id_to_str (vm_idx_t id)
95
95
static const char *
96
96
var_to_str (vm_instr_t instr, lit_cpointer_t lit_ids[], vm_instr_counter_t oc, uint8_t current_arg)
97
97
{
98
- raw_instr raw = *(raw_instr*) &instr;
99
- if (raw.uids [current_arg] == VM_IDX_REWRITE_LITERAL_UID)
98
+ JERRY_ASSERT (current_arg >= 1 && current_arg <= 3 );
99
+
100
+ if (instr.data .raw_args [current_arg - 1 ] == VM_IDX_REWRITE_LITERAL_UID)
100
101
{
101
- if (lit_ids == NULL )
102
- {
103
- return " hz" ;
104
- }
102
+ JERRY_ASSERT (lit_ids != NULL );
105
103
JERRY_ASSERT (lit_ids[current_arg - 1 ].packed_value != MEM_CP_NULL);
104
+
106
105
return lit_cp_to_str (lit_ids[current_arg - 1 ]);
107
106
}
108
- else if (raw. uids [current_arg] >= 128 )
107
+ else if (instr. data . raw_args [current_arg - 1 ] >= 128 )
109
108
{
110
- return tmp_id_to_str (raw. uids [current_arg]);
109
+ return tmp_id_to_str (instr. data . raw_args [current_arg - 1 ]);
111
110
}
112
111
else
113
112
{
114
- return lit_cp_to_str (serializer_get_literal_cp_by_uid (raw. uids [current_arg], NULL , oc));
113
+ return lit_cp_to_str (serializer_get_literal_cp_by_uid (instr. data . raw_args [current_arg - 1 ], NULL , oc));
115
114
}
116
115
}
117
116
@@ -134,14 +133,12 @@ pp_printf (const char *format, vm_instr_t instr, lit_cpointer_t lit_ids[], vm_in
134
133
{
135
134
case ' d' :
136
135
{
137
- JERRY_ASSERT (current_arg <= 3 );
138
- raw_instr raw = *(raw_instr*) &instr;
139
- printf (" %d" , raw.uids [current_arg]);
136
+ JERRY_ASSERT (current_arg >= 1 && current_arg <= 3 );
137
+ printf (" %d" , instr.data .raw_args [current_arg - 1 ]);
140
138
break ;
141
139
}
142
140
case ' s' :
143
141
{
144
- JERRY_ASSERT (current_arg <= 3 );
145
142
printf (" %s" , var_to_str (instr, lit_ids, oc, current_arg));
146
143
break ;
147
144
}
@@ -159,8 +156,8 @@ pp_printf (const char *format, vm_instr_t instr, lit_cpointer_t lit_ids[], vm_in
159
156
#define PP_OP (op_name, format ) \
160
157
case op_name: pp_printf (format, opm.op, opm.lit_id, oc, 1 ); break ;
161
158
#define VAR (i ) var_to_str (opm.op, opm.lit_id, oc, i)
162
- #define OC (i, j ) __extension__({ raw_instr* raw = (raw_instr *) & opm.op ; \
163
- vm_calc_instr_counter_from_idx_idx (raw-> uids [i], raw-> uids [j ]); })
159
+ #define OC (i, j ) __extension__({ vm_calc_instr_counter_from_idx_idx ( opm.op . data . raw_args [i - 1 ], \
160
+ opm. op . data . raw_args [j - 1 ]); })
164
161
165
162
static int vargs_num = 0 ;
166
163
static int seen_vargs = 0 ;
@@ -174,7 +171,7 @@ dump_asm (vm_instr_counter_t oc, vm_instr_t instr)
174
171
175
172
for (i = 1 ; i <= opcode_sizes[opcode_id]; i++)
176
173
{
177
- printf (" %4d " , ((raw_instr *) & instr)-> uids [i ]);
174
+ printf (" %4d " , instr. data . raw_args [i - 1 ]);
178
175
}
179
176
180
177
for (; i < 4 ; i++)
0 commit comments