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