File Coverage

lib/SPVM/Builder/src/spvm_opcode_builder.c
Criterion Covered Total %
statement 2714 2878 94.3
branch 684 844 81.0
condition n/a
subroutine n/a
pod n/a
total 3398 3722 91.3


line stmt bran cond sub pod time code
1             // Copyright (c) 2023 Yuki Kimoto
2             // MIT License
3              
4             #include
5             #include
6             #include
7             #include
8             #include
9              
10              
11             #include "spvm_compiler.h"
12             #include "spvm_opcode_builder.h"
13             #include "spvm_opcode.h"
14             #include "spvm_opcode_list.h"
15             #include "spvm_constant.h"
16             #include "spvm_op.h"
17             #include "spvm_check.h"
18             #include "spvm_type.h"
19             #include "spvm_list.h"
20             #include "spvm_method.h"
21             #include "spvm_var.h"
22             #include "spvm_var_decl.h"
23             #include "spvm_allocator.h"
24             #include "spvm_field_access.h"
25             #include "spvm_call_method.h"
26             #include "spvm_hash.h"
27             #include "spvm_field.h"
28             #include "spvm_switch_info.h"
29             #include "spvm_type.h"
30             #include "spvm_object.h"
31             #include "spvm_class_var.h"
32             #include "spvm_class_var_access.h"
33             #include "spvm_dumper.h"
34             #include "spvm_opcode.h"
35             #include "spvm_block.h"
36             #include "spvm_basic_type.h"
37             #include "spvm_case_info.h"
38             #include "spvm_array_field_access.h"
39             #include "spvm_string.h"
40             #include "spvm_dumper.h"
41              
42 3119           void SPVM_OPCODE_BUILDER_build_opcode_list(SPVM_COMPILER* compiler) {
43            
44 48981 100         for (int32_t basic_type_id = compiler->basic_types_base_id; basic_type_id < compiler->basic_types->length; basic_type_id++) {
45 45862           SPVM_BASIC_TYPE* basic_type = SPVM_LIST_get(compiler->basic_types, basic_type_id);
46 45862           SPVM_LIST* methods = basic_type->methods;
47 334405 100         for (int32_t method_index = 0; method_index < methods->length; method_index++) {
48 288543           SPVM_METHOD* method = SPVM_LIST_get(methods, method_index);
49            
50 288543           SPVM_OPCODE_LIST* opcode_list = method->opcode_list;
51            
52 288543           int32_t method_opcodes_base_address_id = 0;
53            
54             // Check sub information
55 288543 50         assert(method->op_name);
56 288543 50         assert(method->return_type);
57 288543 50         assert(method->current_basic_type->class_file);
58            
59             // Copy arguments to variables
60 288543           int32_t stack_index = 0;
61 782772 100         for (int32_t args_index = 0; args_index < method->args_length; args_index++) {
62 494229           SPVM_VAR_DECL* arg = SPVM_LIST_get(method->var_decls, args_index);
63 494229           SPVM_TYPE* arg_type = arg->type;
64 494229           int32_t arg_type_dimension = arg->type->dimension;
65 494229           SPVM_BASIC_TYPE* arg_basic_type = arg_type->basic_type;
66 494229           int32_t arg_type_is_ref = SPVM_TYPE_is_ref_type(compiler, arg_basic_type->id, arg_type_dimension, arg_type->flag);
67 494229           int32_t arg_basic_type_category = arg_type->basic_type->category;
68            
69 494229           SPVM_OPCODE opcode = {0};
70            
71 494229           int32_t args_width = SPVM_TYPE_get_width(compiler, arg_type->basic_type->id, arg_type->dimension, arg_type->flag);
72              
73 494229 100         if (arg_type_dimension == 0) {
74 408717 100         if (arg_type_is_ref) {
75 2854 50         switch (arg_basic_type_category) {
76             case SPVM_NATIVE_C_BASIC_TYPE_CATEGORY_NUMERIC:
77             case SPVM_NATIVE_C_BASIC_TYPE_CATEGORY_MULNUM:
78             {
79 2854           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_STACK_REF);
80 2854           opcode.operand0 = arg->runtime_var_index;
81 2854           opcode.operand3 = stack_index & 0xFF;
82 2854           stack_index++;
83 2854           break;
84             }
85             default: {
86 2854           assert(0);
87             }
88             }
89             }
90             else {
91 405863           switch (arg_basic_type_category) {
92             case SPVM_NATIVE_C_BASIC_TYPE_CATEGORY_NUMERIC: {
93 204015           switch (arg_basic_type->id) {
94             case SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE: {
95 1201 100         if (arg->op_optional_arg_default) {
96 29           SPVM_CONSTANT* constant = arg->op_optional_arg_default->uv.constant;
97 29           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_STACK_OPTIONAL_BYTE);
98 29           opcode.operand1 = (uint16_t)(uint8_t)constant->value.bval;
99             }
100             else {
101 1172           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_STACK_BYTE);
102             }
103 1201           opcode.operand0 = arg->runtime_var_index;
104 1201           opcode.operand3 = stack_index & 0xFF;
105 1201           stack_index++;
106 1201           break;
107             }
108             case SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT: {
109 154 100         if (arg->op_optional_arg_default) {
110 28           SPVM_CONSTANT* constant = arg->op_optional_arg_default->uv.constant;
111 28           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_STACK_OPTIONAL_SHORT);
112 28           opcode.operand1 = (uint16_t)constant->value.sval;
113             }
114             else {
115 126           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_STACK_SHORT);
116             }
117 154           opcode.operand0 = arg->runtime_var_index;
118 154           opcode.operand3 = stack_index & 0xFF;
119 154           stack_index++;
120 154           break;
121             }
122             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT: {
123 180145 100         if (arg->op_optional_arg_default) {
124 55267           SPVM_CONSTANT* constant = arg->op_optional_arg_default->uv.constant;
125 55267           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_STACK_OPTIONAL_INT);
126 55267           opcode.operand1 = (uint32_t)constant->value.ival;
127             }
128             else {
129 124878           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_STACK_INT);
130             }
131 180145           opcode.operand0 = arg->runtime_var_index;
132 180145           opcode.operand3 = stack_index & 0xFF;
133 180145           stack_index++;
134 180145           break;
135             }
136             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG: {
137 9533 100         if (arg->op_optional_arg_default) {
138 30           SPVM_CONSTANT* constant = arg->op_optional_arg_default->uv.constant;
139 30           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_STACK_OPTIONAL_LONG);
140 30           *(int64_t*)&opcode.operand1 = constant->value.lval;
141             }
142             else {
143 9503           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_STACK_LONG);
144             }
145 9533           opcode.operand0 = arg->runtime_var_index;
146 9533           opcode.operand3 = stack_index & 0xFF;
147 9533           stack_index++;
148 9533           break;
149             }
150             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT: {
151 5968 100         if (arg->op_optional_arg_default) {
152 24           SPVM_CONSTANT* constant = arg->op_optional_arg_default->uv.constant;
153 24           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_STACK_OPTIONAL_FLOAT);
154 24           opcode.operand1 = (uint32_t)constant->value.ival;
155             }
156             else {
157 5944           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_STACK_FLOAT);
158             }
159 5968           opcode.operand0 = arg->runtime_var_index;
160 5968           opcode.operand3 = stack_index & 0xFF;
161 5968           stack_index++;
162 5968           break;
163             }
164             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE: {
165 7014 100         if (arg->op_optional_arg_default) {
166 24           SPVM_CONSTANT* constant = arg->op_optional_arg_default->uv.constant;
167 24           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_STACK_OPTIONAL_DOUBLE);
168 24           *(double*)&opcode.operand1 = constant->value.dval;
169             }
170             else {
171 6990           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_STACK_DOUBLE);
172             }
173 7014           opcode.operand0 = arg->runtime_var_index;
174 7014           opcode.operand3 = stack_index & 0xFF;
175 7014           stack_index++;
176 7014           break;
177             }
178             default: {
179 0           assert(0);
180             }
181             }
182 204015           break;
183             }
184             case SPVM_NATIVE_C_BASIC_TYPE_CATEGORY_MULNUM:
185             {
186 138           SPVM_FIELD* arg_mulnum_field = SPVM_LIST_get(arg_basic_type->fields, 0);
187 138           SPVM_TYPE* arg_mulnum_field_type = arg_mulnum_field->type;
188 138           SPVM_BASIC_TYPE* arg_mulnum_field_basic_type = arg_mulnum_field_type->basic_type;
189            
190 138           switch (arg_mulnum_field_basic_type->id) {
191             case SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE: {
192 18           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_STACK_MULNUM_BYTE);
193 18           break;
194             }
195             case SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT: {
196 18           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_STACK_MULNUM_SHORT);
197 18           break;
198             }
199             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT: {
200 18           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_STACK_MULNUM_INT);
201 18           break;
202             }
203             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG: {
204 18           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_STACK_MULNUM_LONG);
205 18           break;
206             }
207             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT: {
208 18           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_STACK_MULNUM_FLOAT);
209 18           break;
210             }
211             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE: {
212 48           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_STACK_MULNUM_DOUBLE);
213 48           break;
214             }
215             }
216 138           opcode.operand0 = arg->runtime_var_index;
217 138 50         assert(args_width < 0xFFFF);
218 138           opcode.operand3 = args_width << 8 | stack_index & 0xFF;
219 138           stack_index += args_width;
220 138           break;
221             }
222             case SPVM_NATIVE_C_BASIC_TYPE_CATEGORY_STRING:
223             case SPVM_NATIVE_C_BASIC_TYPE_CATEGORY_CLASS:
224             case SPVM_NATIVE_C_BASIC_TYPE_CATEGORY_INTERFACE:
225             case SPVM_NATIVE_C_BASIC_TYPE_CATEGORY_ANY_OBJECT:
226             {
227 201710 100         if (arg->op_optional_arg_default) {
228 1974           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_STACK_OPTIONAL_OBJECT);
229             }
230             else {
231 199736           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_STACK_OBJECT);
232             }
233 201710           opcode.operand0 = arg->runtime_var_index;
234 201710           opcode.operand3 = stack_index & 0xFF;
235 201710           stack_index++;
236 201710           break;
237             }
238             default: {
239 408717           assert(0);
240             }
241             }
242             }
243             }
244 85512 100         else if (arg_type_dimension == 1) {
245 85482 50         switch (arg_basic_type_category) {
246             case SPVM_NATIVE_C_BASIC_TYPE_CATEGORY_NUMERIC:
247             case SPVM_NATIVE_C_BASIC_TYPE_CATEGORY_MULNUM:
248             case SPVM_NATIVE_C_BASIC_TYPE_CATEGORY_STRING:
249             case SPVM_NATIVE_C_BASIC_TYPE_CATEGORY_CLASS:
250             case SPVM_NATIVE_C_BASIC_TYPE_CATEGORY_INTERFACE:
251             case SPVM_NATIVE_C_BASIC_TYPE_CATEGORY_ANY_OBJECT:
252             {
253 85482 100         if (arg->op_optional_arg_default) {
254 2185           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_STACK_OPTIONAL_OBJECT);
255             }
256             else {
257 83297           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_STACK_OBJECT);
258             }
259 85482           opcode.operand0 = arg->runtime_var_index;
260 85482           opcode.operand3 = stack_index & 0xFF;
261 85482           stack_index++;
262 85482           break;
263             }
264             default: {
265 85482           assert(0);
266             }
267             }
268             }
269 30 50         else if (arg_type_dimension == 2) {
270 30 100         if (arg->op_optional_arg_default) {
271 2           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_STACK_OPTIONAL_OBJECT);
272             }
273             else {
274 28           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_STACK_OBJECT);
275             }
276 30           opcode.operand0 = arg->runtime_var_index;
277 30           opcode.operand3 = stack_index & 0xFF;
278 30           stack_index++;
279             }
280             else {
281 0           assert(0);
282             }
283            
284 494229           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
285             }
286            
287             {
288 288543           SPVM_OPCODE opcode = {0};
289 288543           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_END_ARGS);
290 288543           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
291             }
292            
293 288543 100         if (method->is_native) {
294 65541           goto END_OF_FUNCTION;
295             }
296            
297 223002           SPVM_LIST* block_stack_runtime_var_index_top = SPVM_LIST_new(compiler->current_each_compile_allocator, 0, SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP);
298            
299 223002           SPVM_LIST* if_block_stack_goto_end_opcode_index = SPVM_LIST_new(compiler->current_each_compile_allocator, 0, SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP);
300            
301 223002           SPVM_LIST* loop_block_stack_goto_opcode_index = SPVM_LIST_new(compiler->current_each_compile_allocator, 0, SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP);
302            
303 223002           SPVM_LIST* loop_block_stack_next_base = SPVM_LIST_new(compiler->current_each_compile_allocator, 0, SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP);
304            
305 223002           SPVM_LIST* loop_block_stack_last_base = SPVM_LIST_new(compiler->current_each_compile_allocator, 0, SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP);
306            
307 223002           SPVM_LIST* switch_stack_switch_info = SPVM_LIST_new(compiler->current_each_compile_allocator, 0, SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP);
308            
309 223002           SPVM_LIST* switch_block_stack_break_base = SPVM_LIST_new(compiler->current_each_compile_allocator, 0, SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP);
310            
311 223002           SPVM_LIST* eval_block_stack_goto_opcode_index = SPVM_LIST_new(compiler->current_each_compile_allocator, 0, SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP);
312            
313 223002           SPVM_LIST* unresolved_if_eq_or_if_ne_opcode_index_stack = SPVM_LIST_new(compiler->current_each_compile_allocator, 0, SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP);
314            
315 223002           SPVM_LIST* unresolved_last_opcode_index_stack = SPVM_LIST_new(compiler->current_each_compile_allocator, 0, SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP);
316            
317 223002           SPVM_LIST* unresolved_break_opcode_index_stack = SPVM_LIST_new(compiler->current_each_compile_allocator, 0, SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP);
318            
319 223002           SPVM_LIST* unresolved_next_opcode_index_stack = SPVM_LIST_new(compiler->current_each_compile_allocator, 0, SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP);
320            
321 223002           SPVM_LIST* unresolved_return_opcode_index_stack = SPVM_LIST_new(compiler->current_each_compile_allocator, 0, SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP);
322            
323 223002           SPVM_LIST* unresolved_goto_end_of_eval_on_exception_opcode_index_stack = SPVM_LIST_new(compiler->current_each_compile_allocator, 0, SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP);
324            
325 223002           SPVM_LIST* unresolved_goto_end_of_method_on_exception_opcode_index_stack = SPVM_LIST_new(compiler->current_each_compile_allocator, 0, SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP);
326            
327 223002           SPVM_LIST* mortal_stack = SPVM_LIST_new(compiler->current_each_compile_allocator, 0, SPVM_ALLOCATOR_C_ALLOC_TYPE_TMP);
328            
329             // Run OPs
330 223002           SPVM_OP* op_base = method->op_block;
331 223002           SPVM_OP* op_cur = op_base;
332 223002           int32_t finish = 0;
333            
334 223002           int32_t mortal_stack_top = 0;
335              
336 22133088 100         while (op_cur) {
337            
338             // [START]Preorder traversal position
339 22127333           switch (op_cur->id) {
340             case SPVM_OP_C_ID_BLOCK: { // Preorder
341            
342 1540805           SPVM_BLOCK* block = op_cur->uv.block;
343            
344 1540805 100         if (block->id == SPVM_BLOCK_C_ID_LOOP_INIT) {
345             // Push last block base stack
346 68679           int32_t last_block_base = unresolved_last_opcode_index_stack->length;
347 68679           SPVM_LIST_push(loop_block_stack_last_base, (void*)(intptr_t)last_block_base);
348             }
349 1472126 100         else if (block->id == SPVM_BLOCK_C_ID_LOOP_STATEMENTS) {
350            
351             // Push next block base stack
352 68679           int32_t next_block_base = unresolved_next_opcode_index_stack->length;
353 68679           SPVM_LIST_push(loop_block_stack_next_base, (void*)(intptr_t)next_block_base);
354              
355 68679           SPVM_OPCODE opcode = {0};
356            
357             // Add goto
358 68679           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GOTO);
359 68679           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
360            
361 68679           int32_t opcode_index = opcode_list->length - 1;
362            
363 68679           SPVM_LIST_push(loop_block_stack_goto_opcode_index, (void*)(intptr_t)opcode_index);
364             }
365 1403447 100         else if (block->id == SPVM_BLOCK_C_ID_SWITCH) {
366             // Push break block base stack
367 1642           int32_t break_block_base = unresolved_break_opcode_index_stack->length;
368 1642           SPVM_LIST_push(switch_block_stack_break_base, (void*)(intptr_t)break_block_base);
369             }
370 1401805 100         else if (block->id == SPVM_BLOCK_C_ID_EVAL) {
371 2074           int32_t opcode_index = opcode_list->length;
372            
373 2074           SPVM_LIST_push(eval_block_stack_goto_opcode_index, (void*)(intptr_t)opcode_index);
374              
375             // Set exception var to undef in eval block start
376             {
377 2074           SPVM_OPCODE opcode = {0};
378 2074           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_CLEAR_EVAL_ERROR_ID);
379 2074           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
380             }
381             {
382 2074           SPVM_OPCODE opcode = {0};
383 2074           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_EXCEPTION_VAR_UNDEF);
384 2074           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
385             }
386             }
387            
388 1540805           int32_t runtime_var_indexs_top = mortal_stack->length;
389 1540805           SPVM_LIST_push(block_stack_runtime_var_index_top, (void*)(intptr_t)runtime_var_indexs_top);
390            
391 1540805           break;
392             }
393             case SPVM_OP_C_ID_SWITCH: {
394 1642           SPVM_SWITCH_INFO* switch_info = op_cur->uv.switch_info;
395 1642           SPVM_LIST_push(switch_stack_switch_info, switch_info);
396 1642           break;
397             }
398             case SPVM_OP_C_ID_CASE: {
399 9549 50         if (switch_stack_switch_info->length > 0) {
400 9549           SPVM_SWITCH_INFO* switch_info = SPVM_LIST_get(switch_stack_switch_info, switch_stack_switch_info->length - 1);
401 9549           int32_t opcode_index = opcode_list->length;
402 9549           op_cur->uv.case_info->goto_opcode_index = opcode_index;
403             }
404 9549           break;
405             }
406             case SPVM_OP_C_ID_DEFAULT: {
407 1642 50         if (switch_stack_switch_info->length > 0) {
408 1642           SPVM_SWITCH_INFO* switch_info = SPVM_LIST_get(switch_stack_switch_info, switch_stack_switch_info->length - 1);
409 1642           switch_info->default_opcode_index = opcode_list->length;
410             }
411 1642           break;
412             }
413             }
414            
415             // [END]Preorder traversal position
416            
417 22127333 100         if (op_cur->first) {
418 12399930           op_cur = op_cur->first;
419             }
420             else {
421             while (1) {
422             // [START]Postorder traversal position
423 22127333           switch (op_cur->id) {
424             case SPVM_OP_C_ID_BLOCK: { // Postorder
425 1540805           SPVM_BLOCK* block = op_cur->uv.block;
426            
427 1540805 100         if (block->id == SPVM_BLOCK_C_ID_IF) {
428            
429             {
430 436194           SPVM_OPCODE opcode = {0};
431            
432 436194           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GOTO);
433 436194           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
434            
435 436194           int32_t opcode_index = opcode_list->length - 1;
436 436194           SPVM_LIST_push(if_block_stack_goto_end_opcode_index, (void*)(intptr_t)opcode_index);
437             }
438            
439 436194           int32_t if_eq_or_if_ne_goto_opcode_index = (intptr_t)SPVM_LIST_pop(unresolved_if_eq_or_if_ne_opcode_index_stack);
440            
441 436194           SPVM_OPCODE* if_eq_or_if_ne_goto = (opcode_list->values + if_eq_or_if_ne_goto_opcode_index);
442 436194           int32_t if_eq_or_if_ne_goto_opcode_base_index = opcode_list->length;
443 436194           if_eq_or_if_ne_goto->operand0 = if_eq_or_if_ne_goto_opcode_base_index;
444             }
445 1104611 100         else if (block->id == SPVM_BLOCK_C_ID_ELSE) {
446            
447 436194 50         assert(if_block_stack_goto_end_opcode_index->length > 0);
448            
449 436194           int32_t if_block_end_goto_opcode_index = (intptr_t)SPVM_LIST_pop(if_block_stack_goto_end_opcode_index);
450            
451 436194           SPVM_OPCODE* if_block_end_goto = (opcode_list->values + if_block_end_goto_opcode_index);
452 436194           int32_t if_block_end_goto_opcode_base_index = opcode_list->length;
453 436194           if_block_end_goto->operand0 = if_block_end_goto_opcode_base_index;
454             }
455 668417 100         else if (block->id == SPVM_BLOCK_C_ID_LOOP_INIT) {
456             // last block base
457 68679           int32_t last_block_base = (intptr_t)SPVM_LIST_pop(loop_block_stack_last_base);
458              
459             // Set last position
460 68679           int32_t unresolved_last_opcode_index_stack_pop_count = unresolved_last_opcode_index_stack->length - last_block_base;
461 80712 100         for (int32_t i = 0; i < unresolved_last_opcode_index_stack_pop_count; i++) {
462 12033           int32_t last_goto_opcode_index = (intptr_t)SPVM_LIST_pop(unresolved_last_opcode_index_stack);
463            
464 12033           SPVM_OPCODE* last_goto = (opcode_list->values + last_goto_opcode_index);
465 12033           int32_t last_goto_opcode_base_index = opcode_list->length;
466 12033           last_goto->operand0 = last_goto_opcode_base_index;
467             }
468             }
469 599738 100         else if (block->id == SPVM_BLOCK_C_ID_LOOP_STATEMENTS) {
470             // next block base
471 68679           int32_t next_block_base = (intptr_t)SPVM_LIST_pop(loop_block_stack_next_base);
472            
473             // Set next position
474 68679           int32_t unresolved_next_opcode_index_stack_pop_count = unresolved_next_opcode_index_stack->length - next_block_base;
475 68700 100         for (int32_t i = 0; i < unresolved_next_opcode_index_stack_pop_count; i++) {
476 21           int32_t next_goto_opcode_index = (intptr_t)SPVM_LIST_pop(unresolved_next_opcode_index_stack);
477            
478 21           SPVM_OPCODE* next_goto = (opcode_list->values + next_goto_opcode_index);
479 21           int32_t next_goto_opcode_base_index = opcode_list->length;
480 21           next_goto->operand0 = next_goto_opcode_base_index;
481             }
482             }
483 531059 100         else if (block->id == SPVM_BLOCK_C_ID_SWITCH) {
484             // break block base
485 1642           int32_t break_block_base = (intptr_t)SPVM_LIST_pop(switch_block_stack_break_base);
486            
487             // Set break position
488 1642           int32_t unresolved_break_opcode_index_stack_pop_count = unresolved_break_opcode_index_stack->length - break_block_base;
489 9633 100         for (int32_t i = 0; i < unresolved_break_opcode_index_stack_pop_count; i++) {
490 7991           int32_t break_goto_opcode_index = (intptr_t)SPVM_LIST_pop(unresolved_break_opcode_index_stack);
491            
492 7991           SPVM_OPCODE* break_goto = (opcode_list->values + break_goto_opcode_index);
493 7991           int32_t break_goto_opcode_base_index = opcode_list->length;
494 7991           break_goto->operand0 = break_goto_opcode_base_index;
495             }
496             }
497 529417 100         else if (block->id == SPVM_BLOCK_C_ID_EVAL) {
498             // Set IF_EXCEPTION_CATCH opcode index
499 4840 100         while (unresolved_goto_end_of_eval_on_exception_opcode_index_stack->length > 0) {
500 2766           int32_t goto_end_of_eval_on_exception_goto_opcode_index = (intptr_t)SPVM_LIST_pop(unresolved_goto_end_of_eval_on_exception_opcode_index_stack);
501            
502 2766           SPVM_OPCODE* goto_end_of_eval_on_exception_goto = (opcode_list->values + goto_end_of_eval_on_exception_goto_opcode_index);
503 2766           int32_t goto_end_of_eval_on_exception_goto_opcode_base_index = opcode_list->length;
504 2766           goto_end_of_eval_on_exception_goto->operand0 = goto_end_of_eval_on_exception_goto_opcode_base_index;
505             }
506            
507 2074           SPVM_LIST_pop(eval_block_stack_goto_opcode_index);
508             }
509 527343 100         else if (block->id == SPVM_BLOCK_C_ID_METHOD) {
510 621892 100         while (unresolved_return_opcode_index_stack->length > 0) {
511            
512 404645           int32_t return_goto_opcode_index = (intptr_t)SPVM_LIST_pop(unresolved_return_opcode_index_stack);
513            
514 404645           SPVM_OPCODE* return_goto = (opcode_list->values + return_goto_opcode_index);
515 404645           int32_t return_goto_opcode_base_index = opcode_list->length;
516 404645           return_goto->operand1 = return_goto_opcode_base_index;
517             }
518              
519 1126544 100         while (unresolved_goto_end_of_method_on_exception_opcode_index_stack->length > 0) {
520 909297           int32_t goto_end_of_method_on_exception_goto_opcode_index = (intptr_t)SPVM_LIST_pop(unresolved_goto_end_of_method_on_exception_opcode_index_stack);
521            
522 909297           SPVM_OPCODE* goto_end_of_method_on_exception_goto = (opcode_list->values + goto_end_of_method_on_exception_goto_opcode_index);
523 909297           int32_t goto_end_of_method_on_exception_goto_opcode_base_index = opcode_list->length;
524 909297           goto_end_of_method_on_exception_goto->operand0 = goto_end_of_method_on_exception_goto_opcode_base_index;
525             }
526             }
527            
528 1540805           int32_t runtime_var_indexs_top = (intptr_t)SPVM_LIST_get(block_stack_runtime_var_index_top, block_stack_runtime_var_index_top->length - 1);
529            
530             // Leave scope
531 1540805 100         if (block->need_leave_scope) {
532            
533 612458           SPVM_OPCODE opcode = {0};
534            
535 612458           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_LEAVE_SCOPE);
536 612458           opcode.operand0 = runtime_var_indexs_top;
537            
538 612458           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
539             }
540            
541 2303892 100         while (mortal_stack->length > runtime_var_indexs_top) {
542 763087           SPVM_LIST_pop(mortal_stack);
543             }
544            
545 1540805           SPVM_LIST_pop(block_stack_runtime_var_index_top);
546            
547 1540805           break;
548             }
549             case SPVM_OP_C_ID_LOOP_INCREMENT: {
550             // Set loop first GOTO opcode
551 68679           int32_t loop_first_goto_opcode_index = (intptr_t)SPVM_LIST_get(loop_block_stack_goto_opcode_index, loop_block_stack_goto_opcode_index->length - 1);
552            
553 68679           SPVM_OPCODE* loop_first_goto = (opcode_list->values + loop_first_goto_opcode_index);
554 68679           int32_t loop_first_goto_opcode_base_index = opcode_list->length;
555 68679           loop_first_goto->operand0 = loop_first_goto_opcode_base_index;
556            
557 68679           break;
558             }
559             case SPVM_OP_C_ID_CONDITION:
560             case SPVM_OP_C_ID_CONDITION_NOT:
561             {
562            
563 504873           int32_t opcode_index = opcode_list->length;
564              
565 504873           SPVM_OPCODE opcode = {0};
566            
567              
568 504873 100         if (op_cur->id == SPVM_OP_C_ID_CONDITION) {
569 279610           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_IF_EQ_ZERO);
570             }
571             else {
572 225263           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_IF_NE_ZERO);
573             }
574            
575 504873 100         if (op_cur->flag & SPVM_OP_C_FLAG_CONDITION_IF) {
576 436194           SPVM_LIST_push(unresolved_if_eq_or_if_ne_opcode_index_stack, (void*)(intptr_t)opcode_index);
577             }
578 68679 50         else if (op_cur->flag & SPVM_OP_C_FLAG_CONDITION_LOOP) {
579 68679 50         assert(loop_block_stack_goto_opcode_index->length > 0);
580            
581 68679           int32_t loop_first_goto_opcode_index = (intptr_t)SPVM_LIST_pop(loop_block_stack_goto_opcode_index);
582            
583 68679           opcode.operand0 = loop_first_goto_opcode_index + 1;
584             }
585            
586 504873           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
587            
588 504873           break;
589             }
590             case SPVM_OP_C_ID_NEXT: {
591             // GOTO increment statement
592 21           SPVM_OPCODE opcode = {0};
593            
594 21           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GOTO);
595 21           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
596            
597 21           int32_t opcode_index = opcode_list->length - 1;
598            
599 21           SPVM_LIST_push(unresolved_next_opcode_index_stack, (void*)(intptr_t)opcode_index);
600            
601 21           break;
602             }
603             case SPVM_OP_C_ID_LAST: {
604             // GOTO end of loop init block
605 12033           SPVM_OPCODE opcode = {0};
606            
607 12033           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GOTO);
608 12033           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
609            
610 12033           int32_t opcode_index = opcode_list->length - 1;
611            
612 12033           SPVM_LIST_push(unresolved_last_opcode_index_stack, (void*)(intptr_t)opcode_index);
613            
614 12033           break;
615             }
616             case SPVM_OP_C_ID_SWITCH: {
617            
618             // Pop switch information
619 1642           SPVM_SWITCH_INFO* switch_info = SPVM_LIST_pop(switch_stack_switch_info);
620            
621             // Set the information of switch opcodes
622 1642           int32_t opcode_index = switch_info->opcode_index;
623 1642           SPVM_OPCODE* opcode = opcode_list->values + opcode_index;
624 1642           opcode->operand1 = switch_info->default_opcode_index;
625 1642           opcode->operand2 = switch_info->case_infos->length;
626              
627             // Set case info operands
628 1642           SPVM_LIST* case_infos = switch_info->case_infos;
629 11191 100         for (int32_t i = 0; i < switch_info->case_infos->length; i++) {
630 9549           SPVM_OPCODE* opcode_case_info = opcode_list->values + opcode_index + 1 + i;
631 9549           SPVM_CASE_INFO* case_info = SPVM_LIST_get(case_infos, i);
632 9549           opcode_case_info->operand1 = case_info->case_value;
633 9549           opcode_case_info->operand2 = case_info->goto_opcode_index;
634             }
635            
636 1642           break;
637             }
638             case SPVM_OP_C_ID_SWITCH_CONDITION: {
639 1642 50         assert(switch_stack_switch_info->length > 0);
640            
641 1642           SPVM_SWITCH_INFO* switch_info = SPVM_LIST_get(switch_stack_switch_info, switch_stack_switch_info->length - 1);
642              
643 1642           int32_t runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_cur->first);
644            
645 1642           int32_t opcode_index = opcode_list->length;
646 1642           switch_info->opcode_index = opcode_index;
647              
648             // Add switch opcode
649             SPVM_OPCODE opcode_switch_info;
650 1642           memset(&opcode_switch_info, 0, sizeof(SPVM_OPCODE));
651 1642           opcode_switch_info.id = SPVM_OPCODE_C_ID_LOOKUP_SWITCH;
652 1642           opcode_switch_info.operand0 = runtime_var_index_in;
653 1642           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode_switch_info);
654              
655             // Match values and branchs
656 11191 100         for (int32_t i = 0; i < switch_info->case_infos->length; i++) {
657 9549           SPVM_CASE_INFO* case_info = SPVM_LIST_get(switch_info->case_infos, i);
658            
659             // Branch
660 9549           SPVM_CASE_INFO* branch_opcode_index_case_info = switch_info->case_infos->values[i];
661 9549           branch_opcode_index_case_info->goto_opcode_index = case_info->goto_opcode_index;
662            
663             // Add case info
664             SPVM_OPCODE opcode_case_info;
665 9549           memset(&opcode_case_info, 0, sizeof(SPVM_OPCODE));
666 9549           opcode_case_info.id = SPVM_OPCODE_C_ID_CASE_INFO;
667 9549           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode_case_info);
668             }
669              
670             // Default branch
671 1642           int32_t default_opcode_index = switch_info->default_opcode_index;
672 1642 50         if (default_opcode_index == 0) {
673 1642           default_opcode_index = opcode_list->length + 1;
674             }
675 1642           switch_info->default_opcode_index = default_opcode_index;
676              
677 1642           break;
678             }
679             case SPVM_OP_C_ID_BREAK: {
680             // GOTO end of switch block
681 7991           SPVM_OPCODE opcode = {0};
682            
683 7991           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GOTO);
684 7991           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
685            
686 7991           int32_t opcode_index = opcode_list->length - 1;
687            
688 7991           SPVM_LIST_push(unresolved_break_opcode_index_stack, (void*)(intptr_t)opcode_index);
689            
690 7991           break;
691             }
692             case SPVM_OP_C_ID_RETURN: {
693 404645 100         if (op_cur->first) {
694 309245           SPVM_TYPE* return_type = SPVM_CHECK_get_type(compiler, op_cur->first);
695            
696 309245 100         if (SPVM_TYPE_is_undef_type(compiler, return_type->basic_type->id, return_type->dimension, return_type->flag)) {
697 2119           SPVM_OPCODE opcode = {0};
698            
699            
700 2119           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_RETURN_UNDEF);
701            
702 2119           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
703             }
704             else {
705 307126           SPVM_OPCODE opcode = {0};
706            
707            
708            
709             int32_t runtime_var_index_in;
710 307126 100         if (SPVM_TYPE_is_numeric_type(compiler, method->return_type->basic_type->id, method->return_type->dimension, method->return_type->flag)) {
711 194458           switch (method->return_type->basic_type->id) {
712             case SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE: {
713 184           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_RETURN_BYTE);
714 184           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_cur->first);
715 194458           break;
716             }
717             case SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT: {
718 186           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_RETURN_SHORT);
719 186           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_cur->first);
720 186           break;
721             }
722             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT: {
723 166980           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_RETURN_INT);
724 166980           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_cur->first);
725 166980           break;
726             }
727             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG: {
728 15996           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_RETURN_LONG);
729 15996           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_cur->first);
730 15996           break;
731             }
732             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT: {
733 4504           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_RETURN_FLOAT);
734 4504           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_cur->first);
735 4504           break;
736             }
737             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE: {
738 6608           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_RETURN_DOUBLE);
739 6608           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_cur->first);
740 6608           break;
741             }
742             default:
743 0           assert(0);
744             }
745             }
746 112668 100         else if (SPVM_TYPE_is_object_type(compiler, method->return_type->basic_type->id, method->return_type->dimension, method->return_type->flag)) {
747 112490           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_RETURN_OBJECT);
748 112490           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_cur->first);
749             }
750 178 50         else if (SPVM_TYPE_is_mulnum_type(compiler, method->return_type->basic_type->id, method->return_type->dimension, method->return_type->flag)) {
751 178           SPVM_FIELD* first_field = SPVM_LIST_get(return_type->basic_type->fields, 0);
752 178 50         assert(first_field);
753            
754 178           SPVM_TYPE* field_type = SPVM_CHECK_get_type(compiler, first_field->op_field);
755 178 50         assert(SPVM_TYPE_is_numeric_type(compiler, field_type->basic_type->id, field_type->dimension, field_type->flag));
756              
757 178           switch (field_type->basic_type->id) {
758             case SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE: {
759 32           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_cur->first);
760 32           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_RETURN_MULNUM_BYTE);
761 178           break;
762             }
763             case SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT: {
764 28           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_cur->first);
765 28           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_RETURN_MULNUM_SHORT);
766 28           break;
767             }
768             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT: {
769 28           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_cur->first);
770 28           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_RETURN_MULNUM_INT);
771 28           break;
772             }
773             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG: {
774 28           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_cur->first);
775 28           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_RETURN_MULNUM_LONG);
776 28           break;
777             }
778             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT: {
779 28           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_cur->first);
780 28           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_RETURN_MULNUM_FLOAT);
781 28           break;
782             }
783             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE: {
784 34           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_cur->first);
785 34           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_RETURN_MULNUM_DOUBLE);
786 34           break;
787             }
788             default:
789 0           assert(0);
790             }
791             }
792             else {
793 0           assert(0);
794             }
795            
796 307126           int32_t method_return_width = SPVM_TYPE_get_width(compiler, method->return_type->basic_type->id, method->return_type->dimension, method->return_type->flag);
797              
798 307126           opcode.operand0 = runtime_var_index_in;
799 307126           opcode.operand2 = method_return_width;
800            
801 309245           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
802             }
803             }
804             else {
805 95400           SPVM_OPCODE opcode = {0};
806            
807 95400           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_RETURN_VOID);
808 95400           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
809             }
810            
811 404645           int32_t return_opcode_index = opcode_list->length - 1;
812            
813 404645           SPVM_LIST_push(unresolved_return_opcode_index_stack, (void*)(intptr_t)return_opcode_index);
814            
815 404645           break;
816             }
817             case SPVM_OP_C_ID_DIE: {
818            
819 140296           SPVM_TYPE* type = SPVM_CHECK_get_type(compiler, op_cur->last);
820            
821             // SET_ERROR_ID
822             {
823 140296           SPVM_OPCODE opcode = {0};
824            
825 140296           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_ERROR_ID);
826 140296           opcode.operand0 = type->basic_type->id;
827            
828 140296           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
829             }
830            
831 140296           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_cur->line);
832            
833 140296           break;
834             }
835             case SPVM_OP_C_ID_VAR: {
836 6273638 100         if (op_cur->uv.var->is_declaration) {
837            
838 2682753           SPVM_VAR_DECL* var_decl = op_cur->uv.var->var_decl;
839            
840 2682753           SPVM_TYPE* type = SPVM_CHECK_get_type(compiler, var_decl->op_var_decl);
841 2682753 100         if (SPVM_TYPE_is_object_type(compiler, type->basic_type->id, type->dimension, type->flag)) {
842            
843 763087           SPVM_OPCODE opcode = {0};
844            
845 763087           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_PUSH_MORTAL);
846 763087           int32_t runtime_var_index = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_cur);
847 763087           opcode.operand0 = runtime_var_index;
848            
849 763087           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
850            
851 763087           SPVM_LIST_push(mortal_stack, (void*)(intptr_t)runtime_var_index);
852            
853 763087           mortal_stack_top++;
854             }
855            
856             // Initialized not initialized variable
857 2682753 100         if (!op_cur->uv.var->is_initialized && !op_cur->uv.var->var_decl->is_arg) {
    100          
858             // Multi numeric type
859 358245 100         if (SPVM_TYPE_is_mulnum_type(compiler, type->basic_type->id, type->dimension, type->flag)) {
860 346           SPVM_FIELD* first_field = SPVM_LIST_get(type->basic_type->fields, 0);
861 346 50         assert(first_field);
862            
863 346           SPVM_TYPE* field_type = SPVM_CHECK_get_type(compiler, first_field->op_field);
864 346 50         assert(SPVM_TYPE_is_numeric_type(compiler, field_type->basic_type->id, field_type->dimension, field_type->flag));
865            
866 346           SPVM_OPCODE opcode = {0};
867            
868            
869             int32_t runtime_var_index_out;
870             int32_t runtime_var_index_in;
871 346           switch (field_type->basic_type->id) {
872             case SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE: {
873 48           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_MULNUM_BYTE_ZERO);
874 48           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_cur);
875 48           break;
876             }
877             case SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT: {
878 44           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_MULNUM_SHORT_ZERO);
879 44           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_cur);
880 44           break;
881             }
882             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT: {
883 44           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_MULNUM_INT_ZERO);
884 44           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_cur);
885 44           break;
886             }
887             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG: {
888 44           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_MULNUM_LONG_ZERO);
889 44           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_cur);
890 44           break;
891             }
892             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT: {
893 44           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_MULNUM_FLOAT_ZERO);
894 44           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_cur);
895 44           break;
896             }
897             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE: {
898 122           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_MULNUM_DOUBLE_ZERO);
899 122           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_cur);
900 122           break;
901             }
902             default:
903 0           assert(0);
904             }
905            
906 346           int32_t fields_length = type->basic_type->fields->length;
907            
908 346           opcode.operand0 = runtime_var_index_out;
909 346           opcode.operand2 = fields_length;
910            
911 346           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
912             }
913             // Object type
914 357899 100         else if (SPVM_TYPE_is_object_type(compiler, type->basic_type->id, type->dimension, type->flag)) {
915 56838           SPVM_OPCODE opcode = {0};
916            
917 56838           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_OBJECT_UNDEF);
918 56838           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_cur);
919            
920 56838           opcode.operand0 = runtime_var_index_out;
921            
922 56838           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
923            
924             }
925             // Numeric type
926 301061 100         else if (SPVM_TYPE_is_numeric_type(compiler, type->basic_type->id, type->dimension, type->flag)) {
927 301051           SPVM_OPCODE opcode = {0};
928            
929            
930             int32_t runtime_var_index_out;
931 301051           switch (type->basic_type->id) {
932             case SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE: {
933 131           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_BYTE_ZERO);
934 131           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_cur);
935 131           break;
936             }
937             case SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT: {
938 132           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_SHORT_ZERO);
939 132           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_cur);
940 132           break;
941             }
942             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT: {
943 286123           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_INT_ZERO);
944 286123           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_cur);
945 286123           break;
946             }
947             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG: {
948 8002           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_LONG_ZERO);
949 8002           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_cur);
950 8002           break;
951             }
952             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT: {
953 2280           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_FLOAT_ZERO);
954 2280           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_cur);
955 2280           break;
956             }
957             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE: {
958 4383           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_DOUBLE_ZERO);
959 4383           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_cur);
960 4383           break;
961             }
962             default: {
963 0           assert(0);
964             }
965             }
966              
967 301051           opcode.operand0 = runtime_var_index_out;
968            
969 301051           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
970             }
971             else {
972             // TODO ref type which is not sub arg is invalid
973             // assert(0);
974             }
975             }
976             }
977            
978 6273638           break;
979             }
980             // all operators are assigned to variables by SPVM_CHECK_traverse_ast_assign_unassigned_op_to_var.
981             case SPVM_OP_C_ID_ASSIGN: {
982 3527983           SPVM_OP* op_assign = op_cur;
983            
984 3527983           SPVM_OP* op_assign_dist = op_assign->last;
985 3527983           SPVM_OP* op_assign_src = op_assign->first;
986            
987 3527983 100         if (op_assign_src->id == SPVM_OP_C_ID_SEQUENCE) {
988 1848           op_assign_src = op_assign_src->last;
989             }
990            
991             // $var = OPERATOR
992 3527983 100         if (op_assign_dist->id == SPVM_OP_C_ID_VAR) {
993 3259282           SPVM_TYPE* type_dist = SPVM_CHECK_get_type(compiler, op_assign_dist);
994            
995 3259282           switch (op_assign_src->id) {
996             case SPVM_OP_C_ID_CONCAT: {
997 36376           SPVM_TYPE* first_type = SPVM_CHECK_get_type(compiler, op_assign_src->first);
998            
999 36376 50         assert(SPVM_TYPE_is_string_or_byte_array_type(compiler, first_type->basic_type->id, first_type->dimension, first_type->flag));
1000            
1001 36376           SPVM_OPCODE opcode = {0};
1002            
1003 36376           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_CONCAT);
1004            
1005 36376           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1006 36376           int32_t runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
1007 36376           int32_t runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
1008              
1009 36376           opcode.operand0 = runtime_var_index_out;
1010 36376           opcode.operand1 = runtime_var_index_in1;
1011 36376           opcode.operand2 = runtime_var_index_in2;
1012            
1013 36376           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
1014              
1015 36376           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_assign->line);
1016 36376           break;
1017             }
1018             case SPVM_OP_C_ID_TYPE_NAME : {
1019            
1020 2099           SPVM_TYPE* first_type = SPVM_CHECK_get_type(compiler, op_assign_src->first);
1021            
1022 2099           SPVM_OPCODE opcode = {0};
1023            
1024 2099           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_NAME);
1025            
1026 2099           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1027 2099           int32_t runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
1028              
1029 2099           opcode.operand0 = runtime_var_index_out;
1030 2099           opcode.operand1 = runtime_var_index_in;
1031            
1032 2099           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
1033            
1034 2099           break;
1035             }
1036             case SPVM_OP_C_ID_DUMP : {
1037            
1038 57           SPVM_TYPE* first_type = SPVM_CHECK_get_type(compiler, op_assign_src->first);
1039            
1040 57           SPVM_OPCODE opcode = {0};
1041            
1042 57           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_DUMP);
1043            
1044 57           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1045 57           int32_t runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
1046              
1047 57           opcode.operand0 = runtime_var_index_out;
1048 57           opcode.operand1 = runtime_var_index_in;
1049            
1050 57           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
1051            
1052 57           break;
1053             }
1054             case SPVM_OP_C_ID_NEW_STRING_LEN : {
1055            
1056 4715           SPVM_TYPE* first_type = SPVM_CHECK_get_type(compiler, op_assign_src->first);
1057            
1058 4715           SPVM_OPCODE opcode = {0};
1059            
1060 4715           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_NEW_STRING_LEN);
1061            
1062 4715           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1063 4715           int32_t runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
1064              
1065 4715           opcode.operand0 = runtime_var_index_out;
1066 4715           opcode.operand1 = runtime_var_index_in;
1067            
1068 4715           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
1069              
1070 4715           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_assign->line);
1071            
1072 4715           break;
1073             }
1074             case SPVM_OP_C_ID_IS_READ_ONLY : {
1075            
1076 1054           SPVM_TYPE* first_type = SPVM_CHECK_get_type(compiler, op_assign_src->first);
1077            
1078 1054           SPVM_OPCODE opcode = {0};
1079            
1080 1054           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_IS_READ_ONLY);
1081            
1082 1054           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1083 1054           int32_t runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
1084              
1085 1054           opcode.operand0 = runtime_var_index_out;
1086 1054           opcode.operand1 = runtime_var_index_in;
1087            
1088 1054           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
1089 1054           break;
1090             }
1091             case SPVM_OP_C_ID_UNDEF : {
1092              
1093 629           SPVM_OPCODE opcode = {0};
1094            
1095 629           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_OBJECT_UNDEF);
1096            
1097 629           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1098 629           opcode.operand0 = runtime_var_index_out;
1099            
1100 629           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
1101 629           break;
1102             }
1103             case SPVM_OP_C_ID_CALL_METHOD: {
1104            
1105 245101           SPVM_CALL_METHOD* call_method = op_assign_src->uv.call_method;
1106 245101           const char* call_method_method_name = call_method->method->name;
1107            
1108 245101           SPVM_METHOD* method_call_method = SPVM_HASH_get(call_method->method->current_basic_type->method_symtable, call_method_method_name, strlen(call_method_method_name));
1109            
1110 245101           int32_t first_arg_runtime_var_index = -1;
1111 245101           SPVM_OP* op_term_args = op_assign_src->first;
1112 245101           SPVM_OP* op_term_arg = op_term_args->first;
1113              
1114 245101           SPVM_LIST* args = method_call_method->var_decls;
1115 245101           int32_t args_width = 0;
1116            
1117 832709 100         for (int32_t arg_index = 0; arg_index < method_call_method->args_length; arg_index++) {
1118 614022           SPVM_VAR_DECL* arg_var_decl = SPVM_LIST_get(args, arg_index);
1119            
1120             // Argument type
1121 614022           SPVM_TYPE* arg_type = arg_var_decl->type;
1122 614022           int32_t arg_width = SPVM_TYPE_get_width(compiler, arg_type->basic_type->id, arg_type->dimension, arg_type->flag);
1123            
1124             // Term argment type
1125 614022           op_term_arg = SPVM_OP_sibling(compiler, op_term_arg);
1126 614022 100         if (!op_term_arg) {
1127 26414           break;
1128             }
1129            
1130 587608           SPVM_TYPE* term_arg_type = SPVM_CHECK_get_type(compiler, op_term_arg);
1131            
1132 587608           SPVM_OPCODE opcode = {0};
1133            
1134 587608           opcode.operand3 = args_width;
1135            
1136 587608 100         if (SPVM_TYPE_is_undef_type(compiler, term_arg_type->basic_type->id, term_arg_type->dimension, term_arg_type->flag)) {
1137 3007           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_STACK_UNDEF);
1138 3007           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
1139             }
1140             else {
1141 584601 100         if (SPVM_TYPE_is_ref_type(compiler, arg_type->basic_type->id, arg_type->dimension, arg_type->flag)) {
1142 5932           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_STACK_REF);
1143              
1144             // Term of argument
1145 5932           int32_t runtime_var_index_arg = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_arg);
1146            
1147 5932           opcode.operand0 = runtime_var_index_arg;
1148            
1149 5932           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
1150             }
1151 578669 100         else if (SPVM_TYPE_is_mulnum_type(compiler, arg_type->basic_type->id, arg_type->dimension, arg_type->flag)) {
1152              
1153 88           SPVM_FIELD* first_field = SPVM_LIST_get(arg_type->basic_type->fields, 0);
1154 88 50         assert(first_field);
1155            
1156 88           SPVM_TYPE* field_type = SPVM_CHECK_get_type(compiler, first_field->op_field);
1157 88 50         assert(SPVM_TYPE_is_numeric_type(compiler, field_type->basic_type->id, field_type->dimension, field_type->flag));
1158            
1159             int32_t runtime_var_index_arg;
1160 88           switch (field_type->basic_type->id) {
1161             case SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE: {
1162 6           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_STACK_MULNUM_BYTE);
1163 6           runtime_var_index_arg = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_arg);
1164 6           break;
1165             }
1166             case SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT: {
1167 6           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_STACK_MULNUM_SHORT);
1168 6           runtime_var_index_arg = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_arg);
1169 6           break;
1170             }
1171             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT: {
1172 6           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_STACK_MULNUM_INT);
1173 6           runtime_var_index_arg = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_arg);
1174 6           break;
1175             }
1176             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG: {
1177 6           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_STACK_MULNUM_LONG);
1178 6           runtime_var_index_arg = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_arg);
1179 6           break;
1180             }
1181             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT: {
1182 6           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_STACK_MULNUM_FLOAT);
1183 6           runtime_var_index_arg = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_arg);
1184 6           break;
1185             }
1186             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE: {
1187 58           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_STACK_MULNUM_DOUBLE);
1188 58           runtime_var_index_arg = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_arg);
1189 58           break;
1190             }
1191             default:
1192 0           assert(0);
1193             }
1194            
1195 88           int32_t fields_length = arg_type->basic_type->fields->length;
1196 88           opcode.operand0 = runtime_var_index_arg;
1197 88           opcode.operand1 = fields_length;
1198            
1199 88           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
1200             }
1201             // Object type
1202 578581 100         else if (SPVM_TYPE_is_object_type(compiler, arg_type->basic_type->id, arg_type->dimension, arg_type->flag)) {
1203 321666           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_STACK_OBJECT);
1204 321666           int32_t runtime_var_index_arg = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_arg);
1205            
1206 321666           opcode.operand0 = runtime_var_index_arg;
1207            
1208 321666 100         if (arg_index == 0) {
1209 184906           first_arg_runtime_var_index = runtime_var_index_arg;
1210             }
1211 321666           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
1212             }
1213             // Numeric type
1214 256915 50         else if (SPVM_TYPE_is_numeric_type(compiler, arg_type->basic_type->id, arg_type->dimension, arg_type->flag)) {
1215             int32_t runtime_var_index_arg;
1216 256915           switch (arg_type->basic_type->id) {
1217             case SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE: {
1218 7382           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_STACK_BYTE);
1219 7382           runtime_var_index_arg = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_arg);
1220 7382           break;
1221             }
1222             case SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT: {
1223 74           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_STACK_SHORT);
1224 74           runtime_var_index_arg = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_arg);
1225 74           break;
1226             }
1227             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT: {
1228 240940           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_STACK_INT);
1229 240940           runtime_var_index_arg = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_arg);
1230 240940           break;
1231             }
1232             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG: {
1233 3880           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_STACK_LONG);
1234 3880           runtime_var_index_arg = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_arg);
1235 3880           break;
1236             }
1237             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT: {
1238 1796           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_STACK_FLOAT);
1239 1796           runtime_var_index_arg = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_arg);
1240 1796           break;
1241             }
1242             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE: {
1243 2843           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_STACK_DOUBLE);
1244 2843           runtime_var_index_arg = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_arg);
1245 2843           break;
1246             }
1247             default:
1248 0           assert(0);
1249             }
1250            
1251 256915           opcode.operand0 = runtime_var_index_arg;
1252            
1253 256915 100         if (arg_index == 0) {
1254 17712           first_arg_runtime_var_index = runtime_var_index_arg;
1255             }
1256 256915           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
1257             }
1258             else {
1259 0           assert(0);
1260             }
1261             }
1262 587608           args_width += arg_width;
1263             }
1264            
1265             int32_t runtime_var_index_out;
1266            
1267             // Return
1268 245101           SPVM_TYPE* call_method_return_type = call_method->method->return_type;
1269             // Call method
1270 245101           SPVM_OPCODE opcode = {0};
1271            
1272 245101 100         if (call_method->is_class_method) {
1273 158496           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_CALL_CLASS_METHOD);
1274             }
1275             else {
1276 86605 100         if (call_method->is_class_method_instance_method_call) {
1277 112           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_CALL_INSTANCE_METHOD_STATIC);
1278             }
1279             else {
1280 86493           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_CALL_INSTANCE_METHOD);
1281             }
1282             }
1283 245101           opcode.operand0 = call_method->method->current_basic_type->id;
1284 245101           opcode.operand1 = call_method->method->index;
1285 245101           opcode.operand2 = args_width;
1286            
1287 245101           SPVM_OPCODE opcode_return = {0};
1288             {
1289 245101           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1290 245101           opcode_return.operand0 = runtime_var_index_out;
1291 245101           opcode_return.operand3 = 0;
1292              
1293             // Numeric type
1294 245101 100         if (SPVM_TYPE_is_numeric_type(compiler, call_method_return_type->basic_type->id, call_method_return_type->dimension, call_method_return_type->flag)) {
1295 52604           switch (call_method_return_type->basic_type->id) {
1296             case SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE: {
1297 155           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode_return, SPVM_OPCODE_C_ID_GET_STACK_BYTE);
1298 52604           break;
1299             }
1300             case SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT: {
1301 160           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode_return, SPVM_OPCODE_C_ID_GET_STACK_SHORT);
1302 160           break;
1303             }
1304             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT: {
1305 43967           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode_return, SPVM_OPCODE_C_ID_GET_STACK_INT);
1306 43967           break;
1307             }
1308             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG: {
1309 2677           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode_return, SPVM_OPCODE_C_ID_GET_STACK_LONG);
1310 2677           break;
1311             }
1312             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT: {
1313 2529           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode_return, SPVM_OPCODE_C_ID_GET_STACK_FLOAT);
1314 2529           break;
1315             }
1316             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE: {
1317 3116           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode_return, SPVM_OPCODE_C_ID_GET_STACK_DOUBLE);
1318 3116           break;
1319             }
1320             default:
1321 0           assert(0);
1322             }
1323             }
1324             // void type
1325 192497 100         else if (SPVM_TYPE_is_void_type(compiler, call_method_return_type->basic_type->id, call_method_return_type->dimension, call_method_return_type->flag)) {
1326             }
1327             // Object type
1328 67826 100         else if (SPVM_TYPE_is_object_type(compiler, call_method_return_type->basic_type->id, call_method_return_type->dimension, call_method_return_type->flag)) {
1329 67799           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode_return, SPVM_OPCODE_C_ID_GET_STACK_OBJECT);
1330             }
1331             // Multi numeric type
1332 27 50         else if (SPVM_TYPE_is_mulnum_type(compiler, call_method_return_type->basic_type->id, call_method_return_type->dimension, call_method_return_type->flag)) {
1333              
1334 27           SPVM_FIELD* first_field = SPVM_LIST_get(call_method_return_type->basic_type->fields, 0);
1335 27 50         assert(first_field);
1336            
1337 27           SPVM_TYPE* field_type = SPVM_CHECK_get_type(compiler, first_field->op_field);
1338 27 50         assert(SPVM_TYPE_is_numeric_type(compiler, field_type->basic_type->id, field_type->dimension, field_type->flag));
1339            
1340 27           int32_t call_method_return_width = SPVM_TYPE_get_width(compiler, call_method_return_type->basic_type->id, call_method_return_type->dimension, call_method_return_type->flag);
1341 27 50         assert(call_method_return_width < 0xFFFF);
1342 27           opcode_return.operand3 = call_method_return_width << 8 | 0;
1343              
1344 27           switch (field_type->basic_type->id) {
1345             case SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE: {
1346 6           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode_return, SPVM_OPCODE_C_ID_GET_STACK_MULNUM_BYTE);
1347 27           break;
1348             }
1349             case SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT: {
1350 4           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode_return, SPVM_OPCODE_C_ID_GET_STACK_MULNUM_SHORT);
1351 4           break;
1352             }
1353             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT: {
1354 4           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode_return, SPVM_OPCODE_C_ID_GET_STACK_MULNUM_INT);
1355 4           break;
1356             }
1357             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG: {
1358 4           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode_return, SPVM_OPCODE_C_ID_GET_STACK_MULNUM_LONG);
1359 4           break;
1360             }
1361             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT: {
1362 4           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode_return, SPVM_OPCODE_C_ID_GET_STACK_MULNUM_FLOAT);
1363 4           break;
1364             }
1365             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE: {
1366 5           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode_return, SPVM_OPCODE_C_ID_GET_STACK_MULNUM_DOUBLE);
1367 5           break;
1368             }
1369             default: {
1370 0           assert(0);
1371             }
1372             }
1373             }
1374             else {
1375 0           assert(0);
1376             }
1377             }
1378            
1379 245101           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
1380            
1381 245101           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_assign->line);
1382            
1383 245101 100         if (!SPVM_TYPE_is_void_type(compiler, call_method_return_type->basic_type->id, call_method_return_type->dimension, call_method_return_type->flag)) {
1384 120430           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode_return);
1385             }
1386 245101           break;
1387             }
1388             case SPVM_OP_C_ID_STRING_LENGTH : {
1389            
1390             // String length logic is same as ARRAY_LENGTH opcode
1391 20394           SPVM_OPCODE opcode = {0};
1392            
1393 20394           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_ARRAY_LENGTH);
1394            
1395 20394           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1396 20394           int32_t runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
1397            
1398 20394           opcode.operand0 = runtime_var_index_out;
1399 20394           opcode.operand1 = runtime_var_index_in;
1400              
1401 20394           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
1402              
1403 20394           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_assign->line);
1404 20394           break;
1405             }
1406             case SPVM_OP_C_ID_ARRAY_LENGTH : {
1407 55739           SPVM_OPCODE opcode = {0};
1408            
1409 55739           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_ARRAY_LENGTH);
1410            
1411 55739           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1412 55739           int32_t runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
1413            
1414 55739           opcode.operand0 = runtime_var_index_out;
1415 55739           opcode.operand1 = runtime_var_index_in;
1416              
1417 55739           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
1418              
1419 55739           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_assign->line);
1420 55739           break;
1421             }
1422             case SPVM_OP_C_ID_ARRAY_FIELD_ACCESS : {
1423            
1424             // $VAR = $VAR_OBJECT->[INDEX]{NAME}
1425 1315           SPVM_OP* op_array_field_access = op_assign_src;
1426 1315           SPVM_OP* op_term_invocant = op_array_field_access->first;
1427 1315           SPVM_OP* op_term_index = op_array_field_access->last;
1428            
1429             // Call field
1430 1315           SPVM_ARRAY_FIELD_ACCESS* array_field_access = op_array_field_access->uv.array_field_access;
1431            
1432 1315           SPVM_FIELD* field = array_field_access->field;
1433            
1434             // Array type
1435 1315           SPVM_TYPE* array_type = SPVM_CHECK_get_type(compiler, op_array_field_access->first);
1436 1315           SPVM_BASIC_TYPE* array_basic_type = array_type->basic_type;
1437            
1438             // Element type
1439 1315           SPVM_TYPE* element_type = SPVM_CHECK_get_type(compiler, op_array_field_access);
1440              
1441 1315           SPVM_OPCODE opcode = {0};
1442            
1443             int32_t runtime_var_index_out;
1444 1315           switch (element_type->basic_type->id) {
1445             case SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE: {
1446 207           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_MULNUM_ARRAY_FIELD_BYTE);
1447 207           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1448 207           break;
1449             }
1450             case SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT: {
1451 207           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_MULNUM_ARRAY_FIELD_SHORT);
1452 207           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1453 207           break;
1454             }
1455             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT: {
1456 239           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_MULNUM_ARRAY_FIELD_INT);
1457 239           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1458 239           break;
1459             }
1460             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG: {
1461 207           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_MULNUM_ARRAY_FIELD_LONG);
1462 207           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1463 207           break;
1464             }
1465             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT: {
1466 207           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_MULNUM_ARRAY_FIELD_FLOAT);
1467 207           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1468 207           break;
1469             }
1470             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE: {
1471 248           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_MULNUM_ARRAY_FIELD_DOUBLE);
1472 248           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1473 248           break;
1474             }
1475             default: {
1476 0           assert(0);
1477             }
1478             }
1479            
1480             // Field absolute name symbol
1481 1315           int32_t runtime_var_index_invocant = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_invocant);
1482 1315           int32_t runtime_var_index_index = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_index);
1483            
1484 1315           int32_t fields_length = array_basic_type->fields->length;
1485 1315           int32_t field_offset = field->index;
1486              
1487 1315           opcode.operand0 = runtime_var_index_out;
1488 1315           opcode.operand1 = runtime_var_index_invocant;
1489 1315           opcode.operand2 = runtime_var_index_index;
1490 1315           int32_t operand3 = (field_offset << 8) + (fields_length - 1);
1491 1315 50         assert(operand3 < 0xFFFF);
1492 1315           opcode.operand3 = operand3;
1493              
1494 1315           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
1495              
1496 1315           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_assign->line);
1497 1315           break;
1498             }
1499             case SPVM_OP_C_ID_FIELD_ACCESS : {
1500              
1501             // Weaken field
1502 118456 100         if (op_assign_src->flag & SPVM_OP_C_FLAG_FIELD_ACCESS_WEAKEN) {
1503 43           SPVM_OPCODE opcode = {0};
1504            
1505              
1506 43           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_WEAKEN_FIELD);
1507            
1508 43           SPVM_OP* op_term_invocant = op_assign_src->first;
1509 43           int32_t runtime_var_index_invocant = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_invocant);
1510              
1511 43           SPVM_FIELD* field = op_assign_src->uv.field_access->field;
1512              
1513 43           opcode.operand0 = runtime_var_index_invocant;
1514 43           opcode.operand2 = field->current_basic_type->id;
1515 43           opcode.operand3 = (uint16_t)field->index;
1516 43           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
1517              
1518 43           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_assign_src->line);
1519             }
1520 118413 100         else if (op_assign_src->flag & SPVM_OP_C_FLAG_FIELD_ACCESS_UNWEAKEN) {
1521 2           SPVM_OPCODE opcode = {0};
1522            
1523              
1524 2           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_UNWEAKEN_FIELD);
1525            
1526 2           SPVM_OP* op_term_invocant = op_assign_src->first;
1527 2           int32_t runtime_var_index_invocant = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_invocant);
1528              
1529 2           SPVM_FIELD* field = op_assign_src->uv.field_access->field;
1530            
1531 2           opcode.operand0 = runtime_var_index_invocant;
1532 2           opcode.operand2 = field->current_basic_type->id;
1533 2           opcode.operand3 = (uint16_t)field->index;
1534 2           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
1535              
1536 2           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_assign_src->line);
1537             }
1538 118411 100         else if (op_assign_src->flag & SPVM_OP_C_FLAG_FIELD_ACCESS_ISWEAK) {
1539 6           SPVM_OPCODE opcode = {0};
1540            
1541              
1542 6           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_ISWEAK_FIELD);
1543            
1544 6           SPVM_OP* op_term_invocant = op_assign_src->first;
1545 6           int32_t runtime_var_index_invocant = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_invocant);
1546              
1547 6           SPVM_FIELD* field = op_assign_src->uv.field_access->field;
1548            
1549 6           opcode.operand1 = runtime_var_index_invocant;
1550 6           opcode.operand2 = field->current_basic_type->id;
1551 6           opcode.operand3 = (uint16_t)field->index;
1552 6           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
1553              
1554 6           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_assign_src->line);
1555             }
1556             else {
1557             // $VAR = $VAR_OBJECT->{NAME}
1558 118405           SPVM_OP* op_field_access = op_assign_src;
1559 118405           SPVM_OP* op_term_invocant = op_field_access->first;
1560            
1561             // Call field
1562 118405           SPVM_FIELD_ACCESS* field_access = op_field_access->uv.field_access;
1563            
1564 118405           SPVM_TYPE* field_type = SPVM_CHECK_get_type(compiler, op_field_access);
1565              
1566 118405           SPVM_TYPE* invocant_type = SPVM_CHECK_get_type(compiler, op_term_invocant);
1567              
1568             // Value field dereference access
1569 118405 100         if (SPVM_TYPE_is_mulnum_ref_type(compiler, invocant_type->basic_type->id, invocant_type->dimension, invocant_type->flag)) {
1570 134           SPVM_FIELD* field = field_access->field;
1571            
1572 134           SPVM_OPCODE opcode = {0};
1573            
1574             int32_t runtime_var_index_out;
1575 134           switch (field_type->basic_type->id) {
1576             case SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE: {
1577 18           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_MULNUM_FIELD_DEREF_BYTE);
1578 18           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1579 18           break;
1580             }
1581             case SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT: {
1582 18           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_MULNUM_FIELD_DEREF_SHORT);
1583 18           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1584 18           break;
1585             }
1586             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT: {
1587 42           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_MULNUM_FIELD_DEREF_INT);
1588 42           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1589 42           break;
1590             }
1591             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG: {
1592 18           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_MULNUM_FIELD_DEREF_LONG);
1593 18           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1594 18           break;
1595             }
1596             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT: {
1597 18           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_MULNUM_FIELD_DEREF_FLOAT);
1598 18           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1599 18           break;
1600             }
1601             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE: {
1602 20           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_MULNUM_FIELD_DEREF_DOUBLE);
1603 20           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1604 20           break;
1605             }
1606             default: {
1607 0           assert(0);
1608             }
1609             }
1610            
1611 134           int32_t runtime_var_index_invocant = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_invocant);
1612 134           int32_t field_offset = field->index;
1613              
1614 134           opcode.operand0 = runtime_var_index_out;
1615 134           opcode.operand1 = runtime_var_index_invocant;
1616 134           opcode.operand2 = field_offset;
1617              
1618 134           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
1619             }
1620             // Mulnum field access
1621 118271 100         else if (SPVM_TYPE_is_mulnum_type(compiler, invocant_type->basic_type->id, invocant_type->dimension, invocant_type->flag)) {
1622 1067           SPVM_OPCODE opcode = {0};
1623            
1624            
1625             int32_t runtime_var_index_out;
1626             int32_t runtime_var_index_in;
1627 1067           switch (field_type->basic_type->id) {
1628             case SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE: {
1629 178           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_MULNUM_FIELD_BYTE);
1630 178           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1631 178           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_invocant);
1632 178           break;
1633             }
1634             case SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT: {
1635 170           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_MULNUM_FIELD_SHORT);
1636 170           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1637 170           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_invocant);
1638 170           break;
1639             }
1640             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT: {
1641 170           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_MULNUM_FIELD_INT);
1642 170           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1643 170           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_invocant);
1644 170           break;
1645             }
1646             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG: {
1647 170           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_MULNUM_FIELD_LONG);
1648 170           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1649 170           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_invocant);
1650 170           break;
1651             }
1652             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT: {
1653 170           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_MULNUM_FIELD_FLOAT);
1654 170           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1655 170           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_invocant);
1656 170           break;
1657             }
1658             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE: {
1659 209           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_MULNUM_FIELD_DOUBLE);
1660 209           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1661 209           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_invocant);
1662 209           break;
1663             }
1664             default: {
1665 0           assert(0);
1666             }
1667             }
1668              
1669 1067           SPVM_FIELD* field = field_access->field;
1670            
1671 1067           opcode.operand0 = runtime_var_index_out;
1672 1067           opcode.operand1 = runtime_var_index_in;
1673 1067           opcode.operand2 = field->index;
1674              
1675 1067           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
1676             }
1677             // Field access
1678             else {
1679 117204           SPVM_OPCODE opcode = {0};
1680            
1681 117204           int32_t runtime_var_index_invocant = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_invocant);
1682             int32_t runtime_var_index_out;
1683 117204 100         if (SPVM_TYPE_is_object_type(compiler, field_type->basic_type->id, field_type->dimension, field_type->flag)) {
1684 62366           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_FIELD_OBJECT);
1685 62366           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1686             }
1687             else {
1688 54838           switch (field_type->basic_type->id) {
1689             case SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE: {
1690 1133           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_FIELD_BYTE);
1691 1133           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1692 1133           break;
1693             }
1694             case SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT: {
1695 1131           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_FIELD_SHORT);
1696 1131           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1697 1131           break;
1698             }
1699             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT: {
1700 49181           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_FIELD_INT);
1701 49181           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1702 49181           break;
1703             }
1704             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG: {
1705 1131           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_FIELD_LONG);
1706 1131           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1707 1131           break;
1708             }
1709             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT: {
1710 1131           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_FIELD_FLOAT);
1711 1131           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1712 1131           break;
1713             }
1714             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE: {
1715 1131           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_FIELD_DOUBLE);
1716 1131           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1717 1131           break;
1718             }
1719             default: {
1720 0           assert(0);
1721             }
1722             }
1723             }
1724              
1725 117204           SPVM_FIELD* field = field_access->field;
1726            
1727 117204           opcode.operand0 = runtime_var_index_out;
1728 117204           opcode.operand1 = runtime_var_index_invocant;
1729 117204           opcode.operand2 = field->current_basic_type->id;
1730 117204           opcode.operand3 = (uint16_t)field->index;
1731              
1732 117204           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
1733              
1734 117204           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_assign->line);
1735             }
1736             }
1737 118456           break;
1738             }
1739             case SPVM_OP_C_ID_ARRAY_ACCESS : {
1740            
1741             // $VAR = $VAR_ARRAY->[$VAR_INDEX]
1742 105166           SPVM_OP* op_array_access = op_assign_src;
1743 105166           SPVM_OP* op_term_array = op_array_access->first;
1744 105166           SPVM_OP* op_term_index = op_array_access->last;
1745            
1746 105166           SPVM_TYPE* array_type = SPVM_CHECK_get_type(compiler, op_term_array);
1747              
1748 105166 100         if (SPVM_TYPE_is_mulnum_array_type(compiler, array_type->basic_type->id, array_type->dimension, array_type->flag)) {
1749 13           SPVM_FIELD* first_field = SPVM_LIST_get(array_type->basic_type->fields, 0);
1750            
1751 13           SPVM_TYPE* element_type = SPVM_CHECK_get_type(compiler, first_field->op_field);
1752            
1753 13           SPVM_OPCODE opcode = {0};
1754            
1755 13 50         assert(SPVM_TYPE_is_numeric_type(compiler, element_type->basic_type->id, element_type->dimension, element_type->flag));
1756             int32_t runtime_var_index_out;
1757 13           switch (element_type->basic_type->id) {
1758             case SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE: {
1759 2           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_MULNUM_ARRAY_BYTE);
1760 2           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1761 2           break;
1762             }
1763             case SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT: {
1764 2           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_MULNUM_ARRAY_SHORT);
1765 2           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1766 2           break;
1767             }
1768             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT: {
1769 2           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_MULNUM_ARRAY_INT);
1770 2           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1771 2           break;
1772             }
1773             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG: {
1774 2           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_MULNUM_ARRAY_LONG);
1775 2           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1776 2           break;
1777             }
1778             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT: {
1779 2           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_MULNUM_ARRAY_FLOAT);
1780 2           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1781 2           break;
1782             }
1783             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE: {
1784 3           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_MULNUM_ARRAY_DOUBLE);
1785 3           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1786 3           break;
1787             }
1788             default: {
1789 0           assert(0);
1790             }
1791             }
1792 13           int32_t runtime_var_index_array = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_array);
1793 13           int32_t runtime_var_index_index = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_index);
1794 13           int32_t fields_length = array_type->basic_type->fields->length;
1795              
1796 13           opcode.operand0 = runtime_var_index_out;
1797 13           opcode.operand1 = runtime_var_index_array;
1798 13           opcode.operand2 = runtime_var_index_index;
1799 13           int32_t operand3 = fields_length;
1800 13 50         assert(operand3 < 0xFFFF);
1801 13           opcode.operand3 = operand3;
1802              
1803 13           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
1804              
1805 13           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_assign->line);
1806             }
1807             else {
1808 105153           SPVM_TYPE* element_type = SPVM_CHECK_get_type(compiler, op_array_access);
1809            
1810 105153           SPVM_OPCODE opcode = {0};
1811            
1812             int32_t runtime_var_index_out;
1813 105153 100         if (SPVM_TYPE_is_object_type(compiler, element_type->basic_type->id, element_type->dimension, element_type->flag)) {
1814 44297           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_ARRAY_ELEMENT_OBJECT);
1815 44297           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1816             }
1817             else {
1818 60856           switch (element_type->basic_type->id) {
1819             case SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE: {
1820 25786           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_ARRAY_ELEMENT_BYTE);
1821 25786           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1822 25786           break;
1823             }
1824             case SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT: {
1825 6458           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_ARRAY_ELEMENT_SHORT);
1826 6458           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1827 6458           break;
1828             }
1829             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT: {
1830 10277           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_ARRAY_ELEMENT_INT);
1831 10277           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1832 10277           break;
1833             }
1834             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG: {
1835 6462           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_ARRAY_ELEMENT_LONG);
1836 6462           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1837 6462           break;
1838             }
1839             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT: {
1840 5936           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_ARRAY_ELEMENT_FLOAT);
1841 5936           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1842 5936           break;
1843             }
1844             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE: {
1845 5937           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_ARRAY_ELEMENT_DOUBLE);
1846 5937           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1847 5937           break;
1848             }
1849             default: {
1850 0           assert(0);
1851             }
1852             }
1853             }
1854              
1855 105153           int32_t runtime_var_index_array = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_array);
1856 105153           int32_t runtime_var_index_index = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_index);
1857              
1858 105153           opcode.operand0 = runtime_var_index_out;
1859 105153           opcode.operand1 = runtime_var_index_array;
1860 105153           opcode.operand2 = runtime_var_index_index;
1861              
1862 105153           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
1863              
1864 105153           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_assign->line);
1865             }
1866 105166           break;
1867             }
1868             case SPVM_OP_C_ID_CLASS_VAR_ACCESS : {
1869 7495           SPVM_TYPE* type = SPVM_CHECK_get_type(compiler, op_assign_src);
1870            
1871 7495           SPVM_CLASS_VAR_ACCESS* class_var_access = op_assign_src->uv.class_var_access;
1872            
1873 7495           SPVM_OPCODE opcode = {0};
1874            
1875            
1876             int32_t runtime_var_index_out;
1877 7495 100         if (SPVM_TYPE_is_object_type(compiler, type->basic_type->id, type->dimension, type->flag)) {
1878 5872           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_CLASS_VAR_OBJECT);
1879 5872           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1880             }
1881             else {
1882 1623           switch (type->basic_type->id) {
1883             case SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE: {
1884 46           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_CLASS_VAR_BYTE);
1885 46           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1886 46           break;
1887             }
1888             case SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT: {
1889 46           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_CLASS_VAR_SHORT);
1890 46           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1891 46           break;
1892             }
1893             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT: {
1894 406           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_CLASS_VAR_INT);
1895 406           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1896 406           break;
1897             }
1898             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG: {
1899 1033           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_CLASS_VAR_LONG);
1900 1033           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1901 1033           break;
1902             }
1903             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT: {
1904 46           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_CLASS_VAR_FLOAT);
1905 46           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1906 46           break;
1907             }
1908             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE: {
1909 46           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_CLASS_VAR_DOUBLE);
1910 46           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1911 46           break;
1912             }
1913             default: {
1914 0           assert(0);
1915             }
1916             }
1917             }
1918            
1919 7495           opcode.operand0 = runtime_var_index_out;
1920 7495           opcode.operand1 = class_var_access->class_var->current_basic_type->id;
1921 7495           opcode.operand2 = class_var_access->class_var->index;
1922            
1923 7495           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
1924 7495           break;
1925             }
1926             case SPVM_OP_C_ID_DEREF : {
1927 1899           SPVM_TYPE* src_type = SPVM_CHECK_get_type(compiler, op_assign_src);
1928            
1929 1899 100         if (SPVM_TYPE_is_mulnum_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
1930 16           SPVM_FIELD* first_field = SPVM_LIST_get(src_type->basic_type->fields, 0);
1931            
1932 16           SPVM_TYPE* element_type = SPVM_CHECK_get_type(compiler, first_field->op_field);
1933              
1934 16           SPVM_OPCODE opcode = {0};
1935            
1936            
1937 16 50         assert(SPVM_TYPE_is_numeric_type(compiler, element_type->basic_type->id, element_type->dimension, element_type->flag));
1938             int32_t runtime_var_index_out;
1939 16 100         if (element_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE) {
1940 4           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_DEREF_MULNUM_BYTE);
1941 4           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1942             }
1943 12 100         else if (element_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT) {
1944 2           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_DEREF_MULNUM_SHORT);
1945 2           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1946             }
1947 10 100         else if (element_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_INT) {
1948 2           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_DEREF_MULNUM_INT);
1949 2           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1950             }
1951 8 100         else if (element_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_LONG) {
1952 2           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_DEREF_MULNUM_LONG);
1953 2           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1954             }
1955 6 100         else if (element_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT) {
1956 2           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_DEREF_MULNUM_FLOAT);
1957 2           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1958             }
1959 4 50         else if (element_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE) {
1960 4           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_DEREF_MULNUM_DOUBLE);
1961 4           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1962             }
1963             else {
1964 0           assert(0);
1965             }
1966              
1967 16           int32_t runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
1968 16           int32_t fields_length = src_type->basic_type->fields->length;
1969            
1970 16           opcode.operand0 = runtime_var_index_out;
1971 16           opcode.operand1 = runtime_var_index_in;
1972 16           int32_t operand3 = fields_length;
1973 16 50         assert(operand3 < 0xFFFF);
1974 16           opcode.operand3 = operand3;
1975              
1976 16           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
1977             }
1978 1883 50         else if (SPVM_TYPE_is_numeric_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
1979              
1980 1883           SPVM_OPCODE opcode = {0};
1981            
1982            
1983             int32_t runtime_var_index_out;
1984 1883           switch (src_type->basic_type->id) {
1985             case SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE: {
1986 50           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_DEREF_BYTE);
1987 50           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1988 50           break;
1989             }
1990             case SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT: {
1991 48           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_DEREF_SHORT);
1992 48           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1993 48           break;
1994             }
1995             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT: {
1996 1639           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_DEREF_INT);
1997 1639           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
1998 1639           break;
1999             }
2000             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG: {
2001 48           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_DEREF_LONG);
2002 48           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2003 48           break;
2004             }
2005             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT: {
2006 48           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_DEREF_FLOAT);
2007 48           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2008 48           break;
2009             }
2010             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE: {
2011 50           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_DEREF_DOUBLE);
2012 50           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2013 50           break;
2014             }
2015             default: {
2016 0           assert(0);
2017             }
2018             }
2019            
2020 1883           int32_t runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
2021            
2022 1883           opcode.operand0 = runtime_var_index_out;
2023 1883           opcode.operand1 = runtime_var_index_in;
2024            
2025 1883           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
2026             }
2027             else {
2028 0           assert(0);
2029             }
2030 1899           break;
2031             }
2032             case SPVM_OP_C_ID_CREATE_REF : {
2033            
2034 5030           SPVM_OPCODE opcode = {0};
2035            
2036            
2037 5030           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2038             int32_t runtime_var_index_in;
2039 5030           SPVM_TYPE* src_type = SPVM_CHECK_get_type(compiler, op_assign_src->first);
2040 5030 100         if (SPVM_TYPE_is_mulnum_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2041            
2042 54           SPVM_FIELD* first_field = SPVM_LIST_get(src_type->basic_type->fields, 0);
2043 54 50         assert(first_field);
2044            
2045 54           SPVM_TYPE* field_type = SPVM_CHECK_get_type(compiler, first_field->op_field);
2046 54 50         assert(SPVM_TYPE_is_numeric_type(compiler, field_type->basic_type->id, field_type->dimension, field_type->flag));
2047            
2048 54           switch (field_type->basic_type->id) {
2049             case SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE:
2050 10           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_REF_BYTE);
2051 10           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
2052 54           break;
2053             case SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT:
2054 8           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_REF_SHORT);
2055 8           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
2056 8           break;
2057             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT:
2058 8           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_REF_INT);
2059 8           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
2060 8           break;
2061             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG:
2062 8           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_REF_LONG);
2063 8           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
2064 8           break;
2065             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT:
2066 8           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_REF_FLOAT);
2067 8           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
2068 8           break;
2069             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE:
2070 12           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_REF_DOUBLE);
2071 12           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
2072 12           break;
2073             default:
2074 0           assert(0);
2075             }
2076             }
2077 4976 50         else if (SPVM_TYPE_is_numeric_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2078 4976           switch (src_type->basic_type->id) {
2079             case SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE:
2080 36           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_REF_BYTE);
2081 36           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
2082 4976           break;
2083             case SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT:
2084 34           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_REF_SHORT);
2085 34           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
2086 34           break;
2087             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT:
2088 4801           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_REF_INT);
2089 4801           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
2090 4801           break;
2091             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG:
2092 34           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_REF_LONG);
2093 34           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
2094 34           break;
2095             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT:
2096 34           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_REF_FLOAT);
2097 34           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
2098 34           break;
2099             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE:
2100 37           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_REF_DOUBLE);
2101 37           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
2102 37           break;
2103             default:
2104 0           assert(0);
2105             }
2106             }
2107             else {
2108 0           assert(0);
2109             }
2110            
2111 5030           opcode.operand0 = runtime_var_index_out;
2112 5030           opcode.operand1 = runtime_var_index_in;
2113            
2114 5030           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
2115 5030           break;
2116             }
2117             case SPVM_OP_C_ID_EXCEPTION_VAR : {
2118             // VAR = EXCEPTION_VAR
2119 2056           SPVM_OPCODE opcode = {0};
2120            
2121            
2122 2056           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_EXCEPTION_VAR);
2123              
2124 2056           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2125            
2126 2056           opcode.operand0 = runtime_var_index_out;
2127            
2128 2056           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
2129 2056           break;
2130             }
2131             case SPVM_OP_C_ID_ADD : {
2132            
2133 186932           SPVM_OPCODE opcode = {0};
2134            
2135            
2136 186932 50         assert(SPVM_TYPE_is_numeric_type(compiler, type_dist->basic_type->id, type_dist->dimension, type_dist->flag));
2137              
2138 186932           switch (type_dist->basic_type->id) {
2139             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT:
2140 185395           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_ADD_INT);
2141 185395           break;
2142             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG:
2143 338           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_ADD_LONG);
2144 338           break;
2145             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT:
2146 320           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_ADD_FLOAT);
2147 320           break;
2148             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE:
2149 879           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_ADD_DOUBLE);
2150 879           break;
2151             default:
2152 0           assert(0);
2153             }
2154            
2155 186932           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2156 186932           int32_t runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
2157 186932           int32_t runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
2158            
2159 186932           opcode.operand0 = runtime_var_index_out;
2160 186932           opcode.operand1 = runtime_var_index_in1;
2161 186932           opcode.operand2 = runtime_var_index_in2;
2162              
2163 186932           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
2164 186932           break;
2165             }
2166             case SPVM_OP_C_ID_SUBTRACT : {
2167              
2168 70400           SPVM_OPCODE opcode = {0};
2169            
2170              
2171 70400 50         assert(SPVM_TYPE_is_numeric_type(compiler, type_dist->basic_type->id, type_dist->dimension, type_dist->flag));
2172 70400           switch (type_dist->basic_type->id) {
2173             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT:
2174 70140           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SUBTRACT_INT);
2175 70140           break;
2176             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG:
2177 92           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SUBTRACT_LONG);
2178 92           break;
2179             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT:
2180 83           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SUBTRACT_FLOAT);
2181 83           break;
2182             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE:
2183 85           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SUBTRACT_DOUBLE);
2184 85           break;
2185             default:
2186 0           assert(0);
2187             }
2188              
2189 70400           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2190 70400           int32_t runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
2191 70400           int32_t runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
2192            
2193 70400           opcode.operand0 = runtime_var_index_out;
2194 70400           opcode.operand1 = runtime_var_index_in1;
2195 70400           opcode.operand2 = runtime_var_index_in2;
2196              
2197 70400           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
2198 70400           break;
2199             }
2200             case SPVM_OP_C_ID_MULTIPLY : {
2201              
2202 7583           SPVM_OPCODE opcode = {0};
2203            
2204              
2205 7583 50         assert(SPVM_TYPE_is_numeric_type(compiler, type_dist->basic_type->id, type_dist->dimension, type_dist->flag));
2206 7583           switch (type_dist->basic_type->id) {
2207             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT:
2208 6431           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MULTIPLY_INT);
2209 6431           break;
2210             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG:
2211 540           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MULTIPLY_LONG);
2212 540           break;
2213             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT:
2214 39           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MULTIPLY_FLOAT);
2215 39           break;
2216             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE:
2217 573           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MULTIPLY_DOUBLE);
2218 573           break;
2219             default:
2220 0           assert(0);
2221             }
2222              
2223 7583           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2224 7583           int32_t runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
2225 7583           int32_t runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
2226            
2227 7583           opcode.operand0 = runtime_var_index_out;
2228 7583           opcode.operand1 = runtime_var_index_in1;
2229 7583           opcode.operand2 = runtime_var_index_in2;
2230              
2231 7583           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
2232 7583           break;
2233             }
2234             case SPVM_OP_C_ID_DIVIDE : {
2235              
2236 5398           SPVM_OPCODE opcode = {0};
2237            
2238            
2239 5398 50         assert(SPVM_TYPE_is_numeric_type(compiler, type_dist->basic_type->id, type_dist->dimension, type_dist->flag));
2240 5398           switch (type_dist->basic_type->id) {
2241             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT:
2242 4258           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_DIVIDE_INT);
2243 4258           break;
2244             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG:
2245 8           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_DIVIDE_LONG);
2246 8           break;
2247             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT:
2248 39           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_DIVIDE_FLOAT);
2249 39           break;
2250             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE:
2251 1093           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_DIVIDE_DOUBLE);
2252 1093           break;
2253             default:
2254 0           assert(0);
2255             }
2256              
2257 5398           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2258 5398           int32_t runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
2259 5398           int32_t runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
2260            
2261 5398           opcode.operand0 = runtime_var_index_out;
2262 5398           opcode.operand1 = runtime_var_index_in1;
2263 5398           opcode.operand2 = runtime_var_index_in2;
2264            
2265 5398           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
2266            
2267             // Check die
2268 5398 100         switch (type_dist->basic_type->id) {
2269             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT:
2270             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG:
2271 4266           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_assign->line);
2272 4266           break;
2273             }
2274            
2275 5398           break;
2276             }
2277             case SPVM_OP_C_ID_DIVIDE_UNSIGNED_INT : {
2278              
2279 3           SPVM_OPCODE opcode = {0};
2280            
2281            
2282 3           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_DIVIDE_UNSIGNED_INT);
2283              
2284 3           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2285 3           int32_t runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
2286 3           int32_t runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
2287            
2288 3           opcode.operand0 = runtime_var_index_out;
2289 3           opcode.operand1 = runtime_var_index_in1;
2290 3           opcode.operand2 = runtime_var_index_in2;
2291            
2292 3           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
2293            
2294             // Check die
2295 3           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_assign->line);
2296 3           break;
2297             }
2298             case SPVM_OP_C_ID_DIVIDE_UNSIGNED_LONG : {
2299              
2300 3           SPVM_OPCODE opcode = {0};
2301            
2302            
2303 3           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_DIVIDE_UNSIGNED_LONG);
2304              
2305 3           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2306 3           int32_t runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
2307 3           int32_t runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
2308            
2309 3           opcode.operand0 = runtime_var_index_out;
2310 3           opcode.operand1 = runtime_var_index_in1;
2311 3           opcode.operand2 = runtime_var_index_in2;
2312            
2313 3           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
2314            
2315 3           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_assign->line);
2316            
2317 3           break;
2318             }
2319             case SPVM_OP_C_ID_REMAINDER : {
2320 2172           SPVM_OPCODE opcode = {0};
2321            
2322            
2323 2172 50         assert(SPVM_TYPE_is_numeric_type(compiler, type_dist->basic_type->id, type_dist->dimension, type_dist->flag));
2324             int32_t runtime_var_index_out;
2325             int32_t runtime_var_index_in1;
2326             int32_t runtime_var_index_in2;
2327 2172           switch (type_dist->basic_type->id) {
2328             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT:
2329 2156           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_REMAINDER_INT);
2330 2156           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2331 2156           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
2332 2156           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
2333 2156           break;
2334             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG:
2335 16           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_REMAINDER_LONG);
2336 16           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2337 16           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
2338 16           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
2339 16           break;
2340             default:
2341 0           assert(0);
2342             }
2343            
2344 2172           opcode.operand0 = runtime_var_index_out;
2345 2172           opcode.operand1 = runtime_var_index_in1;
2346 2172           opcode.operand2 = runtime_var_index_in2;
2347              
2348 2172           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
2349              
2350             // Check die
2351 2172 50         assert(SPVM_TYPE_is_numeric_type(compiler, type_dist->basic_type->id, type_dist->dimension, type_dist->flag));
2352 2172 50         switch (type_dist->basic_type->id) {
2353             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT:
2354             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG:
2355 2172           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_assign->line);
2356 2172           break;
2357             }
2358 2172           break;
2359             }
2360             case SPVM_OP_C_ID_REMAINDER_UNSIGNED_INT : {
2361              
2362 3           SPVM_OPCODE opcode = {0};
2363            
2364            
2365 3           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_REMAINDER_UNSIGNED_INT);
2366              
2367 3           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2368 3           int32_t runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
2369 3           int32_t runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
2370            
2371 3           opcode.operand0 = runtime_var_index_out;
2372 3           opcode.operand1 = runtime_var_index_in1;
2373 3           opcode.operand2 = runtime_var_index_in2;
2374            
2375 3           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
2376            
2377             // Check die
2378 3           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_assign->line);
2379 3           break;
2380             }
2381             case SPVM_OP_C_ID_REMAINDER_UNSIGNED_LONG : {
2382              
2383 525           SPVM_OPCODE opcode = {0};
2384            
2385            
2386 525           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_REMAINDER_UNSIGNED_LONG);
2387              
2388 525           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2389 525           int32_t runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
2390 525           int32_t runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
2391            
2392 525           opcode.operand0 = runtime_var_index_out;
2393 525           opcode.operand1 = runtime_var_index_in1;
2394 525           opcode.operand2 = runtime_var_index_in2;
2395            
2396 525           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
2397            
2398 525           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_assign->line);
2399            
2400 525           break;
2401             }
2402             case SPVM_OP_C_ID_LEFT_SHIFT : {
2403 51           SPVM_OPCODE opcode = {0};
2404            
2405            
2406 51 50         assert(SPVM_TYPE_is_numeric_type(compiler, type_dist->basic_type->id, type_dist->dimension, type_dist->flag));
2407             int32_t runtime_var_index_in1;
2408             int32_t runtime_var_index_out;
2409 51           switch (type_dist->basic_type->id) {
2410             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT:
2411 39           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_LEFT_SHIFT_INT);
2412 39           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
2413 39           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2414 39           break;
2415             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG:
2416 12           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_LEFT_SHIFT_LONG);
2417 12           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
2418 12           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2419 12           break;
2420             default:
2421 0           assert(0);
2422             }
2423              
2424 51           int32_t runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
2425            
2426 51           opcode.operand0 = runtime_var_index_out;
2427 51           opcode.operand1 = runtime_var_index_in1;
2428 51           opcode.operand2 = runtime_var_index_in2;
2429              
2430 51           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
2431 51           break;
2432             }
2433             case SPVM_OP_C_ID_RIGHT_ARITHMETIC_SHIFT : {
2434 35           SPVM_OPCODE opcode = {0};
2435            
2436            
2437 35 50         assert(SPVM_TYPE_is_numeric_type(compiler, type_dist->basic_type->id, type_dist->dimension, type_dist->flag));
2438             int32_t runtime_var_index_in1;
2439             int32_t runtime_var_index_out;
2440 35           switch (type_dist->basic_type->id) {
2441             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT:
2442 25           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_RIGHT_ARITHMETIC_SHIFT_INT);
2443 25           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
2444 25           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2445 25           break;
2446             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG:
2447 10           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_RIGHT_ARITHMETIC_SHIFT_LONG);
2448 10           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
2449 10           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2450 10           break;
2451             default:
2452 0           assert(0);
2453             }
2454              
2455 35           int32_t runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
2456            
2457 35           opcode.operand0 = runtime_var_index_out;
2458 35           opcode.operand1 = runtime_var_index_in1;
2459 35           opcode.operand2 = runtime_var_index_in2;
2460              
2461 35           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
2462 35           break;
2463             }
2464             case SPVM_OP_C_ID_RIGHT_LOGICAL_SHIFT : {
2465 35           SPVM_OPCODE opcode = {0};
2466            
2467            
2468 35 50         assert(SPVM_TYPE_is_numeric_type(compiler, type_dist->basic_type->id, type_dist->dimension, type_dist->flag));
2469             int32_t runtime_var_index_out;
2470             int32_t runtime_var_index_in1;
2471 35           switch (type_dist->basic_type->id) {
2472             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT:
2473 25           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_RIGHT_LOGICAL_SHIFT_INT);
2474 25           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2475 25           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
2476 25           break;
2477             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG:
2478 10           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_RIGHT_LOGICAL_SHIFT_LONG);
2479 10           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2480 10           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
2481 10           break;
2482             default:
2483 0           assert(0);
2484             }
2485              
2486 35           int32_t runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
2487            
2488 35           opcode.operand0 = runtime_var_index_out;
2489 35           opcode.operand1 = runtime_var_index_in1;
2490 35           opcode.operand2 = runtime_var_index_in2;
2491              
2492 35           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
2493 35           break;
2494             }
2495             case SPVM_OP_C_ID_BIT_AND : {
2496 1110           SPVM_OPCODE opcode = {0};
2497            
2498            
2499 1110 50         assert(SPVM_TYPE_is_numeric_type(compiler, type_dist->basic_type->id, type_dist->dimension, type_dist->flag));
2500             int32_t runtime_var_index_out;
2501             int32_t runtime_var_index_in1;
2502             int32_t runtime_var_index_in2;
2503 1110           switch (type_dist->basic_type->id) {
2504             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT:
2505 1105           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_BIT_AND_INT);
2506 1105           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2507 1105           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
2508 1105           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
2509 1105           break;
2510             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG:
2511 5           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_BIT_AND_LONG);
2512 5           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2513 5           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
2514 5           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
2515 5           break;
2516             default:
2517 0           assert(0);
2518             }
2519              
2520            
2521 1110           opcode.operand0 = runtime_var_index_out;
2522 1110           opcode.operand1 = runtime_var_index_in1;
2523 1110           opcode.operand2 = runtime_var_index_in2;
2524              
2525 1110           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
2526 1110           break;
2527             }
2528             case SPVM_OP_C_ID_BIT_OR : {
2529              
2530 44           SPVM_OPCODE opcode = {0};
2531            
2532            
2533 44 50         assert(SPVM_TYPE_is_numeric_type(compiler, type_dist->basic_type->id, type_dist->dimension, type_dist->flag));
2534             int32_t runtime_var_index_out;
2535             int32_t runtime_var_index_in1;
2536             int32_t runtime_var_index_in2;
2537 44           switch (type_dist->basic_type->id) {
2538             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT:
2539 39           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_BIT_OR_INT);
2540 39           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2541 39           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
2542 39           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
2543 39           break;
2544             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG:
2545 5           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_BIT_OR_LONG);
2546 5           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2547 5           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
2548 5           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
2549 5           break;
2550             default:
2551 0           assert(0);
2552             }
2553              
2554 44           opcode.operand0 = runtime_var_index_out;
2555 44           opcode.operand1 = runtime_var_index_in1;
2556 44           opcode.operand2 = runtime_var_index_in2;
2557              
2558 44           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
2559 44           break;
2560             }
2561             case SPVM_OP_C_ID_BIT_XOR : {
2562              
2563 44           SPVM_OPCODE opcode = {0};
2564            
2565            
2566 44 50         assert(SPVM_TYPE_is_numeric_type(compiler, type_dist->basic_type->id, type_dist->dimension, type_dist->flag));
2567             int32_t runtime_var_index_out;
2568             int32_t runtime_var_index_in1;
2569             int32_t runtime_var_index_in2;
2570 44           switch (type_dist->basic_type->id) {
2571             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT:
2572 39           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_BIT_XOR_INT);
2573 39           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2574 39           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
2575 39           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
2576 39           break;
2577             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG:
2578 5           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_BIT_XOR_LONG);
2579 5           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2580 5           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
2581 5           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
2582 5           break;
2583             default:
2584 0           assert(0);
2585             }
2586              
2587 44           opcode.operand0 = runtime_var_index_out;
2588 44           opcode.operand1 = runtime_var_index_in1;
2589 44           opcode.operand2 = runtime_var_index_in2;
2590              
2591 44           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
2592 44           break;
2593             }
2594             case SPVM_OP_C_ID_BIT_NOT : {
2595              
2596 37           SPVM_OPCODE opcode = {0};
2597            
2598              
2599 37 50         assert(SPVM_TYPE_is_numeric_type(compiler, type_dist->basic_type->id, type_dist->dimension, type_dist->flag));
2600             int32_t runtime_var_index_out;
2601             int32_t runtime_var_index_in;
2602 37           switch (type_dist->basic_type->id) {
2603             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT:
2604 29           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_BIT_NOT_INT);
2605 29           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2606 29           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
2607 29           break;
2608             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG:
2609 8           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_BIT_NOT_LONG);
2610 8           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2611 8           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
2612 8           break;
2613             default:
2614 0           assert(0);
2615             }
2616            
2617 37           opcode.operand0 = runtime_var_index_out;
2618 37           opcode.operand1 = runtime_var_index_in;
2619            
2620 37           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
2621 37           break;
2622             }
2623             case SPVM_OP_C_ID_PLUS : {
2624              
2625 38           SPVM_OPCODE opcode = {0};
2626            
2627            
2628 38 50         assert(SPVM_TYPE_is_numeric_type(compiler, type_dist->basic_type->id, type_dist->dimension, type_dist->flag));
2629             int32_t runtime_var_index_out;
2630             int32_t runtime_var_index_in;
2631 38           switch (type_dist->basic_type->id) {
2632             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT:
2633 21           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_INT);
2634 21           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2635 21           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
2636 21           break;
2637             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG:
2638 5           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_LONG);
2639 5           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2640 5           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
2641 5           break;
2642             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT:
2643 4           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_FLOAT);
2644 4           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2645 4           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
2646 4           break;
2647             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE:
2648 8           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_DOUBLE);
2649 8           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2650 8           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
2651 8           break;
2652             default:
2653 0           assert(0);
2654             }
2655            
2656 38           opcode.operand0 = runtime_var_index_out;
2657 38           opcode.operand1 = runtime_var_index_in;
2658            
2659 38           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
2660 38           break;
2661             }
2662             case SPVM_OP_C_ID_COPY : {
2663              
2664 1629           SPVM_OPCODE opcode = {0};
2665            
2666            
2667 1629           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_COPY);
2668 1629           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2669 1629           int32_t runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
2670            
2671 1629           opcode.operand0 = runtime_var_index_out;
2672 1629           opcode.operand1 = runtime_var_index_in;
2673            
2674 1629           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
2675              
2676 1629           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_assign->line);
2677 1629           break;
2678             }
2679             case SPVM_OP_C_ID_MINUS : {
2680              
2681 1084           SPVM_OPCODE opcode = {0};
2682            
2683            
2684 1084 50         assert(SPVM_TYPE_is_numeric_type(compiler, type_dist->basic_type->id, type_dist->dimension, type_dist->flag));
2685             int32_t runtime_var_index_out;
2686             int32_t runtime_var_index_in;
2687 1084           switch (type_dist->basic_type->id) {
2688             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT:
2689 544           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_NEGATE_INT);
2690 544           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2691 544           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
2692 544           break;
2693             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG:
2694 528           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_NEGATE_LONG);
2695 528           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2696 528           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
2697 528           break;
2698             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT:
2699 6           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_NEGATE_FLOAT);
2700 6           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2701 6           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
2702 6           break;
2703             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE:
2704 6           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_NEGATE_DOUBLE);
2705 6           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2706 6           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
2707 6           break;
2708             default:
2709 0           assert(0);
2710             }
2711            
2712 1084           opcode.operand0 = runtime_var_index_out;
2713 1084           opcode.operand1 = runtime_var_index_in;
2714            
2715 1084           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
2716 1084           break;
2717             }
2718             case SPVM_OP_C_ID_CONSTANT : {
2719 932577           SPVM_CONSTANT* constant = op_assign_src->uv.constant;
2720              
2721 932577 100         if (SPVM_TYPE_is_numeric_type(compiler, type_dist->basic_type->id, type_dist->dimension, type_dist->flag)) {
2722 737438           SPVM_OPCODE opcode = {0};
2723            
2724              
2725             int32_t runtime_var_index_out;
2726 737438           switch (type_dist->basic_type->id) {
2727             case SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE:
2728 42772           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_CONSTANT_BYTE);
2729 42772           opcode.operand1 = (uint16_t)(uint8_t)constant->value.bval;
2730 42772           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2731 42772           break;
2732             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT:
2733 685851           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_CONSTANT_INT);
2734 685851           opcode.operand1 = (uint32_t)constant->value.ival;
2735 685851           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2736 685851           break;
2737             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG:
2738 5413           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_CONSTANT_LONG);
2739 5413           *(int64_t*)&opcode.operand1 = constant->value.lval;
2740 5413           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2741 5413           break;
2742             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT:
2743 1322           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_CONSTANT_FLOAT);
2744 1322           opcode.operand1 = (uint32_t)constant->value.ival;
2745 1322           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2746 1322           break;
2747             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE:
2748 2080           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_CONSTANT_DOUBLE);
2749 2080           *(double*)&opcode.operand1 = constant->value.dval;
2750 2080           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2751 2080           break;
2752             default:
2753 0           assert(0);
2754             }
2755            
2756 737438           opcode.operand0 = runtime_var_index_out;
2757            
2758 737438           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
2759             }
2760 195139 50         else if (SPVM_TYPE_is_string_type(compiler, type_dist->basic_type->id, type_dist->dimension, type_dist->flag)) {
2761 195139           SPVM_OPCODE opcode = {0};
2762            
2763            
2764 195139           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_NEW_STRING);
2765            
2766 195139           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
2767 195139           SPVM_CONSTANT* constant = op_assign_src->uv.constant;
2768            
2769 195139           const char* constant_string_value = constant->value.oval;
2770 195139           int32_t constant_string_length = constant->string_length;
2771 195139           SPVM_STRING* global_constant_string = SPVM_HASH_get(compiler->constant_string_symtable, constant_string_value, constant_string_length);
2772 195139 50         assert(global_constant_string);
2773            
2774 195139           opcode.operand0 = runtime_var_index_out;
2775            
2776 195139           SPVM_STRING* constant_string = SPVM_HASH_get(basic_type->constant_string_symtable, constant_string_value, constant_string_length);
2777 195139 50         assert(constant_string);
2778            
2779 195139 50         assert(constant_string->index >= 0);
2780 195139           opcode.operand1 = constant_string->index;
2781            
2782 195139           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
2783            
2784             }
2785             else {
2786 0           assert(0);
2787             }
2788 932577           break;
2789             }
2790             case SPVM_OP_C_ID_TYPE_CAST : {
2791            
2792 151499           SPVM_OP* op_dist_term = op_assign_dist;
2793 151499           SPVM_OP* op_src_term = op_assign_src->first;
2794 151499           SPVM_OP* op_cast_type = op_assign_src->last;
2795            
2796 151499           SPVM_TYPE* src_type = SPVM_CHECK_get_type(compiler, op_src_term);
2797 151499           SPVM_TYPE* cast_type = SPVM_CHECK_get_type(compiler, op_cast_type);
2798              
2799             // Source is undef type
2800 151499 100         if (SPVM_TYPE_is_undef_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2801 2240           SPVM_OPCODE opcode = {0};
2802 2240 50         if (SPVM_TYPE_is_object_type(compiler, cast_type->basic_type->id, cast_type->dimension, cast_type->flag)) {
2803            
2804 2240           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_OBJECT_UNDEF);
2805            
2806 2240           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_dist_term);
2807 2240           opcode.operand0 = runtime_var_index_out;
2808            
2809 2240           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
2810             }
2811             else {
2812 0           assert(0);
2813             }
2814             }
2815             else {
2816 149259           SPVM_OPCODE opcode = {0};
2817 149259           int32_t throw_exception = 0;
2818             int32_t runtime_var_index_out;
2819             int32_t runtime_var_index_in;
2820              
2821 149259           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_dist_term);
2822 149259           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_src_term);
2823            
2824             // To byte
2825 149259 100         if (SPVM_TYPE_is_byte_type(compiler, cast_type->basic_type->id, cast_type->dimension, cast_type->flag)) {
2826 9516 50         if (SPVM_TYPE_is_byte_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2827 0           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_BYTE);
2828             }
2829 9516 100         else if (SPVM_TYPE_is_short_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2830 5           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_SHORT_TO_BYTE);
2831             }
2832 9511 100         else if (SPVM_TYPE_is_int_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2833 8960           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_INT_TO_BYTE);
2834             }
2835 551 100         else if (SPVM_TYPE_is_long_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2836 4           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_LONG_TO_BYTE);
2837             }
2838 547 100         else if (SPVM_TYPE_is_float_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2839 4           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_FLOAT_TO_BYTE);
2840             }
2841 543 100         else if (SPVM_TYPE_is_double_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2842 4           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_DOUBLE_TO_BYTE);
2843             }
2844 539 100         else if (SPVM_TYPE_is_byte_object_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2845 8           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_BYTE_OBJECT_TO_BYTE);
2846 8           throw_exception = 1;
2847             }
2848 531 50         else if (SPVM_TYPE_is_any_object_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2849 531           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_BYTE_OBJECT_TO_BYTE);
2850 531           throw_exception = 1;
2851             }
2852             else {
2853 0           assert(0);
2854             }
2855             }
2856             // To short
2857 139743 100         else if (SPVM_TYPE_is_short_type(compiler, cast_type->basic_type->id, cast_type->dimension, cast_type->flag)) {
2858 5687 100         if (SPVM_TYPE_is_byte_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2859 11           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_BYTE_TO_SHORT);
2860             }
2861 5676 50         else if (SPVM_TYPE_is_short_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2862 0           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_SHORT);
2863             }
2864 5676 100         else if (SPVM_TYPE_is_int_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2865 5126           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_INT_TO_SHORT);
2866             }
2867 550 100         else if (SPVM_TYPE_is_long_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2868 4           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_LONG_TO_SHORT);
2869             }
2870 546 100         else if (SPVM_TYPE_is_float_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2871 4           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_FLOAT_TO_SHORT);
2872             }
2873 542 100         else if (SPVM_TYPE_is_double_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2874 4           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_DOUBLE_TO_SHORT);
2875             }
2876 538 100         else if (SPVM_TYPE_is_short_object_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2877 7           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_SHORT_OBJECT_TO_SHORT);
2878 7           throw_exception = 1;
2879             }
2880 531 50         else if (SPVM_TYPE_is_any_object_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2881 531           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_SHORT_OBJECT_TO_SHORT);
2882 531           throw_exception = 1;
2883             }
2884             else {
2885 0           assert(0);
2886             }
2887             }
2888             // To int
2889 134056 100         else if (SPVM_TYPE_is_int_type(compiler, cast_type->basic_type->id, cast_type->dimension, cast_type->flag)) {
2890 87240 100         if (SPVM_TYPE_is_byte_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2891 77146           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_BYTE_TO_INT);
2892             }
2893 10094 100         else if (SPVM_TYPE_is_short_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2894 6809           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_SHORT_TO_INT);
2895             }
2896 3285 50         else if (SPVM_TYPE_is_int_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2897 0           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_INT);
2898             }
2899 3285 100         else if (SPVM_TYPE_is_long_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2900 531           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_LONG_TO_INT);
2901             }
2902 2754 100         else if (SPVM_TYPE_is_float_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2903 4           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_FLOAT_TO_INT);
2904             }
2905 2750 100         else if (SPVM_TYPE_is_double_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2906 8           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_DOUBLE_TO_INT);
2907             }
2908 2742 100         else if (SPVM_TYPE_is_int_object_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2909 2149           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_INT_OBJECT_TO_INT);
2910 2149           throw_exception = 1;
2911             }
2912 593 50         else if (SPVM_TYPE_is_any_object_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2913 593           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_INT_OBJECT_TO_INT);
2914 593           throw_exception = 1;
2915             }
2916             else {
2917 0           assert(0);
2918             }
2919             }
2920             // To long
2921 46816 100         else if (SPVM_TYPE_is_long_type(compiler, cast_type->basic_type->id, cast_type->dimension, cast_type->flag)) {
2922 8192 100         if (SPVM_TYPE_is_byte_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2923 11           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_BYTE_TO_LONG);
2924             }
2925 8181 100         else if (SPVM_TYPE_is_short_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2926 6           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_SHORT_TO_LONG);
2927             }
2928 8175 100         else if (SPVM_TYPE_is_int_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2929 5541           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_INT_TO_LONG);
2930             }
2931 2634 50         else if (SPVM_TYPE_is_long_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2932 0           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_LONG);
2933             }
2934 2634 100         else if (SPVM_TYPE_is_float_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2935 4           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_FLOAT_TO_LONG);
2936             }
2937 2630 100         else if (SPVM_TYPE_is_double_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2938 4           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_DOUBLE_TO_LONG);
2939             }
2940 2626 100         else if (SPVM_TYPE_is_long_object_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2941 2095           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_LONG_OBJECT_TO_LONG);
2942 2095           throw_exception = 1;
2943             }
2944 531 50         else if (SPVM_TYPE_is_any_object_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2945 531           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_LONG_OBJECT_TO_LONG);
2946 531           throw_exception = 1;
2947             }
2948             else {
2949 0           assert(0);
2950             }
2951             }
2952             // To float
2953 38624 100         else if (SPVM_TYPE_is_float_type(compiler, cast_type->basic_type->id, cast_type->dimension, cast_type->flag)) {
2954 2634 100         if (SPVM_TYPE_is_byte_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2955 28           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_BYTE_TO_FLOAT);
2956             }
2957 2606 100         else if (SPVM_TYPE_is_short_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2958 24           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_SHORT_TO_FLOAT);
2959             }
2960 2582 100         else if (SPVM_TYPE_is_int_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2961 2025           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_INT_TO_FLOAT);
2962             }
2963 557 100         else if (SPVM_TYPE_is_long_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2964 7           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_LONG_TO_FLOAT);
2965             }
2966 550 50         else if (SPVM_TYPE_is_float_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2967 0           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_FLOAT);
2968             }
2969 550 100         else if (SPVM_TYPE_is_double_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2970 12           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_DOUBLE_TO_FLOAT);
2971             }
2972 538 100         else if (SPVM_TYPE_is_float_object_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2973 7           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_FLOAT_OBJECT_TO_FLOAT);
2974 7           throw_exception = 1;
2975             }
2976 531 50         else if (SPVM_TYPE_is_any_object_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2977 531           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_FLOAT_OBJECT_TO_FLOAT);
2978 531           throw_exception = 1;
2979             }
2980             else {
2981 0           assert(0);
2982             }
2983             }
2984             // To double
2985 35990 100         else if (SPVM_TYPE_is_double_type(compiler, cast_type->basic_type->id, cast_type->dimension, cast_type->flag)) {
2986 7053 100         if (SPVM_TYPE_is_byte_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2987 28           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_BYTE_TO_DOUBLE);
2988             }
2989 7025 100         else if (SPVM_TYPE_is_short_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2990 25           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_SHORT_TO_DOUBLE);
2991             }
2992 7000 100         else if (SPVM_TYPE_is_int_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2993 5303           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_INT_TO_DOUBLE);
2994             }
2995 1697 100         else if (SPVM_TYPE_is_long_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2996 4           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_LONG_TO_DOUBLE);
2997             }
2998 1693 100         else if (SPVM_TYPE_is_float_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
2999 1153           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_FLOAT_TO_DOUBLE);
3000             }
3001 540 50         else if (SPVM_TYPE_is_double_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3002 0           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_DOUBLE);
3003             }
3004 540 100         else if (SPVM_TYPE_is_double_object_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3005 8           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_DOUBLE_OBJECT_TO_DOUBLE);
3006 8           throw_exception = 1;
3007             }
3008 532 50         else if (SPVM_TYPE_is_any_object_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3009 532           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_DOUBLE_OBJECT_TO_DOUBLE);
3010 532           throw_exception = 1;
3011             }
3012             else {
3013 0           assert(0);
3014             }
3015             }
3016             // To mulnum
3017 28937 50         else if (SPVM_TYPE_is_mulnum_type(compiler, cast_type->basic_type->id, cast_type->dimension, cast_type->flag)) {
3018             // Not yet implemented
3019 0           assert(0);
3020             }
3021             // To Byte object
3022 28937 100         else if (SPVM_TYPE_is_byte_object_type(compiler, cast_type->basic_type->id, cast_type->dimension, cast_type->flag)) {
3023 533 50         if (SPVM_TYPE_is_byte_object_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3024 0           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_OBJECT);
3025             }
3026 533 100         else if (SPVM_TYPE_is_byte_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3027 6           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_BYTE_TO_BYTE_OBJECT);
3028             }
3029 527 50         else if (SPVM_TYPE_is_any_object_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3030 527           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_OBJECT_WITH_TYPE_CHECKING);
3031 527           opcode.operand2 = op_cast_type->uv.type->basic_type->id;
3032 527           int32_t operand3 = op_cast_type->uv.type->dimension;
3033 527 50         assert(operand3 < 0xFFFF);
3034 527           opcode.operand3 = operand3;
3035 527           throw_exception = 1;
3036             }
3037             else {
3038 0           assert(0);
3039             }
3040             }
3041             // To Short object
3042 28404 100         else if (SPVM_TYPE_is_short_object_type(compiler, cast_type->basic_type->id, cast_type->dimension, cast_type->flag)) {
3043 10 50         if (SPVM_TYPE_is_short_object_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3044 0           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_OBJECT);
3045             }
3046 10 100         else if (SPVM_TYPE_is_short_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3047 6           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_SHORT_TO_SHORT_OBJECT);
3048             }
3049 4 50         else if (SPVM_TYPE_is_any_object_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3050 4           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_OBJECT_WITH_TYPE_CHECKING);
3051 4           opcode.operand2 = op_cast_type->uv.type->basic_type->id;
3052 4           int32_t operand3 = op_cast_type->uv.type->dimension;
3053 4 50         assert(operand3 < 0xFFFF);
3054 4           opcode.operand3 = operand3;
3055 4           throw_exception = 1;
3056             }
3057             else {
3058 0           assert(0);
3059             }
3060             }
3061             // To Int object
3062 28394 100         else if (SPVM_TYPE_is_int_object_type(compiler, cast_type->basic_type->id, cast_type->dimension, cast_type->flag)) {
3063 2700 50         if (SPVM_TYPE_is_int_object_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3064 0           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_OBJECT);
3065             }
3066 2700 100         else if (SPVM_TYPE_is_int_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3067 18           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_INT_TO_INT_OBJECT);
3068             }
3069 2682 50         else if (SPVM_TYPE_is_any_object_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3070 2682           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_OBJECT_WITH_TYPE_CHECKING);
3071 2682           opcode.operand2 = op_cast_type->uv.type->basic_type->id;
3072 2682           int32_t operand3 = op_cast_type->uv.type->dimension;
3073 2682 50         assert(operand3 < 0xFFFF);
3074 2682           opcode.operand3 = operand3;
3075 2682           throw_exception = 1;
3076             }
3077             else {
3078 0           assert(0);
3079             }
3080             }
3081             // To Long object
3082 25694 100         else if (SPVM_TYPE_is_long_object_type(compiler, cast_type->basic_type->id, cast_type->dimension, cast_type->flag)) {
3083 2100 50         if (SPVM_TYPE_is_long_object_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3084 0           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_OBJECT);
3085             }
3086 2100 100         else if (SPVM_TYPE_is_long_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3087 6           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_LONG_TO_LONG_OBJECT);
3088             }
3089 2094 50         else if (SPVM_TYPE_is_any_object_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3090 2094           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_OBJECT_WITH_TYPE_CHECKING);
3091 2094           opcode.operand2 = op_cast_type->uv.type->basic_type->id;
3092 2094           int32_t operand3 = op_cast_type->uv.type->dimension;
3093 2094 50         assert(operand3 < 0xFFFF);
3094 2094           opcode.operand3 = operand3;
3095 2094           throw_exception = 1;
3096             }
3097             else {
3098 0           assert(0);
3099             }
3100             }
3101             // To Float object
3102 23594 100         else if (SPVM_TYPE_is_float_object_type(compiler, cast_type->basic_type->id, cast_type->dimension, cast_type->flag)) {
3103 1054 50         if (SPVM_TYPE_is_float_object_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3104 0           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_OBJECT);
3105             }
3106 1054 100         else if (SPVM_TYPE_is_float_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3107 6           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_FLOAT_TO_FLOAT_OBJECT);
3108             }
3109 1048 50         else if (SPVM_TYPE_is_any_object_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3110 1048           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_OBJECT_WITH_TYPE_CHECKING);
3111 1048           opcode.operand2 = op_cast_type->uv.type->basic_type->id;
3112 1048           int32_t operand3 = op_cast_type->uv.type->dimension;
3113 1048 50         assert(operand3 < 0xFFFF);
3114 1048           opcode.operand3 = operand3;
3115 1048           throw_exception = 1;
3116             }
3117             else {
3118 0           assert(0);
3119             }
3120             }
3121             // To Double object
3122 22540 100         else if (SPVM_TYPE_is_double_object_type(compiler, cast_type->basic_type->id, cast_type->dimension, cast_type->flag)) {
3123 1060 50         if (SPVM_TYPE_is_double_object_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3124 0           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_OBJECT);
3125             }
3126 1060 100         else if (SPVM_TYPE_is_double_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3127 6           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_DOUBLE_TO_DOUBLE_OBJECT);
3128             }
3129 1054 50         else if (SPVM_TYPE_is_any_object_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3130 1054           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_OBJECT_WITH_TYPE_CHECKING);
3131 1054           opcode.operand2 = op_cast_type->uv.type->basic_type->id;
3132 1054           int32_t operand3 = op_cast_type->uv.type->dimension;
3133 1054 50         assert(operand3 < 0xFFFF);
3134 1054           opcode.operand3 = operand3;
3135 1054           throw_exception = 1;
3136             }
3137             else {
3138 0           assert(0);
3139             }
3140             }
3141             // To String
3142 21480 100         else if (SPVM_TYPE_is_string_type(compiler, cast_type->basic_type->id, cast_type->dimension, cast_type->flag)) {
3143 13655 100         if (SPVM_TYPE_is_string_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3144 5306 100         if (cast_type->flag & SPVM_NATIVE_C_TYPE_FLAG_MUTABLE && !(src_type->flag & SPVM_NATIVE_C_TYPE_FLAG_MUTABLE)) {
    50          
3145 5305           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_OBJECT_CHECK_READ_ONLY);
3146 5305           throw_exception = 1;
3147             }
3148             else {
3149 5306           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_OBJECT);
3150             }
3151             }
3152 8349 100         else if (SPVM_TYPE_is_byte_array_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3153 28           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_BYTE_ARRAY_TO_STRING);
3154             }
3155 8321 100         else if (SPVM_TYPE_is_any_object_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3156 4260           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_OBJECT_WITH_TYPE_CHECKING);
3157 4260           opcode.operand2 = op_cast_type->uv.type->basic_type->id;
3158 4260           int32_t operand3 = op_cast_type->uv.type->dimension;
3159 4260 50         assert(operand3 < 0xFFFF);
3160 4260           opcode.operand3 = operand3;
3161 4260           throw_exception = 1;
3162             }
3163 4061 100         else if (SPVM_TYPE_is_byte_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3164 16           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_BYTE_TO_STRING);
3165             }
3166 4045 100         else if (SPVM_TYPE_is_short_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3167 10           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_SHORT_TO_STRING);
3168             }
3169 4035 100         else if (SPVM_TYPE_is_int_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3170 3812           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_INT_TO_STRING);
3171             }
3172 223 100         else if (SPVM_TYPE_is_long_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3173 49           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_LONG_TO_STRING);
3174             }
3175 174 100         else if (SPVM_TYPE_is_float_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3176 79           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_FLOAT_TO_STRING);
3177             }
3178 95 50         else if (SPVM_TYPE_is_double_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3179 95           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_DOUBLE_TO_STRING);
3180             }
3181             else {
3182 0           assert(0);
3183             }
3184             }
3185             // To byte[]
3186 7825 100         else if (SPVM_TYPE_is_byte_array_type(compiler, cast_type->basic_type->id, cast_type->dimension, cast_type->flag)) {
3187 72 50         if (SPVM_TYPE_is_byte_array_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3188 0           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_OBJECT);
3189             }
3190 72 100         else if (SPVM_TYPE_is_string_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3191 64           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_STRING_TO_BYTE_ARRAY);
3192             }
3193 8 50         else if (SPVM_TYPE_is_any_object_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3194 8           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_OBJECT_WITH_TYPE_CHECKING);
3195 8           opcode.operand2 = op_cast_type->uv.type->basic_type->id;
3196 8           int32_t operand3 = op_cast_type->uv.type->dimension;
3197 8 50         assert(operand3 < 0xFFFF);
3198 8           opcode.operand3 = operand3;
3199 8           throw_exception = 1;
3200             }
3201             else {
3202 0           assert(0);
3203             }
3204             }
3205             // To any object
3206 7753 100         else if (SPVM_TYPE_is_any_object_type(compiler, cast_type->basic_type->id, cast_type->dimension, cast_type->flag)) {
3207 5363 100         if (SPVM_TYPE_is_object_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3208 2779           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_OBJECT);
3209             }
3210 2584 100         else if (SPVM_TYPE_is_byte_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3211 28           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_BYTE_TO_BYTE_OBJECT);
3212             }
3213 2556 100         else if (SPVM_TYPE_is_short_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3214 12           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_SHORT_TO_SHORT_OBJECT);
3215             }
3216 2544 100         else if (SPVM_TYPE_is_int_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3217 1898           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_INT_TO_INT_OBJECT);
3218             }
3219 646 100         else if (SPVM_TYPE_is_long_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3220 586           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_LONG_TO_LONG_OBJECT);
3221             }
3222 60 100         else if (SPVM_TYPE_is_float_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3223 16           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_FLOAT_TO_FLOAT_OBJECT);
3224             }
3225 44 50         else if (SPVM_TYPE_is_double_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3226 44           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_TYPE_CONVERSION_DOUBLE_TO_DOUBLE_OBJECT);
3227             }
3228             else {
3229 0           assert(0);
3230             }
3231             }
3232             // To object type
3233 2390 50         else if (SPVM_TYPE_is_object_type(compiler, cast_type->basic_type->id, cast_type->dimension, cast_type->flag)) {
3234 2390 50         if (SPVM_TYPE_is_object_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
3235 2390           int32_t cast_type_basic_type_id = op_cast_type->uv.type->basic_type->id;
3236 2390           int32_t cast_type_dimension = op_cast_type->uv.type->dimension;
3237 2390           int32_t cast_type_flag = op_cast_type->uv.type->flag;
3238            
3239 2390           int32_t src_type_basic_type_id = src_type->basic_type->id;
3240 2390           int32_t src_type_dimension = src_type->dimension;
3241 2390           int32_t src_type_flag = src_type->flag;
3242              
3243 2390           int32_t need_implicite_conversion = 0;
3244 2390           int32_t allow_narrowing_conversion = 0;
3245            
3246 2390           int32_t runtime_assignability = SPVM_TYPE_can_assign(
3247             compiler,
3248             cast_type_basic_type_id, cast_type_dimension, cast_type_flag,
3249             src_type_basic_type_id, src_type_dimension, src_type_flag,
3250             &need_implicite_conversion, allow_narrowing_conversion
3251             );
3252 2390 50         assert(need_implicite_conversion == 0);
3253            
3254 2390 100         if (runtime_assignability) {
3255 64           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_OBJECT);
3256             }
3257             else {
3258 2326           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_OBJECT_WITH_TYPE_CHECKING);
3259 2326           opcode.operand2 = op_cast_type->uv.type->basic_type->id;
3260 2326           int32_t operand3 = op_cast_type->uv.type->dimension;
3261 2326 50         assert(operand3 < 0xFFFF);
3262 2326           opcode.operand3 = operand3;
3263 2390           throw_exception = 1;
3264             }
3265             }
3266             else {
3267 0           assert(0);
3268             }
3269             }
3270              
3271 149259           opcode.operand0 = runtime_var_index_out;
3272 149259           opcode.operand1 = runtime_var_index_in;
3273            
3274 149259           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
3275            
3276 149259 100         if (throw_exception) {
3277 149259           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_assign->line);
3278             }
3279             }
3280            
3281            
3282 151499           break;
3283             }
3284             case SPVM_OP_C_ID_NEW : {
3285            
3286 102106 100         if (op_assign_src->first->id == SPVM_OP_C_ID_TYPE || op_assign_src->first->id == SPVM_OP_C_ID_VAR) {
    50          
3287            
3288 51053           SPVM_TYPE* type = SPVM_CHECK_get_type(compiler, op_assign_src);
3289            
3290             // Runtime type
3291 51053           int32_t basic_type_id = type->basic_type->id;
3292 51053           int32_t type_dimension = type->dimension;
3293            
3294 51053 100         if (type_dimension > 0) {
3295             /*
3296             NEW op_assign_src
3297             TYPE op_assign_src->first
3298             ELEMENT_TYPE op_assign_src->first->first
3299             INDEX op_assign_src->last
3300             */
3301            
3302 29851 100         if (type_dimension == 1) {
3303 29794           switch (basic_type_id) {
3304             case SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE: {
3305 2165           SPVM_OPCODE opcode = {0};
3306            
3307 2165           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_NEW_BYTE_ARRAY);
3308              
3309 2165           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
3310 2165           int32_t runtime_var_index_index = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3311              
3312 2165           opcode.operand0 = runtime_var_index_out;
3313 2165           opcode.operand1 = runtime_var_index_index;
3314              
3315 2165           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
3316              
3317 2165           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_assign->line);
3318            
3319 2165           break;
3320             }
3321             case SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT: {
3322 2041           SPVM_OPCODE opcode = {0};
3323            
3324 2041           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_NEW_SHORT_ARRAY);
3325              
3326 2041           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
3327 2041           int32_t runtime_var_index_index = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3328            
3329 2041           opcode.operand0 = runtime_var_index_out;
3330 2041           opcode.operand1 = runtime_var_index_index;
3331              
3332 2041           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
3333              
3334 2041           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_assign->line);
3335            
3336 2041           break;
3337             }
3338             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT: {
3339 4821           SPVM_OPCODE opcode = {0};
3340            
3341              
3342 4821           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_NEW_INT_ARRAY);
3343              
3344 4821           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
3345 4821           int32_t runtime_var_index_index = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3346              
3347 4821           opcode.operand0 = runtime_var_index_out;
3348 4821           opcode.operand1 = runtime_var_index_index;
3349              
3350 4821           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
3351              
3352 4821           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_assign->line);
3353            
3354 4821           break;
3355             }
3356             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG: {
3357 2032           SPVM_OPCODE opcode = {0};
3358            
3359              
3360 2032           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_NEW_LONG_ARRAY);
3361              
3362 2032           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
3363 2032           int32_t runtime_var_index_index = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3364              
3365 2032           opcode.operand0 = runtime_var_index_out;
3366 2032           opcode.operand1 = runtime_var_index_index;
3367              
3368 2032           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
3369            
3370 2032           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_assign->line);
3371              
3372 2032           break;
3373             }
3374             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT: {
3375 2033           SPVM_OPCODE opcode = {0};
3376            
3377              
3378 2033           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_NEW_FLOAT_ARRAY);
3379              
3380 2033           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
3381 2033           int32_t runtime_var_index_index = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3382              
3383 2033           opcode.operand0 = runtime_var_index_out;
3384 2033           opcode.operand1 = runtime_var_index_index;
3385              
3386 2033           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
3387            
3388 2033           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_assign->line);
3389              
3390 2033           break;
3391             }
3392             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE: {
3393 2050           SPVM_OPCODE opcode = {0};
3394            
3395              
3396 2050           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_NEW_DOUBLE_ARRAY);
3397            
3398 2050           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
3399 2050           int32_t runtime_var_index_index = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3400              
3401 2050           opcode.operand0 = runtime_var_index_out;
3402 2050           opcode.operand1 = runtime_var_index_index;
3403              
3404 2050           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
3405              
3406 2050           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_assign->line);
3407              
3408 2050           break;
3409             }
3410             default: {
3411 14652 100         if (SPVM_TYPE_is_mulnum_array_type(compiler, basic_type_id, type_dimension, type->flag)) {
3412 181           SPVM_OPCODE opcode = {0};
3413            
3414              
3415 181           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_NEW_MULNUM_ARRAY);
3416              
3417 181           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
3418 181           int32_t runtime_var_index_index = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3419              
3420 181           opcode.operand0 = runtime_var_index_out;
3421 181           opcode.operand1 = type->basic_type->id;
3422 181           opcode.operand2 = runtime_var_index_index;
3423              
3424 181           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
3425              
3426 181           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_assign->line);
3427             }
3428             else {
3429 14471           SPVM_OPCODE opcode = {0};
3430            
3431              
3432 14471           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_NEW_OBJECT_ARRAY);
3433              
3434 14471           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
3435 14471           int32_t runtime_var_index_index = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3436              
3437 14471           opcode.operand0 = runtime_var_index_out;
3438 14471           opcode.operand1 = type->basic_type->id;
3439 14471           opcode.operand2 = runtime_var_index_index;
3440              
3441 14471           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
3442              
3443 29794           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_assign->line);
3444             }
3445             }
3446             }
3447             }
3448 57 50         else if (type_dimension > 1) {
3449 57           SPVM_OPCODE opcode = {0};
3450            
3451              
3452 57           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_NEW_MULDIM_ARRAY);
3453              
3454 57           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
3455 57           int32_t runtime_var_index_index = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3456              
3457 57           opcode.operand0 = runtime_var_index_out;
3458 57           opcode.operand1 = type->basic_type->id;
3459 57           opcode.operand2 = runtime_var_index_index;
3460 57           int32_t operand3 = type->dimension;
3461 57 50         assert(operand3 < 0xFFFF);
3462 57           opcode.operand3 = operand3;
3463              
3464 57           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
3465              
3466 57           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_assign->line);
3467             }
3468             else {
3469 0           assert(0);
3470             }
3471             }
3472             else {
3473 21202           SPVM_OPCODE opcode = {0};
3474            
3475              
3476 21202           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_NEW_OBJECT);
3477            
3478 21202           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
3479            
3480 21202           opcode.operand0 = runtime_var_index_out;
3481 21202           opcode.operand1 = type->basic_type->id;
3482 21202           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
3483             }
3484             }
3485             else {
3486 0           assert(0);
3487             }
3488 51053           break;
3489             }
3490             case SPVM_OP_C_ID_BASIC_TYPE_ID : {
3491            
3492 64           SPVM_OP* op_type = op_assign_src->first;
3493            
3494 64           int32_t basic_type_id = op_type->uv.type->basic_type->id;
3495            
3496 64           SPVM_OPCODE opcode = {0};
3497 64           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_BASIC_TYPE_ID);
3498            
3499 64           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
3500 64           opcode.operand0 = runtime_var_index_out;
3501 64           opcode.operand1 = basic_type_id;
3502 64           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
3503              
3504 64           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_assign->line);
3505            
3506 64           break;
3507             }
3508             case SPVM_OP_C_ID_EVAL_ERROR_ID : {
3509            
3510 10           SPVM_OPCODE opcode = {0};
3511 10           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GET_EVAL_ERROR_ID);
3512            
3513 10           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
3514 10           opcode.operand0 = runtime_var_index_out;
3515 10           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
3516            
3517 10           break;
3518             }
3519             case SPVM_OP_C_ID_ARGS_WIDTH : {
3520            
3521 11           SPVM_OPCODE opcode = {0};
3522 11           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_ARGS_WIDTH);
3523            
3524 11           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
3525 11           opcode.operand0 = runtime_var_index_out;
3526 11           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
3527            
3528 11           break;
3529             }
3530             case SPVM_OP_C_ID_VAR : {
3531             // Multi numeric type
3532 136948 100         if (SPVM_TYPE_is_mulnum_type(compiler, type_dist->basic_type->id, type_dist->dimension, type_dist->flag)) {
3533            
3534 7           SPVM_FIELD* first_field = SPVM_LIST_get(type_dist->basic_type->fields, 0);
3535 7 50         assert(first_field);
3536            
3537 7           SPVM_TYPE* field_type = SPVM_CHECK_get_type(compiler, first_field->op_field);
3538 7 50         assert(SPVM_TYPE_is_numeric_type(compiler, field_type->basic_type->id, field_type->dimension, field_type->flag));
3539            
3540 7           SPVM_OPCODE opcode = {0};
3541            
3542            
3543             int32_t runtime_var_index_out;
3544             int32_t runtime_var_index_in;
3545 7           switch (field_type->basic_type->id) {
3546             case SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE: {
3547 0           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_MULNUM_BYTE);
3548 0           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
3549 0           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
3550 0           break;
3551             }
3552             case SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT: {
3553 0           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_MULNUM_SHORT);
3554 0           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
3555 0           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
3556 0           break;
3557             }
3558             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT: {
3559 0           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_MULNUM_INT);
3560 0           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
3561 0           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
3562 0           break;
3563             }
3564             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG: {
3565 0           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_MULNUM_LONG);
3566 0           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
3567 0           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
3568 0           break;
3569             }
3570             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT: {
3571 0           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_MULNUM_FLOAT);
3572 0           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
3573 0           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
3574 0           break;
3575             }
3576             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE: {
3577 7           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_MULNUM_DOUBLE);
3578 7           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
3579 7           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
3580 7           break;
3581             }
3582             default:
3583 0           assert(0);
3584             }
3585              
3586 7           int32_t fields_length = type_dist->basic_type->fields->length;
3587 7           opcode.operand0 = runtime_var_index_out;
3588 7           opcode.operand1 = runtime_var_index_in;
3589 7           opcode.operand2 = fields_length;
3590            
3591 7           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
3592             }
3593             // Object type
3594 136941 100         else if (SPVM_TYPE_is_object_type(compiler, type_dist->basic_type->id, type_dist->dimension, type_dist->flag)) {
3595 21678           SPVM_OPCODE opcode = {0};
3596            
3597 21678           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_OBJECT);
3598 21678           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
3599 21678           int32_t runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
3600              
3601 21678           opcode.operand0 = runtime_var_index_out;
3602 21678           opcode.operand1 = runtime_var_index_in;
3603            
3604 21678           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
3605            
3606             }
3607 115263 100         else if (SPVM_TYPE_is_ref_type(compiler, type_dist->basic_type->id, type_dist->dimension, type_dist->flag)) {
3608 10           SPVM_OPCODE opcode = {0};
3609            
3610 10           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_REF);
3611 10           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
3612 10           int32_t runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
3613              
3614 10           opcode.operand0 = runtime_var_index_out;
3615 10           opcode.operand1 = runtime_var_index_in;
3616            
3617 10           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
3618            
3619             }
3620             // Numeric type
3621             else {
3622 115253           SPVM_OPCODE opcode = {0};
3623            
3624            
3625 115253 50         assert(SPVM_TYPE_is_numeric_type(compiler, type_dist->basic_type->id, type_dist->dimension, type_dist->flag));
3626            
3627             int32_t runtime_var_index_out;
3628             int32_t runtime_var_index_in;
3629 115253           switch (type_dist->basic_type->id) {
3630             case SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE: {
3631 68           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_BYTE);
3632 68           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
3633 68           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
3634 68           break;
3635             }
3636             case SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT: {
3637 68           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_SHORT);
3638 68           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
3639 68           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
3640 68           break;
3641             }
3642             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT: {
3643 112338           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_INT);
3644 112338           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
3645 112338           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
3646 112338           break;
3647             }
3648             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG: {
3649 1107           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_LONG);
3650 1107           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
3651 1107           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
3652 1107           break;
3653             }
3654             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT: {
3655 575           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_FLOAT);
3656 575           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
3657 575           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
3658 575           break;
3659             }
3660             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE: {
3661 1097           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_DOUBLE);
3662 1097           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
3663 1097           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
3664 1097           break;
3665             }
3666             default: {
3667 0           assert(0);
3668             }
3669             }
3670              
3671 115253           opcode.operand0 = runtime_var_index_out;
3672 115253           opcode.operand1 = runtime_var_index_in;
3673            
3674 115253           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
3675             }
3676 136948           break;
3677             }
3678             case SPVM_OP_C_ID_NUMERIC_EQ : {
3679 85177 100         if (op_assign_src->first->id == SPVM_OP_C_ID_UNDEF || op_assign_src->last->id == SPVM_OP_C_ID_UNDEF) {
    100          
3680 16933           SPVM_OPCODE opcode = {0};
3681            
3682              
3683             int32_t runtime_var_index_in;
3684              
3685 16933           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_IS_UNDEF);
3686 16933 100         if (op_assign_src->first->id == SPVM_OP_C_ID_UNDEF) {
3687 5           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3688            
3689 5           opcode.operand1 = runtime_var_index_in;
3690              
3691 5           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
3692             }
3693             else {
3694 16928           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
3695            
3696 16928           opcode.operand1 = runtime_var_index_in;
3697            
3698 16928           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
3699             }
3700             }
3701             else {
3702 51311           SPVM_TYPE* operand_type = SPVM_CHECK_get_type(compiler, op_assign_src->first);
3703            
3704 51311           SPVM_OPCODE opcode = {0};
3705            
3706            
3707             int32_t runtime_var_index_in1;
3708             int32_t runtime_var_index_in2;
3709 51311 100         if (SPVM_TYPE_is_numeric_type(compiler, operand_type->basic_type->id, operand_type->dimension, operand_type->flag)) {
3710 50521 50         if (operand_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE) {
3711 0           assert(0);
3712             }
3713 50521 50         else if (operand_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT) {
3714 0           assert(0);
3715             }
3716 50521 100         else if (operand_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_INT) {
3717 47108           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_EQ_INT);
3718 47108           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
3719 47108           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3720             }
3721 3413 100         else if (operand_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_LONG) {
3722 1547           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_EQ_LONG);
3723 1547           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
3724 1547           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3725             }
3726 1866 100         else if (operand_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT) {
3727 858           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_EQ_FLOAT);
3728 858           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
3729 858           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3730             }
3731 1008 50         else if (operand_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE) {
3732 1008           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_EQ_DOUBLE);
3733 1008           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
3734 1008           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3735             }
3736             else {
3737 0           assert(0);
3738             }
3739             }
3740 790 50         else if (SPVM_TYPE_is_object_type(compiler, operand_type->basic_type->id, operand_type->dimension, operand_type->flag)) {
3741 790           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_EQ_OBJECT);
3742 790           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
3743 790           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3744             }
3745 0 0         else if (SPVM_TYPE_is_ref_type(compiler, operand_type->basic_type->id, operand_type->dimension, operand_type->flag)) {
3746 0           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_EQ_REF);
3747 0           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
3748 0           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3749             }
3750             else {
3751 0           assert(0);
3752             }
3753            
3754 51311           opcode.operand1 = runtime_var_index_in1;
3755 51311           opcode.operand2 = runtime_var_index_in2;
3756              
3757 51311           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
3758             }
3759 68244           break;
3760             }
3761             case SPVM_OP_C_ID_NUMERIC_NE : {
3762 26358 100         if (op_assign_src->first->id == SPVM_OP_C_ID_UNDEF ||op_assign_src->last->id == SPVM_OP_C_ID_UNDEF) {
    100          
3763 8362           SPVM_OPCODE opcode = {0};
3764            
3765            
3766             int32_t runtime_var_index_in;
3767              
3768 8362           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_IS_NOT_UNDEF);
3769 8362 100         if (op_assign_src->first->id == SPVM_OP_C_ID_UNDEF) {
3770 4           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3771            
3772 4           opcode.operand1 = runtime_var_index_in;
3773             }
3774             else {
3775 8358           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
3776            
3777 8358           opcode.operand1 = runtime_var_index_in;
3778             }
3779 8362           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
3780             }
3781             else {
3782 9634           SPVM_TYPE* operand_type = SPVM_CHECK_get_type(compiler, op_assign_src->first);
3783              
3784 9634           SPVM_OPCODE opcode = {0};
3785            
3786            
3787             int32_t runtime_var_index_in1;
3788             int32_t runtime_var_index_in2;
3789 9634 100         if (SPVM_TYPE_is_numeric_type(compiler, operand_type->basic_type->id, operand_type->dimension, operand_type->flag)) {
3790 9596 50         if (operand_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE) {
3791 0           assert(0);
3792             }
3793 9596 50         else if (operand_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT) {
3794 0           assert(0);
3795             }
3796 9596 100         else if (operand_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_INT) {
3797 7482           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_NE_INT);
3798 7482           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
3799 7482           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3800             }
3801 2114 100         else if (operand_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_LONG) {
3802 1053           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_NE_LONG);
3803 1053           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
3804 1053           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3805             }
3806 1061 100         else if (operand_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT) {
3807 530           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_NE_FLOAT);
3808 530           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
3809 530           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3810             }
3811 531 50         else if (operand_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE) {
3812 531           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_NE_DOUBLE);
3813 531           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
3814 531           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3815             }
3816             else {
3817 0           assert(0);
3818             }
3819             }
3820 38 100         else if (SPVM_TYPE_is_object_type(compiler, operand_type->basic_type->id, operand_type->dimension, operand_type->flag)) {
3821 30           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_NE_OBJECT);
3822 30           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
3823 30           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3824             }
3825 8 50         else if (SPVM_TYPE_is_ref_type(compiler, operand_type->basic_type->id, operand_type->dimension, operand_type->flag)) {
3826 8           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_NE_REF);
3827 8           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
3828 8           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3829             }
3830             else {
3831 0           assert(0);
3832             }
3833            
3834 9634           opcode.operand1 = runtime_var_index_in1;
3835 9634           opcode.operand2 = runtime_var_index_in2;
3836              
3837 9634           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
3838             }
3839 17996           break;
3840             }
3841             case SPVM_OP_C_ID_NUMERIC_GT : {
3842            
3843 21097           SPVM_OPCODE opcode = {0};
3844            
3845            
3846 21097           SPVM_TYPE* operand_type = SPVM_CHECK_get_type(compiler, op_assign_src->first);
3847              
3848             int32_t runtime_var_index_in1;
3849             int32_t runtime_var_index_in2;
3850 21097           switch (operand_type->basic_type->id) {
3851             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT:
3852 20004           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GT_INT);
3853 20004           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
3854 20004           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3855 20004           break;
3856             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG:
3857 544           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GT_LONG);
3858 544           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
3859 544           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3860 544           break;
3861             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT:
3862 12           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GT_FLOAT);
3863 12           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
3864 12           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3865 12           break;
3866             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE:
3867 537           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GT_DOUBLE);
3868 537           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
3869 537           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3870 537           break;
3871             default:
3872 0           assert(0);
3873             }
3874            
3875 21097           opcode.operand1 = runtime_var_index_in1;
3876 21097           opcode.operand2 = runtime_var_index_in2;
3877              
3878 21097           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
3879 21097           break;
3880             }
3881             case SPVM_OP_C_ID_NUMERIC_GE : {
3882            
3883 69609           SPVM_OPCODE opcode = {0};
3884            
3885            
3886 69609           SPVM_TYPE* operand_type = SPVM_CHECK_get_type(compiler, op_assign_src->first);
3887              
3888             int32_t runtime_var_index_in1;
3889             int32_t runtime_var_index_in2;
3890 69609           switch (operand_type->basic_type->id) {
3891             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT:
3892 69047           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GE_INT);
3893 69047           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
3894 69047           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3895 69047           break;
3896             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG:
3897 535           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GE_LONG);
3898 535           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
3899 535           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3900 535           break;
3901             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT:
3902 12           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GE_FLOAT);
3903 12           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
3904 12           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3905 12           break;
3906             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE:
3907 15           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GE_DOUBLE);
3908 15           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
3909 15           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3910 15           break;
3911             default:
3912 0           assert(0);
3913             }
3914            
3915 69609           opcode.operand1 = runtime_var_index_in1;
3916 69609           opcode.operand2 = runtime_var_index_in2;
3917              
3918 69609           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
3919 69609           break;
3920             }
3921             case SPVM_OP_C_ID_NUMERIC_LT : {
3922            
3923 80872           SPVM_OPCODE opcode = {0};
3924            
3925            
3926 80872           SPVM_TYPE* operand_type = SPVM_CHECK_get_type(compiler, op_assign_src->first);
3927              
3928             int32_t runtime_var_index_in1;
3929             int32_t runtime_var_index_in2;
3930 80872           switch (operand_type->basic_type->id) {
3931             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT:
3932 80310           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_LT_INT);
3933 80310           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
3934 80310           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3935 80310           break;
3936             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG:
3937 535           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_LT_LONG);
3938 535           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
3939 535           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3940 535           break;
3941             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT:
3942 12           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_LT_FLOAT);
3943 12           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
3944 12           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3945 12           break;
3946             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE:
3947 15           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_LT_DOUBLE);
3948 15           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
3949 15           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3950 15           break;
3951             default:
3952 0           assert(0);
3953             }
3954            
3955 80872           opcode.operand1 = runtime_var_index_in1;
3956 80872           opcode.operand2 = runtime_var_index_in2;
3957              
3958 80872           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
3959 80872           break;
3960             }
3961             case SPVM_OP_C_ID_NUMERIC_LE : {
3962            
3963 74661           SPVM_OPCODE opcode = {0};
3964            
3965            
3966 74661           SPVM_TYPE* operand_type = SPVM_CHECK_get_type(compiler, op_assign_src->first);
3967              
3968             int32_t runtime_var_index_in1;
3969             int32_t runtime_var_index_in2;
3970 74661           switch (operand_type->basic_type->id) {
3971             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT:
3972 74623           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_LE_INT);
3973 74623           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
3974 74623           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3975 74623           break;
3976             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG:
3977 13           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_LE_LONG);
3978 13           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
3979 13           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3980 13           break;
3981             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT:
3982 12           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_LE_FLOAT);
3983 12           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
3984 12           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3985 12           break;
3986             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE:
3987 13           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_LE_DOUBLE);
3988 13           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
3989 13           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
3990 13           break;
3991             default:
3992 0           assert(0);
3993             }
3994            
3995 74661           opcode.operand1 = runtime_var_index_in1;
3996 74661           opcode.operand2 = runtime_var_index_in2;
3997              
3998 74661           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
3999 74661           break;
4000             }
4001             case SPVM_OP_C_ID_NUMERIC_CMP : {
4002            
4003 6474           SPVM_OPCODE opcode = {0};
4004            
4005            
4006 6474           SPVM_TYPE* operand_type = SPVM_CHECK_get_type(compiler, op_assign_src->first);
4007              
4008             int32_t runtime_var_index_in1;
4009             int32_t runtime_var_index_in2;
4010 6474           switch (operand_type->basic_type->id) {
4011             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT:
4012 3248           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_CMP_INT);
4013 3248           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
4014 3248           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
4015 3248           break;
4016             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG:
4017 1074           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_CMP_LONG);
4018 1074           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
4019 1074           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
4020 1074           break;
4021             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT:
4022 1076           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_CMP_FLOAT);
4023 1076           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
4024 1076           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
4025 1076           break;
4026             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE:
4027 1076           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_CMP_DOUBLE);
4028 1076           runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
4029 1076           runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
4030 1076           break;
4031             default:
4032 0           assert(0);
4033             }
4034            
4035 6474           opcode.operand1 = runtime_var_index_in1;
4036 6474           opcode.operand2 = runtime_var_index_in2;
4037              
4038 6474           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
4039 6474           break;
4040             }
4041             case SPVM_OP_C_ID_STRING_EQ:
4042             case SPVM_OP_C_ID_STRING_NE:
4043             case SPVM_OP_C_ID_STRING_GT:
4044             case SPVM_OP_C_ID_STRING_GE:
4045             case SPVM_OP_C_ID_STRING_LT:
4046             case SPVM_OP_C_ID_STRING_LE:
4047             case SPVM_OP_C_ID_STRING_CMP:
4048             {
4049 12808           SPVM_OPCODE opcode = {0};
4050            
4051            
4052 12808           switch (op_assign_src->id) {
4053             case SPVM_OP_C_ID_STRING_EQ: {
4054 10437           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_STRING_EQ);
4055 10437           break;
4056             }
4057             case SPVM_OP_C_ID_STRING_NE: {
4058 567           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_STRING_NE);
4059 567           break;
4060             }
4061             case SPVM_OP_C_ID_STRING_GT: {
4062 44           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_STRING_GT);
4063 44           break;
4064             }
4065             case SPVM_OP_C_ID_STRING_GE: {
4066 44           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_STRING_GE);
4067 44           break;
4068             }
4069             case SPVM_OP_C_ID_STRING_LT: {
4070 44           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_STRING_LT);
4071 44           break;
4072             }
4073             case SPVM_OP_C_ID_STRING_LE: {
4074 44           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_STRING_LE);
4075 44           break;
4076             }
4077             case SPVM_OP_C_ID_STRING_CMP: {
4078 1628           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_STRING_CMP);
4079 1628           break;
4080             }
4081             default: {
4082 0           assert(0);
4083             }
4084             }
4085            
4086 12808           int32_t runtime_var_index_in1 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
4087 12808           int32_t runtime_var_index_in2 = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->last);
4088            
4089 12808           opcode.operand1 = runtime_var_index_in1;
4090 12808           opcode.operand2 = runtime_var_index_in2;
4091            
4092 12808           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
4093            
4094 12808           break;
4095             }
4096             case SPVM_OP_C_ID_BOOL: {
4097 680445           SPVM_TYPE* type = SPVM_CHECK_get_type(compiler, op_assign_src->first);
4098            
4099 680445 50         if (op_assign_src->first->id != SPVM_OP_C_ID_IF) {
4100              
4101 680445           SPVM_OPCODE opcode = {0};
4102            
4103            
4104             int32_t runtime_var_index_in;
4105 680445 100         if (SPVM_TYPE_is_numeric_type(compiler, type->basic_type->id, type->dimension, type->flag)) {
4106 607482 50         if (type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE) {
4107 0           assert(0);
4108             }
4109 607482 50         else if (type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT) {
4110 0           assert(0);
4111             }
4112 607482 100         else if (type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_INT) {
4113 607341           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_BOOL_CONVERSION_INT);
4114 607341           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
4115             }
4116 141 100         else if (type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_LONG) {
4117 26           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_BOOL_CONVERSION_LONG);
4118 26           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
4119             }
4120 115 100         else if (type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT) {
4121 20           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_BOOL_CONVERSION_FLOAT);
4122 20           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
4123             }
4124 95 50         else if (type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE) {
4125 95           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_BOOL_CONVERSION_DOUBLE);
4126 95           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
4127             }
4128             else {
4129 0           assert(0);
4130             }
4131             }
4132 72963 100         else if (SPVM_TYPE_is_bool_object_type(compiler, type->basic_type->id, type->dimension, type->flag)) {
4133 28           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_BOOL_CONVERSION_BOOL_OBJECT);
4134 28           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
4135             }
4136 72935 100         else if (SPVM_TYPE_is_object_type(compiler, type->basic_type->id, type->dimension, type->flag)) {
4137 72929           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_BOOL_CONVERSION_OBJECT);
4138 72929           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
4139             }
4140 6 50         else if (SPVM_TYPE_is_ref_type(compiler, type->basic_type->id, type->dimension, type->flag)) {
4141 6           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_BOOL_CONVERSION_REF);
4142 6           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
4143             }
4144             else {
4145 0           assert(0);
4146             }
4147 680445           opcode.operand1 = runtime_var_index_in;
4148              
4149 680445           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
4150             }
4151            
4152 680445           break;
4153             }
4154             case SPVM_OP_C_ID_ISA:
4155             case SPVM_OP_C_ID_ISA_ERROR:
4156             case SPVM_OP_C_ID_IS_TYPE:
4157             case SPVM_OP_C_ID_IS_ERROR:
4158             {
4159 7825           int32_t runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
4160            
4161 7825           SPVM_OP* op_type = op_assign_src->last;
4162 7825           SPVM_TYPE* type = SPVM_CHECK_get_type(compiler, op_type);
4163            
4164 7825           SPVM_OPCODE opcode = {0};
4165            
4166 7825 100         if (op_assign_src->id == SPVM_OP_C_ID_ISA) {
4167 4052           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_ISA);
4168             }
4169 3773 100         else if (op_assign_src->id == SPVM_OP_C_ID_ISA_ERROR) {
4170 17           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_ISA_ERROR);
4171             }
4172 3756 100         else if (op_assign_src->id == SPVM_OP_C_ID_IS_TYPE) {
4173 3741           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_IS_TYPE);
4174             }
4175 15 50         else if (op_assign_src->id == SPVM_OP_C_ID_IS_ERROR) {
4176 15           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_IS_ERROR);
4177             }
4178            
4179 7825           opcode.operand1 = runtime_var_index_in;
4180            
4181 7825           opcode.operand2 = type->basic_type->id;
4182 7825           int32_t operand3 = type->dimension;
4183 7825 50         assert(operand3 < 0xFFFF);
4184 7825           opcode.operand3 = operand3;
4185            
4186 7825           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
4187            
4188 7825           break;
4189             }
4190             case SPVM_OP_C_ID_CAN: {
4191 15           SPVM_OP* op_var = op_assign_src->first;
4192 15           int32_t runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_var);
4193            
4194 15           SPVM_TYPE* invocant_decl_type = SPVM_CHECK_get_type(compiler, op_var);
4195 15           SPVM_BASIC_TYPE* invocant_decl_basic_type = invocant_decl_type->basic_type;
4196 15           SPVM_OP* op_name_decl_method = op_assign_src->last;
4197            
4198 15           const char* decl_method_name = op_name_decl_method->uv.name;
4199 15           SPVM_METHOD* decl_method = SPVM_HASH_get(invocant_decl_basic_type->method_symtable, decl_method_name, strlen(decl_method_name));
4200            
4201 15           SPVM_OPCODE opcode = {0};
4202            
4203            
4204 15           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_CAN);
4205            
4206 15           opcode.operand0 = runtime_var_index_in;
4207 15           opcode.operand1 = invocant_decl_basic_type->id;
4208 15           opcode.operand2 = decl_method->index;
4209            
4210 15           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
4211            
4212 15           break;
4213             }
4214             case SPVM_OP_C_ID_WARN: {
4215            
4216 259           SPVM_OPCODE opcode = {0};
4217            
4218            
4219 259           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_WARN);
4220            
4221 259           int32_t runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
4222 259           opcode.operand0 = runtime_var_index_in;
4223 259           opcode.operand1 = op_assign->line;
4224            
4225 259           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
4226            
4227 259           break;
4228             }
4229             case SPVM_OP_C_ID_PRINT: {
4230            
4231 252           SPVM_OPCODE opcode = {0};
4232            
4233            
4234 252           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_PRINT);
4235            
4236 252           int32_t runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
4237 252           opcode.operand0 = runtime_var_index_in;
4238            
4239 252           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
4240            
4241 252           break;
4242             }
4243             case SPVM_OP_C_ID_SAY: {
4244            
4245 60           SPVM_OPCODE opcode = {0};
4246            
4247            
4248 60           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SAY);
4249            
4250 60           int32_t runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
4251 60           opcode.operand0 = runtime_var_index_in;
4252            
4253 60           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
4254            
4255 60           break;
4256             }
4257             case SPVM_OP_C_ID_MAKE_READ_ONLY: {
4258            
4259 1049           SPVM_OPCODE opcode = {0};
4260            
4261            
4262 1049           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MAKE_READ_ONLY);
4263            
4264 1049           int32_t runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src->first);
4265 1049           opcode.operand0 = runtime_var_index_in;
4266            
4267 1049           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
4268            
4269 1049           break;
4270             }
4271             // $var_dist = ($var_src = ASSIGN)
4272             // $var_dist = (ASSIGN = $var_src)
4273             case SPVM_OP_C_ID_ASSIGN: {
4274             SPVM_OP* op_var_src;
4275 1171 100         if (op_assign_src->first->id == SPVM_OP_C_ID_VAR || op_assign_src->first->id == SPVM_OP_C_ID_ASSIGN) {
    100          
4276 257           op_var_src = op_assign_src->first;
4277             }
4278 914 50         else if (op_assign_src->last->id == SPVM_OP_C_ID_VAR || op_assign_src->last->id == SPVM_OP_C_ID_ASSIGN) {
    0          
4279 914           op_var_src = op_assign_src->last;
4280             }
4281             else {
4282 0           assert(0);
4283             }
4284            
4285 1171           SPVM_OP* op_var_dist = op_assign->last;
4286            
4287 1171 100         if (SPVM_TYPE_is_byte_type(compiler, type_dist->basic_type->id, type_dist->dimension, type_dist->flag)) {
4288 65           SPVM_OPCODE opcode = {0};
4289            
4290 65           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_BYTE);
4291            
4292 65           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_var_dist);
4293 65           int32_t runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_var_src);
4294              
4295 65           opcode.operand0 = runtime_var_index_out;
4296 65           opcode.operand1 = runtime_var_index_in;
4297            
4298 65           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
4299             }
4300 1106 100         else if (SPVM_TYPE_is_short_type(compiler, type_dist->basic_type->id, type_dist->dimension, type_dist->flag)) {
4301 65           SPVM_OPCODE opcode = {0};
4302            
4303 65           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_SHORT);
4304            
4305 65           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_var_dist);
4306 65           int32_t runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_var_src);
4307              
4308 65           opcode.operand0 = runtime_var_index_out;
4309 65           opcode.operand1 = runtime_var_index_in;
4310            
4311 65           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
4312             }
4313 1041 100         else if (SPVM_TYPE_is_int_type(compiler, type_dist->basic_type->id, type_dist->dimension, type_dist->flag)) {
4314 874           SPVM_OPCODE opcode = {0};
4315            
4316 874           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_INT);
4317            
4318 874           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_var_dist);
4319 874           int32_t runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_var_src);
4320              
4321 874           opcode.operand0 = runtime_var_index_out;
4322 874           opcode.operand1 = runtime_var_index_in;
4323            
4324 874           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
4325             }
4326 167 100         else if (SPVM_TYPE_is_long_type(compiler, type_dist->basic_type->id, type_dist->dimension, type_dist->flag)) {
4327 57           SPVM_OPCODE opcode = {0};
4328            
4329 57           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_LONG);
4330            
4331 57           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_var_dist);
4332 57           int32_t runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_var_src);
4333              
4334 57           opcode.operand0 = runtime_var_index_out;
4335 57           opcode.operand1 = runtime_var_index_in;
4336            
4337 57           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
4338             }
4339 110 100         else if (SPVM_TYPE_is_float_type(compiler, type_dist->basic_type->id, type_dist->dimension, type_dist->flag)) {
4340 51           SPVM_OPCODE opcode = {0};
4341            
4342 51           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_FLOAT);
4343            
4344 51           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_var_dist);
4345 51           int32_t runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_var_src);
4346              
4347 51           opcode.operand0 = runtime_var_index_out;
4348 51           opcode.operand1 = runtime_var_index_in;
4349            
4350 51           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
4351             }
4352 59 100         else if (SPVM_TYPE_is_double_type(compiler, type_dist->basic_type->id, type_dist->dimension, type_dist->flag)) {
4353 53           SPVM_OPCODE opcode = {0};
4354            
4355 53           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_DOUBLE);
4356            
4357 53           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_var_dist);
4358 53           int32_t runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_var_src);
4359              
4360 53           opcode.operand0 = runtime_var_index_out;
4361 53           opcode.operand1 = runtime_var_index_in;
4362            
4363 53           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
4364             }
4365 6 100         else if (SPVM_TYPE_is_object_type(compiler, type_dist->basic_type->id, type_dist->dimension, type_dist->flag)) {
4366 2           SPVM_OPCODE opcode = {0};
4367            
4368 2           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_OBJECT);
4369            
4370 2           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_var_dist);
4371 2           int32_t runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_var_src);
4372              
4373 2           opcode.operand0 = runtime_var_index_out;
4374 2           opcode.operand1 = runtime_var_index_in;
4375            
4376 2           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
4377             }
4378 4 100         else if (SPVM_TYPE_is_ref_type(compiler, type_dist->basic_type->id, type_dist->dimension, type_dist->flag)) {
4379 2           SPVM_OPCODE opcode = {0};
4380            
4381 2           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_REF);
4382            
4383 2           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_var_dist);
4384 2           int32_t runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_var_src);
4385              
4386 2           opcode.operand0 = runtime_var_index_out;
4387 2           opcode.operand1 = runtime_var_index_in;
4388            
4389 2           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
4390             }
4391 2 50         else if (SPVM_TYPE_is_mulnum_type(compiler, type_dist->basic_type->id, type_dist->dimension, type_dist->flag)) {
4392 2           SPVM_FIELD* first_field = SPVM_LIST_get(type_dist->basic_type->fields, 0);
4393 2 50         assert(first_field);
4394            
4395 2           SPVM_TYPE* field_type = SPVM_CHECK_get_type(compiler, first_field->op_field);
4396 2 50         assert(SPVM_TYPE_is_numeric_type(compiler, field_type->basic_type->id, field_type->dimension, field_type->flag));
4397            
4398 2           SPVM_OPCODE opcode = {0};
4399            
4400              
4401             int32_t runtime_var_index_out;
4402             int32_t runtime_var_index_in;
4403 2           switch (field_type->basic_type->id) {
4404             case SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE: {
4405 0           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_MULNUM_BYTE);
4406 0           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
4407 0           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4408 0           break;
4409             }
4410             case SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT: {
4411 0           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_MULNUM_SHORT);
4412 0           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
4413 0           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4414 0           break;
4415             }
4416             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT: {
4417 0           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_MULNUM_INT);
4418 0           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
4419 0           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4420 0           break;
4421             }
4422             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG: {
4423 0           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_MULNUM_LONG);
4424 0           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
4425 0           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4426 0           break;
4427             }
4428             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT: {
4429 0           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_MULNUM_FLOAT);
4430 0           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
4431 0           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4432 0           break;
4433             }
4434             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE: {
4435 2           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
4436 2           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4437 2           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_MOVE_MULNUM_DOUBLE);
4438 2           break;
4439             }
4440             default: {
4441 0           assert(0);
4442             }
4443             }
4444              
4445 2           int32_t fields_length = type_dist->basic_type->fields->length;
4446 2           opcode.operand0 = runtime_var_index_out;
4447 2           opcode.operand1 = runtime_var_index_in;
4448 2           opcode.operand2 = fields_length;
4449            
4450 2           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
4451             }
4452             else {
4453 0           assert(0);
4454             }
4455 3259282           break;
4456             }
4457             }
4458             }
4459             // $VAR = $var
4460 268701 100         else if (op_assign_dist->id == SPVM_OP_C_ID_CLASS_VAR_ACCESS) {
4461 2634           SPVM_OP* op_class_var_access = op_assign_dist;
4462 2634           SPVM_CLASS_VAR_ACCESS* class_var_access = op_class_var_access->uv.class_var_access;
4463              
4464 2634           SPVM_TYPE* src_type = SPVM_CHECK_get_type(compiler, op_assign_src);
4465              
4466             // CLASS_VAR_ACCESS = UNDEF
4467 2634 100         if (SPVM_TYPE_is_undef_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
4468 104           SPVM_OPCODE opcode = {0};
4469            
4470 104           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_CLASS_VAR_UNDEF);
4471 104           opcode.operand0 = class_var_access->class_var->current_basic_type->id;
4472 104           opcode.operand1 = class_var_access->class_var->index;
4473 104           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
4474             }
4475             // CLASS_VAR_ACCESS = $var
4476             else {
4477 2530           SPVM_TYPE* type = SPVM_CHECK_get_type(compiler, op_class_var_access);
4478              
4479 2530           SPVM_OPCODE opcode = {0};
4480            
4481            
4482             int32_t runtime_var_index_in;
4483 2530 100         if (SPVM_TYPE_is_object_type(compiler, type->basic_type->id, type->dimension, type->flag)) {
4484 1982           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_CLASS_VAR_OBJECT);
4485 1982           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4486             }
4487             else {
4488 548 100         if (type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE) {
4489 46           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_CLASS_VAR_BYTE);
4490 46           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4491             }
4492 502 100         else if (type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT) {
4493 46           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_CLASS_VAR_SHORT);
4494 46           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4495             }
4496 456 100         else if (type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_INT) {
4497 282           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_CLASS_VAR_INT);
4498 282           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4499             }
4500 174 100         else if (type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_LONG) {
4501 82           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_CLASS_VAR_LONG);
4502 82           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4503             }
4504 92 100         else if (type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT) {
4505 46           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_CLASS_VAR_FLOAT);
4506 46           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4507             }
4508 46 50         else if (type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE) {
4509 46           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_CLASS_VAR_DOUBLE);
4510 46           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4511             }
4512             else {
4513 0           assert(0);
4514             }
4515             }
4516            
4517 2530           opcode.operand0 = class_var_access->class_var->current_basic_type->id;
4518 2530           opcode.operand1 = class_var_access->class_var->index;
4519 2530           opcode.operand2 = runtime_var_index_in;
4520            
4521 2634           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
4522             }
4523             }
4524             // $$var_ref = $var
4525 266067 100         else if (op_assign_dist->id == SPVM_OP_C_ID_DEREF) {
4526 1684           SPVM_OP* op_deref = op_assign_dist;
4527              
4528 1684           SPVM_TYPE* type = SPVM_CHECK_get_type(compiler, op_deref->first);
4529              
4530 1684           SPVM_OPCODE opcode = {0};
4531            
4532            
4533 1684 50         assert(SPVM_TYPE_is_numeric_ref_type(compiler, type->basic_type->id, type->dimension, type->flag));
4534             int32_t runtime_var_index_in;
4535 1684 100         if (type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE) {
4536 18           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_DEREF_BYTE);
4537 18           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4538             }
4539 1666 100         else if (type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT) {
4540 18           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_DEREF_SHORT);
4541 18           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4542             }
4543 1648 100         else if (type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_INT) {
4544 1593           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_DEREF_INT);
4545 1593           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4546             }
4547 55 100         else if (type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_LONG) {
4548 18           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_DEREF_LONG);
4549 18           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4550             }
4551 37 100         else if (type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT) {
4552 18           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_DEREF_FLOAT);
4553 18           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4554             }
4555 19 50         else if (type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE) {
4556 19           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_DEREF_DOUBLE);
4557 19           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4558             }
4559             else {
4560 0           assert(0);
4561             }
4562            
4563 1684           int32_t runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_dist);
4564            
4565 1684           opcode.operand0 = runtime_var_index_out;
4566 1684           opcode.operand1 = runtime_var_index_in;
4567 1684           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
4568             }
4569             // $@ = $var
4570 264383 100         else if (op_assign_dist->id == SPVM_OP_C_ID_EXCEPTION_VAR) {
4571            
4572 141329           SPVM_TYPE* src_type = SPVM_CHECK_get_type(compiler, op_assign_src);
4573            
4574 141329 100         if (SPVM_TYPE_is_undef_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
4575             // EXCEPTION_VAR = undef
4576 999           SPVM_OPCODE opcode = {0};
4577            
4578 999           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_EXCEPTION_VAR_UNDEF);
4579 999           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
4580             }
4581             else {
4582             // EXCEPTION_VAR = $var
4583 140330           SPVM_OPCODE opcode = {0};
4584            
4585 140330           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_EXCEPTION_VAR);
4586 140330           int32_t runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4587 140330           opcode.operand0 = runtime_var_index_in;
4588 141329           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
4589             }
4590             }
4591             // $array->[$index] = $var
4592 123054 100         else if (op_assign_dist->id == SPVM_OP_C_ID_ARRAY_ACCESS) {
4593            
4594             // $VAR_ARRAY->[$VAR_INDEX] = $VAR_TERM
4595            
4596 73089           SPVM_OP* op_array_access = op_assign_dist;
4597 73089           SPVM_OP* op_term_array = op_array_access->first;
4598 73089           SPVM_OP* op_term_index = op_array_access->last;
4599              
4600 73089           SPVM_TYPE* array_type = SPVM_CHECK_get_type(compiler, op_term_array);
4601 73089           int32_t array_type_dimension = array_type->dimension;
4602 73089           int32_t array_basic_type_id = array_type->basic_type->id;
4603 73089           int32_t array_basic_type_category = array_type->basic_type->category;
4604              
4605 73089 100         if (SPVM_TYPE_is_any_object_array_type(compiler, array_type->basic_type->id, array_type->dimension, array_type->flag)) {
4606 18455           SPVM_TYPE* src_type = SPVM_CHECK_get_type(compiler, op_assign_src);
4607              
4608 18455 100         if (SPVM_TYPE_is_undef_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
4609 1566           SPVM_OPCODE opcode = {0};
4610            
4611            
4612 1566           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_ARRAY_ELEMENT_UNDEF);
4613            
4614 1566           int32_t runtime_var_index_array = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_array);
4615 1566           int32_t runtime_var_index_index = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_index);
4616            
4617 1566           opcode.operand0 = runtime_var_index_array;
4618 1566           opcode.operand1 = runtime_var_index_index;
4619 1566           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
4620             }
4621             else {
4622 16889           SPVM_OPCODE opcode = {0};
4623            
4624            
4625 16889           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_ARRAY_ELEMENT_OBJECT_CHECK_TYPE);
4626 16889           int32_t runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4627            
4628 16889           int32_t runtime_var_index_array = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_array);
4629 16889           int32_t runtime_var_index_index = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_index);
4630            
4631 16889           opcode.operand0 = runtime_var_index_array;
4632 16889           opcode.operand1 = runtime_var_index_index;
4633 16889           opcode.operand2 = runtime_var_index_in;
4634 16889           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
4635              
4636 18455           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_cur->line);
4637             }
4638             }
4639 54634 100         else if (SPVM_TYPE_is_mulnum_array_type(compiler, array_type->basic_type->id, array_type->dimension, array_type->flag)) {
4640 13           SPVM_FIELD* first_field = SPVM_LIST_get(array_type->basic_type->fields, 0);
4641            
4642 13           SPVM_TYPE* element_type = SPVM_CHECK_get_type(compiler, first_field->op_field);
4643              
4644 13           SPVM_OPCODE opcode = {0};
4645            
4646            
4647 13 50         assert(SPVM_TYPE_is_numeric_type(compiler, element_type->basic_type->id, element_type->dimension, element_type->flag));
4648             int32_t runtime_var_index_in;
4649 13 100         if (element_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE) {
4650 2           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_MULNUM_ARRAY_BYTE);
4651 2           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4652             }
4653 11 100         else if (element_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT) {
4654 2           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_MULNUM_ARRAY_SHORT);
4655 2           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4656             }
4657 9 100         else if (element_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_INT) {
4658 2           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_MULNUM_ARRAY_INT);
4659 2           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4660             }
4661 7 100         else if (element_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_LONG) {
4662 2           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_MULNUM_ARRAY_LONG);
4663 2           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4664             }
4665 5 100         else if (element_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT) {
4666 2           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_MULNUM_ARRAY_FLOAT);
4667 2           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4668             }
4669 3 50         else if (element_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE) {
4670 3           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_MULNUM_ARRAY_DOUBLE);
4671 3           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4672             }
4673             else {
4674 0           assert(0);
4675             }
4676              
4677 13           int32_t runtime_var_index_array = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_array);
4678 13           int32_t runtime_var_index_index = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_index);
4679 13           int32_t fields_length = array_type->basic_type->fields->length;
4680            
4681 13           opcode.operand0 = runtime_var_index_array;
4682 13           opcode.operand1 = runtime_var_index_index;
4683 13           opcode.operand2 = runtime_var_index_in;
4684 13           int32_t operand3 = fields_length;
4685 13 50         assert(operand3 < 0xFFFF);
4686 13           opcode.operand3 = operand3;
4687              
4688 13           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
4689              
4690 13           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_cur->line);
4691             }
4692             else {
4693            
4694 54621           SPVM_TYPE* element_type = SPVM_CHECK_get_type(compiler, op_assign_src);
4695              
4696 54621 100         if (SPVM_TYPE_is_undef_type(compiler, element_type->basic_type->id, element_type->dimension, element_type->flag)) {
4697 43           SPVM_OPCODE opcode = {0};
4698            
4699            
4700 43           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_ARRAY_ELEMENT_UNDEF);
4701            
4702 43           int32_t runtime_var_index_array = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_array);
4703 43           int32_t runtime_var_index_index = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_index);
4704            
4705 43           opcode.operand0 = runtime_var_index_array;
4706 43           opcode.operand1 = runtime_var_index_index;
4707 43           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
4708              
4709 43           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_cur->line);
4710             }
4711             else {
4712 54578           SPVM_OPCODE opcode = {0};
4713            
4714            
4715             int32_t runtime_var_index_in;
4716 54578 100         if (SPVM_TYPE_is_numeric_type(compiler, element_type->basic_type->id, element_type->dimension, element_type->flag)) {
4717 43223 100         if (element_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE) {
4718 11423           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_ARRAY_ELEMENT_BYTE);
4719 11423           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4720             }
4721 31800 100         else if (element_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT) {
4722 5436           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_ARRAY_ELEMENT_SHORT);
4723 5436           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4724             }
4725 26364 100         else if (element_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_INT) {
4726 10063           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_ARRAY_ELEMENT_INT);
4727 10063           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4728             }
4729 16301 100         else if (element_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_LONG) {
4730 5424           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_ARRAY_ELEMENT_LONG);
4731 5424           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4732             }
4733 10877 100         else if (element_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT) {
4734 5410           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_ARRAY_ELEMENT_FLOAT);
4735 5410           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4736             }
4737 5467 50         else if (element_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE) {
4738 5467           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_ARRAY_ELEMENT_DOUBLE);
4739 5467           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4740             }
4741             else {
4742 0           assert(0);
4743             }
4744             }
4745             else {
4746             int32_t is_check_type;
4747 11355 100         if (array_type_dimension == 1) {
4748 11304 100         switch (array_basic_type_category) {
4749             case SPVM_NATIVE_C_BASIC_TYPE_CATEGORY_INTERFACE:
4750             case SPVM_NATIVE_C_BASIC_TYPE_CATEGORY_ANY_OBJECT:
4751             {
4752 14           is_check_type = 1;
4753 14           break;
4754             }
4755             default: {
4756 11290           is_check_type = 0;
4757 11290           break;
4758             }
4759             }
4760             }
4761            
4762 11355 100         if (is_check_type) {
4763 28           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_ARRAY_ELEMENT_OBJECT_CHECK_TYPE);
4764             }
4765             else {
4766 11327           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_ARRAY_ELEMENT_OBJECT);
4767             }
4768 11355           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4769             }
4770            
4771 54578           int32_t runtime_var_index_array = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_array);
4772 54578           int32_t runtime_var_index_index = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_index);
4773            
4774 54578           opcode.operand0 = runtime_var_index_array;
4775 54578           opcode.operand1 = runtime_var_index_index;
4776 54578           opcode.operand2 = runtime_var_index_in;
4777 54578           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
4778              
4779 73089           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_cur->line);
4780             }
4781             }
4782             }
4783             // $invocant->{FIELD_NAME} = $var
4784 49965 100         else if (op_assign_dist->id == SPVM_OP_C_ID_FIELD_ACCESS) {
4785            
4786 48997           SPVM_OP* op_field_access = op_assign_dist;
4787 48997           SPVM_OP* op_term_invocant = op_field_access->first;
4788              
4789             // Call field
4790 48997           SPVM_FIELD_ACCESS* field_access = op_field_access->uv.field_access;
4791              
4792 48997           SPVM_TYPE* src_type = SPVM_CHECK_get_type(compiler, op_assign_src);
4793            
4794 48997           SPVM_TYPE* invocant_type = SPVM_CHECK_get_type(compiler, op_term_invocant);
4795            
4796 48997 100         if (SPVM_TYPE_is_mulnum_ref_type(compiler, invocant_type->basic_type->id, invocant_type->dimension, invocant_type->flag)) {
4797 182           SPVM_FIELD* field = field_access->field;
4798            
4799 182           SPVM_OPCODE opcode = {0};
4800            
4801             int32_t runtime_var_index_in;
4802 182           switch (src_type->basic_type->id) {
4803             case SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE: {
4804 24           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_MULNUM_FIELD_DEREF_BYTE);
4805 24           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4806 24           break;
4807             }
4808             case SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT: {
4809 24           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_MULNUM_FIELD_DEREF_SHORT);
4810 24           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4811 24           break;
4812             }
4813             case SPVM_NATIVE_C_BASIC_TYPE_ID_INT: {
4814 48           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_MULNUM_FIELD_DEREF_INT);
4815 48           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4816 48           break;
4817             }
4818             case SPVM_NATIVE_C_BASIC_TYPE_ID_LONG: {
4819 24           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_MULNUM_FIELD_DEREF_LONG);
4820 24           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4821 24           break;
4822             }
4823             case SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT: {
4824 30           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_MULNUM_FIELD_DEREF_FLOAT);
4825 30           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4826 30           break;
4827             }
4828             case SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE: {
4829 32           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_MULNUM_FIELD_DEREF_DOUBLE);
4830 32           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4831 32           break;
4832             }
4833             default: {
4834 0           assert(0);
4835             }
4836             }
4837              
4838 182           int32_t runtime_var_index_invocant = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_invocant);
4839 182           int32_t field_offset = field->index;
4840              
4841 182           opcode.operand0 = runtime_var_index_invocant;
4842 182           opcode.operand1 = runtime_var_index_in;
4843 182           opcode.operand2 = field_offset;
4844              
4845 182           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
4846             }
4847 48815 100         else if (SPVM_TYPE_is_mulnum_type(compiler, invocant_type->basic_type->id, invocant_type->dimension, invocant_type->flag)) {
4848 947           SPVM_OPCODE opcode = {0};
4849            
4850            
4851 947 50         assert(SPVM_TYPE_is_numeric_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag));
4852             int32_t runtime_var_index_out;
4853             int32_t runtime_var_index_in;
4854 947 100         if (src_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE) {
4855 158           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_MULNUM_FIELD_BYTE);
4856 158           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_invocant);
4857 158           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4858             }
4859 789 100         else if (src_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT) {
4860 154           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_MULNUM_FIELD_SHORT);
4861 154           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_invocant);
4862 154           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4863             }
4864 635 100         else if (src_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_INT) {
4865 154           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_MULNUM_FIELD_INT);
4866 154           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_invocant);
4867 154           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4868             }
4869 481 100         else if (src_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_LONG) {
4870 154           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_MULNUM_FIELD_LONG);
4871 154           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_invocant);
4872 154           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4873             }
4874 327 100         else if (src_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT) {
4875 148           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_MULNUM_FIELD_FLOAT);
4876 148           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_invocant);
4877 148           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4878             }
4879 179 50         else if (src_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE) {
4880 179           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_MULNUM_FIELD_DOUBLE);
4881 179           runtime_var_index_out = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_invocant);
4882 179           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4883             }
4884             else {
4885 0           assert(0);
4886             }
4887            
4888 947           SPVM_FIELD* field = field_access->field;
4889 947           int32_t field_offset = field->index;
4890            
4891 947           opcode.operand0 = runtime_var_index_out;
4892 947           opcode.operand1 = runtime_var_index_in;
4893 947           opcode.operand2 = field_offset;
4894            
4895 947           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
4896             }
4897             else {
4898 47868 100         if (SPVM_TYPE_is_undef_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
4899 1053           SPVM_OPCODE opcode = {0};
4900            
4901 1053           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_FIELD_UNDEF);
4902            
4903 1053           int32_t runtime_var_index_invocant = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_invocant);
4904              
4905 1053           SPVM_FIELD* field = field_access->field;
4906            
4907 1053           opcode.operand0 = runtime_var_index_invocant;
4908 1053           opcode.operand2 = field->current_basic_type->id;
4909 1053           opcode.operand3 = (uint16_t)field->index;
4910 1053           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
4911              
4912 1053           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_cur->line);
4913             }
4914             else {
4915 46815           SPVM_OPCODE opcode = {0};
4916            
4917            
4918             int32_t runtime_var_index_in;
4919 46815 100         if (SPVM_TYPE_is_numeric_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
4920 34717 100         if (src_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE) {
4921 1145           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_FIELD_BYTE);
4922 1145           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4923             }
4924 33572 100         else if (src_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT) {
4925 1145           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_FIELD_SHORT);
4926 1145           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4927             }
4928 32427 100         else if (src_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_INT) {
4929 28992           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_FIELD_INT);
4930 28992           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4931             }
4932 3435 100         else if (src_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_LONG) {
4933 1145           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_FIELD_LONG);
4934 1145           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4935             }
4936 2290 100         else if (src_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT) {
4937 1145           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_FIELD_FLOAT);
4938 1145           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4939             }
4940 1145 50         else if (src_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE) {
4941 1145           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_FIELD_DOUBLE);
4942 1145           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4943             }
4944             else {
4945 0           assert(0);
4946             }
4947             }
4948 12098 50         else if (SPVM_TYPE_is_object_type(compiler, src_type->basic_type->id, src_type->dimension, src_type->flag)) {
4949 12098           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_FIELD_OBJECT);
4950 12098           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4951             }
4952             else {
4953 0           assert(0);
4954             }
4955            
4956 46815           int32_t runtime_var_index_invocant = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_invocant);
4957              
4958 46815           SPVM_FIELD* field = field_access->field;
4959            
4960 46815           opcode.operand0 = runtime_var_index_invocant;
4961 46815           opcode.operand1 = runtime_var_index_in;
4962 46815           opcode.operand2 = field->current_basic_type->id;
4963 46815           opcode.operand3 = (uint16_t)field->index;
4964 46815           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
4965              
4966 48997           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_cur->line);
4967             }
4968             }
4969             }
4970             // $mulnum_array->[$index]{FIELD_NAME} = $var
4971 968 50         else if (op_assign_dist->id == SPVM_OP_C_ID_ARRAY_FIELD_ACCESS) {
4972            
4973 968           SPVM_OP* op_array_field_access = op_assign_dist;
4974 968           SPVM_OP* op_term_invocant = op_array_field_access->first;
4975 968           SPVM_OP* op_term_index = op_array_field_access->last;
4976              
4977             // Call field
4978 968           SPVM_ARRAY_FIELD_ACCESS* array_field_access = op_array_field_access->uv.array_field_access;
4979 968           SPVM_FIELD* field = array_field_access->field;
4980              
4981             // Array type
4982 968           SPVM_TYPE* array_type = SPVM_CHECK_get_type(compiler, op_array_field_access->first);
4983 968           SPVM_BASIC_TYPE* array_basic_type = array_type->basic_type;
4984              
4985             // Element type
4986 968           SPVM_TYPE* element_type = SPVM_CHECK_get_type(compiler, op_assign_src);
4987            
4988 968           SPVM_OPCODE opcode = {0};
4989            
4990            
4991             int32_t runtime_var_index_in;
4992 968 100         if (element_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_BYTE) {
4993 154           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_MULNUM_ARRAY_FIELD_BYTE);
4994 154           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4995             }
4996 814 100         else if (element_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_SHORT) {
4997 154           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_MULNUM_ARRAY_FIELD_SHORT);
4998 154           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
4999             }
5000 660 100         else if (element_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_INT) {
5001 172           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_MULNUM_ARRAY_FIELD_INT);
5002 172           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
5003             }
5004 488 100         else if (element_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_LONG) {
5005 148           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_MULNUM_ARRAY_FIELD_LONG);
5006 148           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
5007             }
5008 340 100         else if (element_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_FLOAT) {
5009 160           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_MULNUM_ARRAY_FIELD_FLOAT);
5010 160           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
5011             }
5012 180 50         else if (element_type->basic_type->id == SPVM_NATIVE_C_BASIC_TYPE_ID_DOUBLE) {
5013 180           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_SET_MULNUM_ARRAY_FIELD_DOUBLE);
5014 180           runtime_var_index_in = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_assign_src);
5015             }
5016             else {
5017 0           assert(0);
5018             }
5019            
5020 968           int32_t runtime_var_index_invocant = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_invocant);
5021 968           int32_t runtime_var_index_index = SPVM_OPCODE_BUILDER_get_runtime_var_index(compiler, op_term_index);
5022              
5023 968           int32_t fields_length = array_basic_type->fields->length;
5024 968           int32_t field_offset = field->index;
5025            
5026 968           opcode.operand0 = runtime_var_index_invocant;
5027 968           opcode.operand1 = runtime_var_index_index;
5028 968           opcode.operand2 = runtime_var_index_in;
5029 968           int32_t operand3 = (field_offset << 8) + (fields_length - 1);
5030 968 50         assert(operand3 < 0xFFFF);
5031 968           opcode.operand3 = operand3;
5032            
5033 968           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
5034              
5035 968           SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(compiler, opcode_list, eval_block_stack_goto_opcode_index->length, unresolved_goto_end_of_eval_on_exception_opcode_index_stack, unresolved_goto_end_of_method_on_exception_opcode_index_stack, method->op_method, op_cur->line);
5036             }
5037             else {
5038 0           assert(0);
5039             }
5040            
5041 3527983           break;
5042             }
5043             }
5044            
5045             // [END]Postorder traversal position
5046            
5047 22127333 100         if (op_cur == op_base) {
5048 217247           finish = 1;
5049 217247           break;
5050             }
5051            
5052             // Next sibling
5053 21910086 100         if (op_cur->moresib) {
5054 9510156           op_cur = SPVM_OP_sibling(compiler, op_cur);
5055 9510156           break;
5056             }
5057             // Next is parent
5058             else {
5059 12399930           op_cur = op_cur->sibparent;
5060             }
5061 12399930           }
5062 9727403 100         if (finish) {
5063 217247           break;
5064             }
5065             }
5066             }
5067              
5068             // Free list
5069 223002           SPVM_LIST_free(unresolved_if_eq_or_if_ne_opcode_index_stack);
5070 223002           SPVM_LIST_free(if_block_stack_goto_end_opcode_index);
5071 223002           SPVM_LIST_free(loop_block_stack_goto_opcode_index);
5072 223002           SPVM_LIST_free(unresolved_last_opcode_index_stack);
5073 223002           SPVM_LIST_free(unresolved_break_opcode_index_stack);
5074 223002           SPVM_LIST_free(unresolved_next_opcode_index_stack);
5075 223002           SPVM_LIST_free(eval_block_stack_goto_opcode_index);
5076 223002           SPVM_LIST_free(unresolved_goto_end_of_eval_on_exception_opcode_index_stack);
5077 223002           SPVM_LIST_free(unresolved_goto_end_of_method_on_exception_opcode_index_stack);
5078 223002           SPVM_LIST_free(unresolved_return_opcode_index_stack);
5079 223002           SPVM_LIST_free(switch_stack_switch_info);
5080 223002           SPVM_LIST_free(loop_block_stack_next_base);
5081 223002           SPVM_LIST_free(loop_block_stack_last_base);
5082 223002           SPVM_LIST_free(switch_block_stack_break_base);
5083 223002           SPVM_LIST_free(mortal_stack);
5084 223002           SPVM_LIST_free(block_stack_runtime_var_index_top);
5085            
5086             END_OF_FUNCTION: {
5087            
5088 288543           SPVM_OPCODE opcode = {0};
5089            
5090 288543           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_END_METHOD);
5091 288543           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
5092            
5093 288543           method->mortal_stack_length = mortal_stack_top + 1;
5094             }
5095             }
5096             }
5097            
5098             #ifdef SPVM_DEBUG_COMPILE
5099             fprintf(stderr, "\n[Opcodes]\n");
5100             SPVM_DUMPER_dump_basic_types_opcode_list(compiler, compiler->basic_types);
5101             #endif
5102              
5103 3119           }
5104              
5105 9472483           void SPVM_OPCODE_BUILDER_set_opcode_id(SPVM_COMPILER* compiler, SPVM_OPCODE* opcode, int32_t opcode_id) {
5106 9472483           opcode->id = opcode_id;
5107 9472483           }
5108              
5109 912063           void SPVM_OPCODE_BUILDER_push_unresolved_goto_end_of_eval_or_end_of_method_on_exception(
5110             SPVM_COMPILER* compiler,
5111             SPVM_OPCODE_LIST* opcode_list,
5112             int32_t in_eval_block,
5113             SPVM_LIST* unresolved_goto_end_of_eval_on_exception_opcode_index_stack,
5114             SPVM_LIST* unresolved_goto_end_of_method_on_exception_opcode_index_stack,
5115             SPVM_OP* op_method,
5116             int32_t line
5117             )
5118             {
5119 912063           SPVM_METHOD* method = op_method->uv.method;
5120 912063           int32_t method_opcodes_base_address_id = 0;
5121            
5122 912063 100         if (in_eval_block) {
5123 2766           SPVM_OPCODE opcode = {0};
5124            
5125 2766           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GOTO_END_OF_EVAL_ON_EXCEPTION);
5126            
5127 2766           opcode.operand2 = line;
5128            
5129 2766           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
5130            
5131 2766           int32_t goto_end_of_eval_on_exception_opcode_index = opcode_list->length - 1;
5132            
5133 2766           SPVM_LIST_push(unresolved_goto_end_of_eval_on_exception_opcode_index_stack, (void*)(intptr_t)goto_end_of_eval_on_exception_opcode_index);
5134             }
5135             else {
5136 909297           SPVM_OPCODE opcode = {0};
5137            
5138 909297           SPVM_OPCODE_BUILDER_set_opcode_id(compiler, &opcode, SPVM_OPCODE_C_ID_GOTO_END_OF_METHOD_ON_EXCEPTION);
5139 909297           opcode.operand2 = line;
5140 909297           SPVM_OPCODE_LIST_push_opcode(compiler, opcode_list, &opcode);
5141            
5142 909297           int32_t goto_end_of_method_on_exception_opcode_index = opcode_list->length - 1;
5143            
5144 909297           SPVM_LIST_push(unresolved_goto_end_of_method_on_exception_opcode_index_stack, (void*)(intptr_t)(goto_end_of_method_on_exception_opcode_index));
5145             }
5146 912063           }
5147              
5148 7368393           int32_t SPVM_OPCODE_BUILDER_get_runtime_var_index(SPVM_COMPILER* compiler, SPVM_OP* op) {
5149             (void)compiler;
5150            
5151 7368393 50         switch (op->id) {
5152             case SPVM_OP_C_ID_BOOL:
5153             case SPVM_OP_C_ID_NUMERIC_EQ:
5154             case SPVM_OP_C_ID_NUMERIC_NE:
5155             case SPVM_OP_C_ID_NUMERIC_GT:
5156             case SPVM_OP_C_ID_NUMERIC_GE:
5157             case SPVM_OP_C_ID_NUMERIC_LT:
5158             case SPVM_OP_C_ID_NUMERIC_LE:
5159             case SPVM_OP_C_ID_NUMERIC_CMP:
5160             case SPVM_OP_C_ID_STRING_EQ:
5161             case SPVM_OP_C_ID_STRING_NE:
5162             case SPVM_OP_C_ID_STRING_GT:
5163             case SPVM_OP_C_ID_STRING_GE:
5164             case SPVM_OP_C_ID_STRING_LT:
5165             case SPVM_OP_C_ID_STRING_LE:
5166             case SPVM_OP_C_ID_STRING_CMP:
5167             case SPVM_OP_C_ID_ISA:
5168             case SPVM_OP_C_ID_ISA_ERROR:
5169             case SPVM_OP_C_ID_IS_TYPE:
5170             case SPVM_OP_C_ID_IS_ERROR:
5171             case SPVM_OP_C_ID_IS_COMPILE_TYPE:
5172             case SPVM_OP_C_ID_ISWEAK_FIELD:
5173             case SPVM_OP_C_ID_CAN:
5174             {
5175 0           return 0;
5176             }
5177             default: {
5178             SPVM_OP* op_var;
5179 7368393 100         if (op->id == SPVM_OP_C_ID_VAR) {
5180 5591356           op_var = op;
5181             }
5182 1777037 100         else if (op->id == SPVM_OP_C_ID_ASSIGN) {
5183 1759593 100         if (op->first->id == SPVM_OP_C_ID_VAR || op->first->id == SPVM_OP_C_ID_ASSIGN) {
    100          
5184 8           op_var = SPVM_OPCODE_BUILDER_get_returned_op_var(compiler, op->first);
5185             }
5186 1759585 50         else if (op->last->id == SPVM_OP_C_ID_VAR || op->last->id == SPVM_OP_C_ID_ASSIGN) {
    0          
5187 1759585           op_var = SPVM_OPCODE_BUILDER_get_returned_op_var(compiler, op->last);
5188             }
5189             else {
5190 1759593           assert(0);
5191             }
5192             }
5193 17444 100         else if (op->id == SPVM_OP_C_ID_SEQUENCE) {
5194 8831           op_var = SPVM_OPCODE_BUILDER_get_returned_op_var(compiler, op->last);
5195             }
5196 8613 100         else if (op->id == SPVM_OP_C_ID_CREATE_REF) {
5197 5030           op_var = SPVM_OPCODE_BUILDER_get_returned_op_var(compiler, op->first);
5198             }
5199 3583 50         else if (op->id == SPVM_OP_C_ID_DEREF) {
5200 3583           op_var = SPVM_OPCODE_BUILDER_get_returned_op_var(compiler, op->first);
5201             }
5202             else {
5203 0           spvm_warn("Unexpcted op:%s", SPVM_OP_get_op_name(compiler, op->id));
5204 0           assert(0);
5205             }
5206            
5207 7368393           return op_var->uv.var->var_decl->runtime_var_index;
5208             }
5209             }
5210            
5211             return -1;
5212             }
5213              
5214 1777051           SPVM_OP* SPVM_OPCODE_BUILDER_get_returned_op_var(SPVM_COMPILER* compiler, SPVM_OP* op) {
5215             (void)compiler;
5216            
5217             SPVM_OP* op_var;
5218 1777051 100         if (op->id == SPVM_OP_C_ID_VAR) {
5219 1777037           op_var = op;
5220             }
5221 14 50         else if (op->id == SPVM_OP_C_ID_ASSIGN) {
5222 14 50         if (op->first->id == SPVM_OP_C_ID_VAR || op->first->id == SPVM_OP_C_ID_ASSIGN) {
    50          
5223 0           op_var = SPVM_OPCODE_BUILDER_get_returned_op_var(compiler, op->first);
5224             }
5225 14 50         else if (op->last->id == SPVM_OP_C_ID_VAR || op->last->id == SPVM_OP_C_ID_ASSIGN) {
    0          
5226 14           op_var = SPVM_OPCODE_BUILDER_get_returned_op_var(compiler, op->last);
5227             }
5228             else {
5229 14           assert(0);
5230             }
5231             }
5232 0 0         else if (op->id == SPVM_OP_C_ID_SEQUENCE) {
5233 0           op_var = SPVM_OPCODE_BUILDER_get_returned_op_var(compiler, op->last);
5234             }
5235 0 0         else if (op->id == SPVM_OP_C_ID_CREATE_REF) {
5236 0           op_var = SPVM_OPCODE_BUILDER_get_returned_op_var(compiler, op->first);
5237             }
5238 0 0         else if (op->id == SPVM_OP_C_ID_DEREF) {
5239 0           op_var = SPVM_OPCODE_BUILDER_get_returned_op_var(compiler, op->first);
5240             }
5241             else {
5242 0           spvm_warn("Unexpcted op:%s", SPVM_OP_get_op_name(compiler, op->id));
5243 0           assert(0);
5244             }
5245            
5246 1777051           return op_var;
5247             }
5248