Rename unzip tool.
[SquirrelJME.git] / nanocoat / include / sjme / bytecode.h
bloba313340e6b5de7e51ee06d7c152dcad6861cb99d
1 /* -*- Mode: C; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
3 // SquirrelJME
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the Mozilla Public License Version 2.0.
7 // See license.mkd for licensing and copyright information.
8 // -------------------------------------------------------------------------*/
10 /**
11 * Bytecode Execution Support.
13 * @since 2023/11/18
16 #ifndef SQUIRRELJME_BYTECODE_H
17 #define SQUIRRELJME_BYTECODE_H
19 #include "sjme/nvm.h"
21 /* Anti-C++. */
22 #ifdef __cplusplus
23 #ifndef SJME_CXX_IS_EXTERNED
24 #define SJME_CXX_IS_EXTERNED
25 #define SJME_CXX_SQUIRRELJME_BYTECODE_H
26 extern "C" {
27 #endif /* #ifdef SJME_CXX_IS_EXTERNED */
28 #endif /* #ifdef __cplusplus */
30 /*--------------------------------------------------------------------------*/
32 /**
33 * Enumeration for byte code instructions.
35 * @since 2023/11/18
37 typedef enum sjme_byteCode_instruction
39 /** NOP. */
40 SJME_BYTECODE_INSTRUCTION_NOP = 0,
42 /** ACONST_NULL. */
43 SJME_BYTECODE_INSTRUCTION_ACONST_NULL = 1,
45 /** ICONST_M1. */
46 SJME_BYTECODE_INSTRUCTION_ICONST_M1 = 2,
48 /** ICONST_0. */
49 SJME_BYTECODE_INSTRUCTION_ICONST_0 = 3,
51 /** ICONST_1. */
52 SJME_BYTECODE_INSTRUCTION_ICONST_1 = 4,
54 /** ICONST_2. */
55 SJME_BYTECODE_INSTRUCTION_ICONST_2 = 5,
57 /** ICONST_3. */
58 SJME_BYTECODE_INSTRUCTION_ICONST_3 = 6,
60 /** ICONST_4. */
61 SJME_BYTECODE_INSTRUCTION_ICONST_4 = 7,
63 /** ICONST_5. */
64 SJME_BYTECODE_INSTRUCTION_ICONST_5 = 8,
66 /** LCONST_0. */
67 SJME_BYTECODE_INSTRUCTION_LCONST_0 = 9,
69 /** LCONST_1. */
70 SJME_BYTECODE_INSTRUCTION_LCONST_1 = 10,
72 /** FCONST_0. */
73 SJME_BYTECODE_INSTRUCTION_FCONST_0 = 11,
75 /** FCONST_1. */
76 SJME_BYTECODE_INSTRUCTION_FCONST_1 = 12,
78 /** FCONST_2. */
79 SJME_BYTECODE_INSTRUCTION_FCONST_2 = 13,
81 /** DCONST_0. */
82 SJME_BYTECODE_INSTRUCTION_DCONST_0 = 14,
84 /** DCONST_1. */
85 SJME_BYTECODE_INSTRUCTION_DCONST_1 = 15,
87 /** BIPUSH. */
88 SJME_BYTECODE_INSTRUCTION_BIPUSH = 16,
90 /** SIPUSH. */
91 SJME_BYTECODE_INSTRUCTION_SIPUSH = 17,
93 /** LDC. */
94 SJME_BYTECODE_INSTRUCTION_LDC = 18,
96 /** LDC_W. */
97 SJME_BYTECODE_INSTRUCTION_LDC_W = 19,
99 /** LDC2_W. */
100 SJME_BYTECODE_INSTRUCTION_LDC2_W = 20,
102 /** ILOAD. */
103 SJME_BYTECODE_INSTRUCTION_ILOAD = 21,
105 /** LLOAD. */
106 SJME_BYTECODE_INSTRUCTION_LLOAD = 22,
108 /** FLOAD. */
109 SJME_BYTECODE_INSTRUCTION_FLOAD = 23,
111 /** DLOAD. */
112 SJME_BYTECODE_INSTRUCTION_DLOAD = 24,
114 /** ALOAD. */
115 SJME_BYTECODE_INSTRUCTION_ALOAD = 25,
117 /** ILOAD_0. */
118 SJME_BYTECODE_INSTRUCTION_ILOAD_0 = 26,
120 /** ILOAD_1. */
121 SJME_BYTECODE_INSTRUCTION_ILOAD_1 = 27,
123 /** ILOAD_2. */
124 SJME_BYTECODE_INSTRUCTION_ILOAD_2 = 28,
126 /** ILOAD_3. */
127 SJME_BYTECODE_INSTRUCTION_ILOAD_3 = 29,
129 /** LLOAD_0. */
130 SJME_BYTECODE_INSTRUCTION_LLOAD_0 = 30,
132 /** LLOAD_1. */
133 SJME_BYTECODE_INSTRUCTION_LLOAD_1 = 31,
135 /** LLOAD_2. */
136 SJME_BYTECODE_INSTRUCTION_LLOAD_2 = 32,
138 /** LLOAD_3. */
139 SJME_BYTECODE_INSTRUCTION_LLOAD_3 = 33,
141 /** FLOAD_0. */
142 SJME_BYTECODE_INSTRUCTION_FLOAD_0 = 34,
144 /** FLOAD_1. */
145 SJME_BYTECODE_INSTRUCTION_FLOAD_1 = 35,
147 /** FLOAD_2. */
148 SJME_BYTECODE_INSTRUCTION_FLOAD_2 = 36,
150 /** FLOAD_3. */
151 SJME_BYTECODE_INSTRUCTION_FLOAD_3 = 37,
153 /** DLOAD_0. */
154 SJME_BYTECODE_INSTRUCTION_DLOAD_0 = 38,
156 /** DLOAD_1. */
157 SJME_BYTECODE_INSTRUCTION_DLOAD_1 = 39,
159 /** DLOAD_2. */
160 SJME_BYTECODE_INSTRUCTION_DLOAD_2 = 40,
162 /** DLOAD_3. */
163 SJME_BYTECODE_INSTRUCTION_DLOAD_3 = 41,
165 /** ALOAD_0. */
166 SJME_BYTECODE_INSTRUCTION_ALOAD_0 = 42,
168 /** ALOAD_1. */
169 SJME_BYTECODE_INSTRUCTION_ALOAD_1 = 43,
171 /** ALOAD_2. */
172 SJME_BYTECODE_INSTRUCTION_ALOAD_2 = 44,
174 /** ALOAD_3. */
175 SJME_BYTECODE_INSTRUCTION_ALOAD_3 = 45,
177 /** IALOAD. */
178 SJME_BYTECODE_INSTRUCTION_IALOAD = 46,
180 /** LALOAD. */
181 SJME_BYTECODE_INSTRUCTION_LALOAD = 47,
183 /** FALOAD. */
184 SJME_BYTECODE_INSTRUCTION_FALOAD = 48,
186 /** DALOAD. */
187 SJME_BYTECODE_INSTRUCTION_DALOAD = 49,
189 /** AALOAD. */
190 SJME_BYTECODE_INSTRUCTION_AALOAD = 50,
192 /** BALOAD. */
193 SJME_BYTECODE_INSTRUCTION_BALOAD = 51,
195 /** CALOAD. */
196 SJME_BYTECODE_INSTRUCTION_CALOAD = 52,
198 /** SALOAD. */
199 SJME_BYTECODE_INSTRUCTION_SALOAD = 53,
201 /** ISTORE. */
202 SJME_BYTECODE_INSTRUCTION_ISTORE = 54,
204 /** LSTORE. */
205 SJME_BYTECODE_INSTRUCTION_LSTORE = 55,
207 /** FSTORE. */
208 SJME_BYTECODE_INSTRUCTION_FSTORE = 56,
210 /** DSTORE. */
211 SJME_BYTECODE_INSTRUCTION_DSTORE = 57,
213 /** ASTORE. */
214 SJME_BYTECODE_INSTRUCTION_ASTORE = 58,
216 /** ISTORE_0. */
217 SJME_BYTECODE_INSTRUCTION_ISTORE_0 = 59,
219 /** ISTORE_1. */
220 SJME_BYTECODE_INSTRUCTION_ISTORE_1 = 60,
222 /** ISTORE_2. */
223 SJME_BYTECODE_INSTRUCTION_ISTORE_2 = 61,
225 /** ISTORE_3. */
226 SJME_BYTECODE_INSTRUCTION_ISTORE_3 = 62,
228 /** LSTORE_0. */
229 SJME_BYTECODE_INSTRUCTION_LSTORE_0 = 63,
231 /** LSTORE_1. */
232 SJME_BYTECODE_INSTRUCTION_LSTORE_1 = 64,
234 /** LSTORE_2. */
235 SJME_BYTECODE_INSTRUCTION_LSTORE_2 = 65,
237 /** LSTORE_3. */
238 SJME_BYTECODE_INSTRUCTION_LSTORE_3 = 66,
240 /** FSTORE_0. */
241 SJME_BYTECODE_INSTRUCTION_FSTORE_0 = 67,
243 /** FSTORE_1. */
244 SJME_BYTECODE_INSTRUCTION_FSTORE_1 = 68,
246 /** FSTORE_2. */
247 SJME_BYTECODE_INSTRUCTION_FSTORE_2 = 69,
249 /** FSTORE_3. */
250 SJME_BYTECODE_INSTRUCTION_FSTORE_3 = 70,
252 /** DSTORE_0. */
253 SJME_BYTECODE_INSTRUCTION_DSTORE_0 = 71,
255 /** DSTORE_1. */
256 SJME_BYTECODE_INSTRUCTION_DSTORE_1 = 72,
258 /** DSTORE_2. */
259 SJME_BYTECODE_INSTRUCTION_DSTORE_2 = 73,
261 /** DSTORE_3. */
262 SJME_BYTECODE_INSTRUCTION_DSTORE_3 = 74,
264 /** ASTORE_0. */
265 SJME_BYTECODE_INSTRUCTION_ASTORE_0 = 75,
267 /** ASTORE_1. */
268 SJME_BYTECODE_INSTRUCTION_ASTORE_1 = 76,
270 /** ASTORE_2. */
271 SJME_BYTECODE_INSTRUCTION_ASTORE_2 = 77,
273 /** ASTORE_3. */
274 SJME_BYTECODE_INSTRUCTION_ASTORE_3 = 78,
276 /** IASTORE. */
277 SJME_BYTECODE_INSTRUCTION_IASTORE = 79,
279 /** LASTORE. */
280 SJME_BYTECODE_INSTRUCTION_LASTORE = 80,
282 /** FASTORE. */
283 SJME_BYTECODE_INSTRUCTION_FASTORE = 81,
285 /** DASTORE. */
286 SJME_BYTECODE_INSTRUCTION_DASTORE = 82,
288 /** AASTORE. */
289 SJME_BYTECODE_INSTRUCTION_AASTORE = 83,
291 /** BASTORE. */
292 SJME_BYTECODE_INSTRUCTION_BASTORE = 84,
294 /** CASTORE. */
295 SJME_BYTECODE_INSTRUCTION_CASTORE = 85,
297 /** SASTORE. */
298 SJME_BYTECODE_INSTRUCTION_SASTORE = 86,
300 /** POP. */
301 SJME_BYTECODE_INSTRUCTION_POP = 87,
303 /** POP2. */
304 SJME_BYTECODE_INSTRUCTION_POP2 = 88,
306 /** DUP. */
307 SJME_BYTECODE_INSTRUCTION_DUP = 89,
309 /** DUP_X1. */
310 SJME_BYTECODE_INSTRUCTION_DUP_X1 = 90,
312 /** DUP_X2. */
313 SJME_BYTECODE_INSTRUCTION_DUP_X2 = 91,
315 /** DUP2. */
316 SJME_BYTECODE_INSTRUCTION_DUP2 = 92,
318 /** DUP2_X1. */
319 SJME_BYTECODE_INSTRUCTION_DUP2_X1 = 93,
321 /** DUP2_X2. */
322 SJME_BYTECODE_INSTRUCTION_DUP2_X2 = 94,
324 /** SWAP. */
325 SJME_BYTECODE_INSTRUCTION_SWAP = 95,
327 /** IADD. */
328 SJME_BYTECODE_INSTRUCTION_IADD = 96,
330 /** LADD. */
331 SJME_BYTECODE_INSTRUCTION_LADD = 97,
333 /** FADD. */
334 SJME_BYTECODE_INSTRUCTION_FADD = 98,
336 /** DADD. */
337 SJME_BYTECODE_INSTRUCTION_DADD = 99,
339 /** ISUB. */
340 SJME_BYTECODE_INSTRUCTION_ISUB = 100,
342 /** LSUB. */
343 SJME_BYTECODE_INSTRUCTION_LSUB = 101,
345 /** FSUB. */
346 SJME_BYTECODE_INSTRUCTION_FSUB = 102,
348 /** DSUB. */
349 SJME_BYTECODE_INSTRUCTION_DSUB = 103,
351 /** IMUL. */
352 SJME_BYTECODE_INSTRUCTION_IMUL = 104,
354 /** LMUL. */
355 SJME_BYTECODE_INSTRUCTION_LMUL = 105,
357 /** FMUL. */
358 SJME_BYTECODE_INSTRUCTION_FMUL = 106,
360 /** DMUL. */
361 SJME_BYTECODE_INSTRUCTION_DMUL = 107,
363 /** IDIV. */
364 SJME_BYTECODE_INSTRUCTION_IDIV = 108,
366 /** LDIV. */
367 SJME_BYTECODE_INSTRUCTION_LDIV = 109,
369 /** FDIV. */
370 SJME_BYTECODE_INSTRUCTION_FDIV = 110,
372 /** DDIV. */
373 SJME_BYTECODE_INSTRUCTION_DDIV = 111,
375 /** IREM. */
376 SJME_BYTECODE_INSTRUCTION_IREM = 112,
378 /** LREM. */
379 SJME_BYTECODE_INSTRUCTION_LREM = 113,
381 /** FREM. */
382 SJME_BYTECODE_INSTRUCTION_FREM = 114,
384 /** DREM. */
385 SJME_BYTECODE_INSTRUCTION_DREM = 115,
387 /** INEG. */
388 SJME_BYTECODE_INSTRUCTION_INEG = 116,
390 /** LNEG. */
391 SJME_BYTECODE_INSTRUCTION_LNEG = 117,
393 /** FNEG. */
394 SJME_BYTECODE_INSTRUCTION_FNEG = 118,
396 /** DNEG. */
397 SJME_BYTECODE_INSTRUCTION_DNEG = 119,
399 /** ISHL. */
400 SJME_BYTECODE_INSTRUCTION_ISHL = 120,
402 /** LSHL. */
403 SJME_BYTECODE_INSTRUCTION_LSHL = 121,
405 /** ISHR. */
406 SJME_BYTECODE_INSTRUCTION_ISHR = 122,
408 /** LSHR. */
409 SJME_BYTECODE_INSTRUCTION_LSHR = 123,
411 /** IUSHR. */
412 SJME_BYTECODE_INSTRUCTION_IUSHR = 124,
414 /** LUSHR. */
415 SJME_BYTECODE_INSTRUCTION_LUSHR = 125,
417 /** IAND. */
418 SJME_BYTECODE_INSTRUCTION_IAND = 126,
420 /** LAND. */
421 SJME_BYTECODE_INSTRUCTION_LAND = 127,
423 /** IOR. */
424 SJME_BYTECODE_INSTRUCTION_IOR = 128,
426 /** LOR. */
427 SJME_BYTECODE_INSTRUCTION_LOR = 129,
429 /** IXOR. */
430 SJME_BYTECODE_INSTRUCTION_IXOR = 130,
432 /** LXOR. */
433 SJME_BYTECODE_INSTRUCTION_LXOR = 131,
435 /** IINC. */
436 SJME_BYTECODE_INSTRUCTION_IINC = 132,
438 /** I2L. */
439 SJME_BYTECODE_INSTRUCTION_I2L = 133,
441 /** I2F. */
442 SJME_BYTECODE_INSTRUCTION_I2F = 134,
444 /** I2D. */
445 SJME_BYTECODE_INSTRUCTION_I2D = 135,
447 /** L2I. */
448 SJME_BYTECODE_INSTRUCTION_L2I = 136,
450 /** L2F. */
451 SJME_BYTECODE_INSTRUCTION_L2F = 137,
453 /** L2D. */
454 SJME_BYTECODE_INSTRUCTION_L2D = 138,
456 /** F2I. */
457 SJME_BYTECODE_INSTRUCTION_F2I = 139,
459 /** F2L. */
460 SJME_BYTECODE_INSTRUCTION_F2L = 140,
462 /** F2D. */
463 SJME_BYTECODE_INSTRUCTION_F2D = 141,
465 /** D2I. */
466 SJME_BYTECODE_INSTRUCTION_D2I = 142,
468 /** D2L. */
469 SJME_BYTECODE_INSTRUCTION_D2L = 143,
471 /** D2F. */
472 SJME_BYTECODE_INSTRUCTION_D2F = 144,
474 /** I2B. */
475 SJME_BYTECODE_INSTRUCTION_I2B = 145,
477 /** I2C. */
478 SJME_BYTECODE_INSTRUCTION_I2C = 146,
480 /** I2S. */
481 SJME_BYTECODE_INSTRUCTION_I2S = 147,
483 /** LCMP. */
484 SJME_BYTECODE_INSTRUCTION_LCMP = 148,
486 /** FCMPL. */
487 SJME_BYTECODE_INSTRUCTION_FCMPL = 149,
489 /** FCMPG. */
490 SJME_BYTECODE_INSTRUCTION_FCMPG = 150,
492 /** DCMPL. */
493 SJME_BYTECODE_INSTRUCTION_DCMPL = 151,
495 /** DCMPG. */
496 SJME_BYTECODE_INSTRUCTION_DCMPG = 152,
498 /** IFEQ. */
499 SJME_BYTECODE_INSTRUCTION_IFEQ = 153,
501 /** IFNE. */
502 SJME_BYTECODE_INSTRUCTION_IFNE = 154,
504 /** IFLT. */
505 SJME_BYTECODE_INSTRUCTION_IFLT = 155,
507 /** IFGE. */
508 SJME_BYTECODE_INSTRUCTION_IFGE = 156,
510 /** IFGT. */
511 SJME_BYTECODE_INSTRUCTION_IFGT = 157,
513 /** IFLE. */
514 SJME_BYTECODE_INSTRUCTION_IFLE = 158,
516 /** IF_ICMPEQ. */
517 SJME_BYTECODE_INSTRUCTION_IF_ICMPEQ = 159,
519 /** IF_ICMPNE. */
520 SJME_BYTECODE_INSTRUCTION_IF_ICMPNE = 160,
522 /** IF_ICMPLT. */
523 SJME_BYTECODE_INSTRUCTION_IF_ICMPLT = 161,
525 /** IF_ICMPGE. */
526 SJME_BYTECODE_INSTRUCTION_IF_ICMPGE = 162,
528 /** IF_ICMPGT. */
529 SJME_BYTECODE_INSTRUCTION_IF_ICMPGT = 163,
531 /** IF_ICMPLE. */
532 SJME_BYTECODE_INSTRUCTION_IF_ICMPLE = 164,
534 /** IF_ACMPEQ. */
535 SJME_BYTECODE_INSTRUCTION_IF_ACMPEQ = 165,
537 /** IF_ACMPNE. */
538 SJME_BYTECODE_INSTRUCTION_IF_ACMPNE = 166,
540 /** GOTO. */
541 SJME_BYTECODE_INSTRUCTION_GOTO = 167,
543 /** JSR. */
544 SJME_BYTECODE_INSTRUCTION_JSR = 168,
546 /** RET. */
547 SJME_BYTECODE_INSTRUCTION_RET = 169,
549 /** TABLESWITCH. */
550 SJME_BYTECODE_INSTRUCTION_TABLESWITCH = 170,
552 /** LOOKUPSWITCH. */
553 SJME_BYTECODE_INSTRUCTION_LOOKUPSWITCH = 171,
555 /** IRETURN. */
556 SJME_BYTECODE_INSTRUCTION_IRETURN = 172,
558 /** LRETURN. */
559 SJME_BYTECODE_INSTRUCTION_LRETURN = 173,
561 /** FRETURN. */
562 SJME_BYTECODE_INSTRUCTION_FRETURN = 174,
564 /** DRETURN. */
565 SJME_BYTECODE_INSTRUCTION_DRETURN = 175,
567 /** ARETURN. */
568 SJME_BYTECODE_INSTRUCTION_ARETURN = 176,
570 /** RETURN. */
571 SJME_BYTECODE_INSTRUCTION_RETURN = 177,
573 /** GETSTATIC. */
574 SJME_BYTECODE_INSTRUCTION_GETSTATIC = 178,
576 /** PUTSTATIC. */
577 SJME_BYTECODE_INSTRUCTION_PUTSTATIC = 179,
579 /** GETFIELD. */
580 SJME_BYTECODE_INSTRUCTION_GETFIELD = 180,
582 /** PUTFIELD. */
583 SJME_BYTECODE_INSTRUCTION_PUTFIELD = 181,
585 /** INVOKEVIRTUAL. */
586 SJME_BYTECODE_INSTRUCTION_INVOKEVIRTUAL = 182,
588 /** INVOKESPECIAL. */
589 SJME_BYTECODE_INSTRUCTION_INVOKESPECIAL = 183,
591 /** INVOKESTATIC. */
592 SJME_BYTECODE_INSTRUCTION_INVOKESTATIC = 184,
594 /** INVOKEINTERFACE. */
595 SJME_BYTECODE_INSTRUCTION_INVOKEINTERFACE = 185,
597 /** INVOKEDYNAMIC. */
598 SJME_BYTECODE_INSTRUCTION_INVOKEDYNAMIC = 186,
600 /** NEW. */
601 SJME_BYTECODE_INSTRUCTION_NEW = 187,
603 /** NEWARRAY. */
604 SJME_BYTECODE_INSTRUCTION_NEWARRAY = 188,
606 /** ANEWARRAY. */
607 SJME_BYTECODE_INSTRUCTION_ANEWARRAY = 189,
609 /** ARRAYLENGTH. */
610 SJME_BYTECODE_INSTRUCTION_ARRAYLENGTH = 190,
612 /** ATHROW. */
613 SJME_BYTECODE_INSTRUCTION_ATHROW = 191,
615 /** CHECKCAST. */
616 SJME_BYTECODE_INSTRUCTION_CHECKCAST = 192,
618 /** INSTANCEOF. */
619 SJME_BYTECODE_INSTRUCTION_INSTANCEOF = 193,
621 /** MONITORENTER. */
622 SJME_BYTECODE_INSTRUCTION_MONITORENTER = 194,
624 /** MONITOREXIT. */
625 SJME_BYTECODE_INSTRUCTION_MONITOREXIT = 195,
627 /** WIDE. */
628 SJME_BYTECODE_INSTRUCTION_WIDE = 196,
630 /** MULTIANEWARRAY. */
631 SJME_BYTECODE_INSTRUCTION_MULTIANEWARRAY = 197,
633 /** IFNULL. */
634 SJME_BYTECODE_INSTRUCTION_IFNULL = 198,
636 /** IFNONNULL. */
637 SJME_BYTECODE_INSTRUCTION_IFNONNULL = 199,
639 /** GOTO_W. */
640 SJME_BYTECODE_INSTRUCTION_GOTO_W = 200,
642 /** JSR_W. */
643 SJME_BYTECODE_INSTRUCTION_JSR_W = 201,
645 /** BREAKPOINT. */
646 SJME_BYTECODE_INSTRUCTION_BREAKPOINT = 202,
648 /** IMPDEP1. */
649 SJME_BYTECODE_INSTRUCTION_IMPDEP1 = 254,
651 /** IMPDEP2. */
652 SJME_BYTECODE_INSTRUCTION_IMPDEP2 = 255,
654 /** Wide ALOAD. */
655 SJME_BYTECODE_INSTRUCTION_WIDE_ALOAD =
656 (SJME_BYTECODE_INSTRUCTION_WIDE << 8) |
657 SJME_BYTECODE_INSTRUCTION_ALOAD,
659 /** Wide ILOAD. */
660 SJME_BYTECODE_INSTRUCTION_WIDE_ILOAD =
661 (SJME_BYTECODE_INSTRUCTION_WIDE << 8) |
662 SJME_BYTECODE_INSTRUCTION_ILOAD,
664 /** Wide LLOAD. */
665 SJME_BYTECODE_INSTRUCTION_WIDE_LLOAD =
666 (SJME_BYTECODE_INSTRUCTION_WIDE << 8) |
667 SJME_BYTECODE_INSTRUCTION_LLOAD,
669 /** Wide FLOAD. */
670 SJME_BYTECODE_INSTRUCTION_WIDE_FLOAD =
671 (SJME_BYTECODE_INSTRUCTION_WIDE << 8) |
672 SJME_BYTECODE_INSTRUCTION_FLOAD,
674 /** Wide DLOAD. */
675 SJME_BYTECODE_INSTRUCTION_WIDE_DLOAD =
676 (SJME_BYTECODE_INSTRUCTION_WIDE << 8) |
677 SJME_BYTECODE_INSTRUCTION_DLOAD,
679 /** Wide ASTORE. */
680 SJME_BYTECODE_INSTRUCTION_WIDE_ASTORE =
681 (SJME_BYTECODE_INSTRUCTION_WIDE << 8) |
682 SJME_BYTECODE_INSTRUCTION_ASTORE,
684 /** Wide ISTORE. */
685 SJME_BYTECODE_INSTRUCTION_WIDE_ISTORE =
686 (SJME_BYTECODE_INSTRUCTION_WIDE << 8) |
687 SJME_BYTECODE_INSTRUCTION_ISTORE,
689 /** Wide LSTORE. */
690 SJME_BYTECODE_INSTRUCTION_WIDE_LSTORE =
691 (SJME_BYTECODE_INSTRUCTION_WIDE << 8) |
692 SJME_BYTECODE_INSTRUCTION_LSTORE,
694 /** Wide FSTORE. */
695 SJME_BYTECODE_INSTRUCTION_WIDE_FSTORE =
696 (SJME_BYTECODE_INSTRUCTION_WIDE << 8) |
697 SJME_BYTECODE_INSTRUCTION_FSTORE,
699 /** Wide DSTORE. */
700 SJME_BYTECODE_INSTRUCTION_WIDE_DSTORE =
701 (SJME_BYTECODE_INSTRUCTION_WIDE << 8) |
702 SJME_BYTECODE_INSTRUCTION_DSTORE,
704 /** Wide IINC. */
705 SJME_BYTECODE_INSTRUCTION_WIDE_IINC =
706 (SJME_BYTECODE_INSTRUCTION_WIDE << 8) |
707 SJME_BYTECODE_INSTRUCTION_IINC,
708 } sjme_byteCode_instruction;
711 * Function type for byte code execution.
713 * @param frame The frame to execute under.
714 * @return Returns @c SJME_JNI_TRUE on success.
715 * @since 2023/11/18
717 typedef sjme_jboolean (*sjme_byteCode_function)(sjme_nvm_frame* frame);
720 * Contains a mapping of a byte code instruction to an actual operation.
722 * @since 2023/11/18
724 typedef struct sjme_byteCode_functionMap
726 /** The instruction this maps. */
727 sjme_byteCode_instruction instruction;
729 /** The function to execute. */
730 sjme_byteCode_function function;
731 } sjme_byteCode_functionMap;
734 * Maps a specific bytecode to the mapping for later execution.
736 * @param inInstruction The instruction to map.
737 * @param outMapping The output mapping.
738 * @return Returns @c SJME_JNI_TRUE if the instruction is valid and mappable.
739 * @since 2023/11/18
741 sjme_errorCode sjme_byteCode_map(
742 sjme_attrInValue sjme_byteCode_instruction inInstruction,
743 sjme_attrOutNotNull const sjme_byteCode_functionMap** outMapping);
745 /*--------------------------------------------------------------------------*/
747 /* Anti-C++. */
748 #ifdef __cplusplus
749 #ifdef SJME_CXX_SQUIRRELJME_BYTECODE_H
751 #undef SJME_CXX_SQUIRRELJME_BYTECODE_H
752 #undef SJME_CXX_IS_EXTERNED
753 #endif /* #ifdef SJME_CXX_SQUIRRELJME_BYTECODE_H */
754 #endif /* #ifdef __cplusplus */
756 #endif /* SQUIRRELJME_BYTECODE_H */