Cleanup and moving of NanoCoat VM specific headers to their own include directory...
[SquirrelJME.git] / nanocoat / include / sjme / nvm / bytecode.h
blobbc3c605a2c825bdd84a01c141f2f57262da38118
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/error.h"
20 #include "sjme/nvm/nvm.h"
22 /* Anti-C++. */
23 #ifdef __cplusplus
24 #ifndef SJME_CXX_IS_EXTERNED
25 #define SJME_CXX_IS_EXTERNED
26 #define SJME_CXX_SQUIRRELJME_BYTECODE_H
27 extern "C" {
28 #endif /* #ifdef SJME_CXX_IS_EXTERNED */
29 #endif /* #ifdef __cplusplus */
31 /*--------------------------------------------------------------------------*/
33 /**
34 * Enumeration for byte code instructions.
36 * @since 2023/11/18
38 typedef enum sjme_byteCode_instruction
40 /** NOP. */
41 SJME_BYTECODE_INSTRUCTION_NOP = 0,
43 /** ACONST_NULL. */
44 SJME_BYTECODE_INSTRUCTION_ACONST_NULL = 1,
46 /** ICONST_M1. */
47 SJME_BYTECODE_INSTRUCTION_ICONST_M1 = 2,
49 /** ICONST_0. */
50 SJME_BYTECODE_INSTRUCTION_ICONST_0 = 3,
52 /** ICONST_1. */
53 SJME_BYTECODE_INSTRUCTION_ICONST_1 = 4,
55 /** ICONST_2. */
56 SJME_BYTECODE_INSTRUCTION_ICONST_2 = 5,
58 /** ICONST_3. */
59 SJME_BYTECODE_INSTRUCTION_ICONST_3 = 6,
61 /** ICONST_4. */
62 SJME_BYTECODE_INSTRUCTION_ICONST_4 = 7,
64 /** ICONST_5. */
65 SJME_BYTECODE_INSTRUCTION_ICONST_5 = 8,
67 /** LCONST_0. */
68 SJME_BYTECODE_INSTRUCTION_LCONST_0 = 9,
70 /** LCONST_1. */
71 SJME_BYTECODE_INSTRUCTION_LCONST_1 = 10,
73 /** FCONST_0. */
74 SJME_BYTECODE_INSTRUCTION_FCONST_0 = 11,
76 /** FCONST_1. */
77 SJME_BYTECODE_INSTRUCTION_FCONST_1 = 12,
79 /** FCONST_2. */
80 SJME_BYTECODE_INSTRUCTION_FCONST_2 = 13,
82 /** DCONST_0. */
83 SJME_BYTECODE_INSTRUCTION_DCONST_0 = 14,
85 /** DCONST_1. */
86 SJME_BYTECODE_INSTRUCTION_DCONST_1 = 15,
88 /** BIPUSH. */
89 SJME_BYTECODE_INSTRUCTION_BIPUSH = 16,
91 /** SIPUSH. */
92 SJME_BYTECODE_INSTRUCTION_SIPUSH = 17,
94 /** LDC. */
95 SJME_BYTECODE_INSTRUCTION_LDC = 18,
97 /** LDC_W. */
98 SJME_BYTECODE_INSTRUCTION_LDC_W = 19,
100 /** LDC2_W. */
101 SJME_BYTECODE_INSTRUCTION_LDC2_W = 20,
103 /** ILOAD. */
104 SJME_BYTECODE_INSTRUCTION_ILOAD = 21,
106 /** LLOAD. */
107 SJME_BYTECODE_INSTRUCTION_LLOAD = 22,
109 /** FLOAD. */
110 SJME_BYTECODE_INSTRUCTION_FLOAD = 23,
112 /** DLOAD. */
113 SJME_BYTECODE_INSTRUCTION_DLOAD = 24,
115 /** ALOAD. */
116 SJME_BYTECODE_INSTRUCTION_ALOAD = 25,
118 /** ILOAD_0. */
119 SJME_BYTECODE_INSTRUCTION_ILOAD_0 = 26,
121 /** ILOAD_1. */
122 SJME_BYTECODE_INSTRUCTION_ILOAD_1 = 27,
124 /** ILOAD_2. */
125 SJME_BYTECODE_INSTRUCTION_ILOAD_2 = 28,
127 /** ILOAD_3. */
128 SJME_BYTECODE_INSTRUCTION_ILOAD_3 = 29,
130 /** LLOAD_0. */
131 SJME_BYTECODE_INSTRUCTION_LLOAD_0 = 30,
133 /** LLOAD_1. */
134 SJME_BYTECODE_INSTRUCTION_LLOAD_1 = 31,
136 /** LLOAD_2. */
137 SJME_BYTECODE_INSTRUCTION_LLOAD_2 = 32,
139 /** LLOAD_3. */
140 SJME_BYTECODE_INSTRUCTION_LLOAD_3 = 33,
142 /** FLOAD_0. */
143 SJME_BYTECODE_INSTRUCTION_FLOAD_0 = 34,
145 /** FLOAD_1. */
146 SJME_BYTECODE_INSTRUCTION_FLOAD_1 = 35,
148 /** FLOAD_2. */
149 SJME_BYTECODE_INSTRUCTION_FLOAD_2 = 36,
151 /** FLOAD_3. */
152 SJME_BYTECODE_INSTRUCTION_FLOAD_3 = 37,
154 /** DLOAD_0. */
155 SJME_BYTECODE_INSTRUCTION_DLOAD_0 = 38,
157 /** DLOAD_1. */
158 SJME_BYTECODE_INSTRUCTION_DLOAD_1 = 39,
160 /** DLOAD_2. */
161 SJME_BYTECODE_INSTRUCTION_DLOAD_2 = 40,
163 /** DLOAD_3. */
164 SJME_BYTECODE_INSTRUCTION_DLOAD_3 = 41,
166 /** ALOAD_0. */
167 SJME_BYTECODE_INSTRUCTION_ALOAD_0 = 42,
169 /** ALOAD_1. */
170 SJME_BYTECODE_INSTRUCTION_ALOAD_1 = 43,
172 /** ALOAD_2. */
173 SJME_BYTECODE_INSTRUCTION_ALOAD_2 = 44,
175 /** ALOAD_3. */
176 SJME_BYTECODE_INSTRUCTION_ALOAD_3 = 45,
178 /** IALOAD. */
179 SJME_BYTECODE_INSTRUCTION_IALOAD = 46,
181 /** LALOAD. */
182 SJME_BYTECODE_INSTRUCTION_LALOAD = 47,
184 /** FALOAD. */
185 SJME_BYTECODE_INSTRUCTION_FALOAD = 48,
187 /** DALOAD. */
188 SJME_BYTECODE_INSTRUCTION_DALOAD = 49,
190 /** AALOAD. */
191 SJME_BYTECODE_INSTRUCTION_AALOAD = 50,
193 /** BALOAD. */
194 SJME_BYTECODE_INSTRUCTION_BALOAD = 51,
196 /** CALOAD. */
197 SJME_BYTECODE_INSTRUCTION_CALOAD = 52,
199 /** SALOAD. */
200 SJME_BYTECODE_INSTRUCTION_SALOAD = 53,
202 /** ISTORE. */
203 SJME_BYTECODE_INSTRUCTION_ISTORE = 54,
205 /** LSTORE. */
206 SJME_BYTECODE_INSTRUCTION_LSTORE = 55,
208 /** FSTORE. */
209 SJME_BYTECODE_INSTRUCTION_FSTORE = 56,
211 /** DSTORE. */
212 SJME_BYTECODE_INSTRUCTION_DSTORE = 57,
214 /** ASTORE. */
215 SJME_BYTECODE_INSTRUCTION_ASTORE = 58,
217 /** ISTORE_0. */
218 SJME_BYTECODE_INSTRUCTION_ISTORE_0 = 59,
220 /** ISTORE_1. */
221 SJME_BYTECODE_INSTRUCTION_ISTORE_1 = 60,
223 /** ISTORE_2. */
224 SJME_BYTECODE_INSTRUCTION_ISTORE_2 = 61,
226 /** ISTORE_3. */
227 SJME_BYTECODE_INSTRUCTION_ISTORE_3 = 62,
229 /** LSTORE_0. */
230 SJME_BYTECODE_INSTRUCTION_LSTORE_0 = 63,
232 /** LSTORE_1. */
233 SJME_BYTECODE_INSTRUCTION_LSTORE_1 = 64,
235 /** LSTORE_2. */
236 SJME_BYTECODE_INSTRUCTION_LSTORE_2 = 65,
238 /** LSTORE_3. */
239 SJME_BYTECODE_INSTRUCTION_LSTORE_3 = 66,
241 /** FSTORE_0. */
242 SJME_BYTECODE_INSTRUCTION_FSTORE_0 = 67,
244 /** FSTORE_1. */
245 SJME_BYTECODE_INSTRUCTION_FSTORE_1 = 68,
247 /** FSTORE_2. */
248 SJME_BYTECODE_INSTRUCTION_FSTORE_2 = 69,
250 /** FSTORE_3. */
251 SJME_BYTECODE_INSTRUCTION_FSTORE_3 = 70,
253 /** DSTORE_0. */
254 SJME_BYTECODE_INSTRUCTION_DSTORE_0 = 71,
256 /** DSTORE_1. */
257 SJME_BYTECODE_INSTRUCTION_DSTORE_1 = 72,
259 /** DSTORE_2. */
260 SJME_BYTECODE_INSTRUCTION_DSTORE_2 = 73,
262 /** DSTORE_3. */
263 SJME_BYTECODE_INSTRUCTION_DSTORE_3 = 74,
265 /** ASTORE_0. */
266 SJME_BYTECODE_INSTRUCTION_ASTORE_0 = 75,
268 /** ASTORE_1. */
269 SJME_BYTECODE_INSTRUCTION_ASTORE_1 = 76,
271 /** ASTORE_2. */
272 SJME_BYTECODE_INSTRUCTION_ASTORE_2 = 77,
274 /** ASTORE_3. */
275 SJME_BYTECODE_INSTRUCTION_ASTORE_3 = 78,
277 /** IASTORE. */
278 SJME_BYTECODE_INSTRUCTION_IASTORE = 79,
280 /** LASTORE. */
281 SJME_BYTECODE_INSTRUCTION_LASTORE = 80,
283 /** FASTORE. */
284 SJME_BYTECODE_INSTRUCTION_FASTORE = 81,
286 /** DASTORE. */
287 SJME_BYTECODE_INSTRUCTION_DASTORE = 82,
289 /** AASTORE. */
290 SJME_BYTECODE_INSTRUCTION_AASTORE = 83,
292 /** BASTORE. */
293 SJME_BYTECODE_INSTRUCTION_BASTORE = 84,
295 /** CASTORE. */
296 SJME_BYTECODE_INSTRUCTION_CASTORE = 85,
298 /** SASTORE. */
299 SJME_BYTECODE_INSTRUCTION_SASTORE = 86,
301 /** POP. */
302 SJME_BYTECODE_INSTRUCTION_POP = 87,
304 /** POP2. */
305 SJME_BYTECODE_INSTRUCTION_POP2 = 88,
307 /** DUP. */
308 SJME_BYTECODE_INSTRUCTION_DUP = 89,
310 /** DUP_X1. */
311 SJME_BYTECODE_INSTRUCTION_DUP_X1 = 90,
313 /** DUP_X2. */
314 SJME_BYTECODE_INSTRUCTION_DUP_X2 = 91,
316 /** DUP2. */
317 SJME_BYTECODE_INSTRUCTION_DUP2 = 92,
319 /** DUP2_X1. */
320 SJME_BYTECODE_INSTRUCTION_DUP2_X1 = 93,
322 /** DUP2_X2. */
323 SJME_BYTECODE_INSTRUCTION_DUP2_X2 = 94,
325 /** SWAP. */
326 SJME_BYTECODE_INSTRUCTION_SWAP = 95,
328 /** IADD. */
329 SJME_BYTECODE_INSTRUCTION_IADD = 96,
331 /** LADD. */
332 SJME_BYTECODE_INSTRUCTION_LADD = 97,
334 /** FADD. */
335 SJME_BYTECODE_INSTRUCTION_FADD = 98,
337 /** DADD. */
338 SJME_BYTECODE_INSTRUCTION_DADD = 99,
340 /** ISUB. */
341 SJME_BYTECODE_INSTRUCTION_ISUB = 100,
343 /** LSUB. */
344 SJME_BYTECODE_INSTRUCTION_LSUB = 101,
346 /** FSUB. */
347 SJME_BYTECODE_INSTRUCTION_FSUB = 102,
349 /** DSUB. */
350 SJME_BYTECODE_INSTRUCTION_DSUB = 103,
352 /** IMUL. */
353 SJME_BYTECODE_INSTRUCTION_IMUL = 104,
355 /** LMUL. */
356 SJME_BYTECODE_INSTRUCTION_LMUL = 105,
358 /** FMUL. */
359 SJME_BYTECODE_INSTRUCTION_FMUL = 106,
361 /** DMUL. */
362 SJME_BYTECODE_INSTRUCTION_DMUL = 107,
364 /** IDIV. */
365 SJME_BYTECODE_INSTRUCTION_IDIV = 108,
367 /** LDIV. */
368 SJME_BYTECODE_INSTRUCTION_LDIV = 109,
370 /** FDIV. */
371 SJME_BYTECODE_INSTRUCTION_FDIV = 110,
373 /** DDIV. */
374 SJME_BYTECODE_INSTRUCTION_DDIV = 111,
376 /** IREM. */
377 SJME_BYTECODE_INSTRUCTION_IREM = 112,
379 /** LREM. */
380 SJME_BYTECODE_INSTRUCTION_LREM = 113,
382 /** FREM. */
383 SJME_BYTECODE_INSTRUCTION_FREM = 114,
385 /** DREM. */
386 SJME_BYTECODE_INSTRUCTION_DREM = 115,
388 /** INEG. */
389 SJME_BYTECODE_INSTRUCTION_INEG = 116,
391 /** LNEG. */
392 SJME_BYTECODE_INSTRUCTION_LNEG = 117,
394 /** FNEG. */
395 SJME_BYTECODE_INSTRUCTION_FNEG = 118,
397 /** DNEG. */
398 SJME_BYTECODE_INSTRUCTION_DNEG = 119,
400 /** ISHL. */
401 SJME_BYTECODE_INSTRUCTION_ISHL = 120,
403 /** LSHL. */
404 SJME_BYTECODE_INSTRUCTION_LSHL = 121,
406 /** ISHR. */
407 SJME_BYTECODE_INSTRUCTION_ISHR = 122,
409 /** LSHR. */
410 SJME_BYTECODE_INSTRUCTION_LSHR = 123,
412 /** IUSHR. */
413 SJME_BYTECODE_INSTRUCTION_IUSHR = 124,
415 /** LUSHR. */
416 SJME_BYTECODE_INSTRUCTION_LUSHR = 125,
418 /** IAND. */
419 SJME_BYTECODE_INSTRUCTION_IAND = 126,
421 /** LAND. */
422 SJME_BYTECODE_INSTRUCTION_LAND = 127,
424 /** IOR. */
425 SJME_BYTECODE_INSTRUCTION_IOR = 128,
427 /** LOR. */
428 SJME_BYTECODE_INSTRUCTION_LOR = 129,
430 /** IXOR. */
431 SJME_BYTECODE_INSTRUCTION_IXOR = 130,
433 /** LXOR. */
434 SJME_BYTECODE_INSTRUCTION_LXOR = 131,
436 /** IINC. */
437 SJME_BYTECODE_INSTRUCTION_IINC = 132,
439 /** I2L. */
440 SJME_BYTECODE_INSTRUCTION_I2L = 133,
442 /** I2F. */
443 SJME_BYTECODE_INSTRUCTION_I2F = 134,
445 /** I2D. */
446 SJME_BYTECODE_INSTRUCTION_I2D = 135,
448 /** L2I. */
449 SJME_BYTECODE_INSTRUCTION_L2I = 136,
451 /** L2F. */
452 SJME_BYTECODE_INSTRUCTION_L2F = 137,
454 /** L2D. */
455 SJME_BYTECODE_INSTRUCTION_L2D = 138,
457 /** F2I. */
458 SJME_BYTECODE_INSTRUCTION_F2I = 139,
460 /** F2L. */
461 SJME_BYTECODE_INSTRUCTION_F2L = 140,
463 /** F2D. */
464 SJME_BYTECODE_INSTRUCTION_F2D = 141,
466 /** D2I. */
467 SJME_BYTECODE_INSTRUCTION_D2I = 142,
469 /** D2L. */
470 SJME_BYTECODE_INSTRUCTION_D2L = 143,
472 /** D2F. */
473 SJME_BYTECODE_INSTRUCTION_D2F = 144,
475 /** I2B. */
476 SJME_BYTECODE_INSTRUCTION_I2B = 145,
478 /** I2C. */
479 SJME_BYTECODE_INSTRUCTION_I2C = 146,
481 /** I2S. */
482 SJME_BYTECODE_INSTRUCTION_I2S = 147,
484 /** LCMP. */
485 SJME_BYTECODE_INSTRUCTION_LCMP = 148,
487 /** FCMPL. */
488 SJME_BYTECODE_INSTRUCTION_FCMPL = 149,
490 /** FCMPG. */
491 SJME_BYTECODE_INSTRUCTION_FCMPG = 150,
493 /** DCMPL. */
494 SJME_BYTECODE_INSTRUCTION_DCMPL = 151,
496 /** DCMPG. */
497 SJME_BYTECODE_INSTRUCTION_DCMPG = 152,
499 /** IFEQ. */
500 SJME_BYTECODE_INSTRUCTION_IFEQ = 153,
502 /** IFNE. */
503 SJME_BYTECODE_INSTRUCTION_IFNE = 154,
505 /** IFLT. */
506 SJME_BYTECODE_INSTRUCTION_IFLT = 155,
508 /** IFGE. */
509 SJME_BYTECODE_INSTRUCTION_IFGE = 156,
511 /** IFGT. */
512 SJME_BYTECODE_INSTRUCTION_IFGT = 157,
514 /** IFLE. */
515 SJME_BYTECODE_INSTRUCTION_IFLE = 158,
517 /** IF_ICMPEQ. */
518 SJME_BYTECODE_INSTRUCTION_IF_ICMPEQ = 159,
520 /** IF_ICMPNE. */
521 SJME_BYTECODE_INSTRUCTION_IF_ICMPNE = 160,
523 /** IF_ICMPLT. */
524 SJME_BYTECODE_INSTRUCTION_IF_ICMPLT = 161,
526 /** IF_ICMPGE. */
527 SJME_BYTECODE_INSTRUCTION_IF_ICMPGE = 162,
529 /** IF_ICMPGT. */
530 SJME_BYTECODE_INSTRUCTION_IF_ICMPGT = 163,
532 /** IF_ICMPLE. */
533 SJME_BYTECODE_INSTRUCTION_IF_ICMPLE = 164,
535 /** IF_ACMPEQ. */
536 SJME_BYTECODE_INSTRUCTION_IF_ACMPEQ = 165,
538 /** IF_ACMPNE. */
539 SJME_BYTECODE_INSTRUCTION_IF_ACMPNE = 166,
541 /** GOTO. */
542 SJME_BYTECODE_INSTRUCTION_GOTO = 167,
544 /** JSR. */
545 SJME_BYTECODE_INSTRUCTION_JSR = 168,
547 /** RET. */
548 SJME_BYTECODE_INSTRUCTION_RET = 169,
550 /** TABLESWITCH. */
551 SJME_BYTECODE_INSTRUCTION_TABLESWITCH = 170,
553 /** LOOKUPSWITCH. */
554 SJME_BYTECODE_INSTRUCTION_LOOKUPSWITCH = 171,
556 /** IRETURN. */
557 SJME_BYTECODE_INSTRUCTION_IRETURN = 172,
559 /** LRETURN. */
560 SJME_BYTECODE_INSTRUCTION_LRETURN = 173,
562 /** FRETURN. */
563 SJME_BYTECODE_INSTRUCTION_FRETURN = 174,
565 /** DRETURN. */
566 SJME_BYTECODE_INSTRUCTION_DRETURN = 175,
568 /** ARETURN. */
569 SJME_BYTECODE_INSTRUCTION_ARETURN = 176,
571 /** RETURN. */
572 SJME_BYTECODE_INSTRUCTION_RETURN = 177,
574 /** GETSTATIC. */
575 SJME_BYTECODE_INSTRUCTION_GETSTATIC = 178,
577 /** PUTSTATIC. */
578 SJME_BYTECODE_INSTRUCTION_PUTSTATIC = 179,
580 /** GETFIELD. */
581 SJME_BYTECODE_INSTRUCTION_GETFIELD = 180,
583 /** PUTFIELD. */
584 SJME_BYTECODE_INSTRUCTION_PUTFIELD = 181,
586 /** INVOKEVIRTUAL. */
587 SJME_BYTECODE_INSTRUCTION_INVOKEVIRTUAL = 182,
589 /** INVOKESPECIAL. */
590 SJME_BYTECODE_INSTRUCTION_INVOKESPECIAL = 183,
592 /** INVOKESTATIC. */
593 SJME_BYTECODE_INSTRUCTION_INVOKESTATIC = 184,
595 /** INVOKEINTERFACE. */
596 SJME_BYTECODE_INSTRUCTION_INVOKEINTERFACE = 185,
598 /** INVOKEDYNAMIC. */
599 SJME_BYTECODE_INSTRUCTION_INVOKEDYNAMIC = 186,
601 /** NEW. */
602 SJME_BYTECODE_INSTRUCTION_NEW = 187,
604 /** NEWARRAY. */
605 SJME_BYTECODE_INSTRUCTION_NEWARRAY = 188,
607 /** ANEWARRAY. */
608 SJME_BYTECODE_INSTRUCTION_ANEWARRAY = 189,
610 /** ARRAYLENGTH. */
611 SJME_BYTECODE_INSTRUCTION_ARRAYLENGTH = 190,
613 /** ATHROW. */
614 SJME_BYTECODE_INSTRUCTION_ATHROW = 191,
616 /** CHECKCAST. */
617 SJME_BYTECODE_INSTRUCTION_CHECKCAST = 192,
619 /** INSTANCEOF. */
620 SJME_BYTECODE_INSTRUCTION_INSTANCEOF = 193,
622 /** MONITORENTER. */
623 SJME_BYTECODE_INSTRUCTION_MONITORENTER = 194,
625 /** MONITOREXIT. */
626 SJME_BYTECODE_INSTRUCTION_MONITOREXIT = 195,
628 /** WIDE. */
629 SJME_BYTECODE_INSTRUCTION_WIDE = 196,
631 /** MULTIANEWARRAY. */
632 SJME_BYTECODE_INSTRUCTION_MULTIANEWARRAY = 197,
634 /** IFNULL. */
635 SJME_BYTECODE_INSTRUCTION_IFNULL = 198,
637 /** IFNONNULL. */
638 SJME_BYTECODE_INSTRUCTION_IFNONNULL = 199,
640 /** GOTO_W. */
641 SJME_BYTECODE_INSTRUCTION_GOTO_W = 200,
643 /** JSR_W. */
644 SJME_BYTECODE_INSTRUCTION_JSR_W = 201,
646 /** BREAKPOINT. */
647 SJME_BYTECODE_INSTRUCTION_BREAKPOINT = 202,
649 /** IMPDEP1. */
650 SJME_BYTECODE_INSTRUCTION_IMPDEP1 = 254,
652 /** IMPDEP2. */
653 SJME_BYTECODE_INSTRUCTION_IMPDEP2 = 255,
655 /** Wide ALOAD. */
656 SJME_BYTECODE_INSTRUCTION_WIDE_ALOAD =
657 (SJME_BYTECODE_INSTRUCTION_WIDE << 8) |
658 SJME_BYTECODE_INSTRUCTION_ALOAD,
660 /** Wide ILOAD. */
661 SJME_BYTECODE_INSTRUCTION_WIDE_ILOAD =
662 (SJME_BYTECODE_INSTRUCTION_WIDE << 8) |
663 SJME_BYTECODE_INSTRUCTION_ILOAD,
665 /** Wide LLOAD. */
666 SJME_BYTECODE_INSTRUCTION_WIDE_LLOAD =
667 (SJME_BYTECODE_INSTRUCTION_WIDE << 8) |
668 SJME_BYTECODE_INSTRUCTION_LLOAD,
670 /** Wide FLOAD. */
671 SJME_BYTECODE_INSTRUCTION_WIDE_FLOAD =
672 (SJME_BYTECODE_INSTRUCTION_WIDE << 8) |
673 SJME_BYTECODE_INSTRUCTION_FLOAD,
675 /** Wide DLOAD. */
676 SJME_BYTECODE_INSTRUCTION_WIDE_DLOAD =
677 (SJME_BYTECODE_INSTRUCTION_WIDE << 8) |
678 SJME_BYTECODE_INSTRUCTION_DLOAD,
680 /** Wide ASTORE. */
681 SJME_BYTECODE_INSTRUCTION_WIDE_ASTORE =
682 (SJME_BYTECODE_INSTRUCTION_WIDE << 8) |
683 SJME_BYTECODE_INSTRUCTION_ASTORE,
685 /** Wide ISTORE. */
686 SJME_BYTECODE_INSTRUCTION_WIDE_ISTORE =
687 (SJME_BYTECODE_INSTRUCTION_WIDE << 8) |
688 SJME_BYTECODE_INSTRUCTION_ISTORE,
690 /** Wide LSTORE. */
691 SJME_BYTECODE_INSTRUCTION_WIDE_LSTORE =
692 (SJME_BYTECODE_INSTRUCTION_WIDE << 8) |
693 SJME_BYTECODE_INSTRUCTION_LSTORE,
695 /** Wide FSTORE. */
696 SJME_BYTECODE_INSTRUCTION_WIDE_FSTORE =
697 (SJME_BYTECODE_INSTRUCTION_WIDE << 8) |
698 SJME_BYTECODE_INSTRUCTION_FSTORE,
700 /** Wide DSTORE. */
701 SJME_BYTECODE_INSTRUCTION_WIDE_DSTORE =
702 (SJME_BYTECODE_INSTRUCTION_WIDE << 8) |
703 SJME_BYTECODE_INSTRUCTION_DSTORE,
705 /** Wide IINC. */
706 SJME_BYTECODE_INSTRUCTION_WIDE_IINC =
707 (SJME_BYTECODE_INSTRUCTION_WIDE << 8) |
708 SJME_BYTECODE_INSTRUCTION_IINC,
709 } sjme_byteCode_instruction;
712 * Function type for byte code execution.
714 * @param frame The frame to execute under.
715 * @return Returns @c SJME_JNI_TRUE on success.
716 * @since 2023/11/18
718 typedef sjme_jboolean (*sjme_byteCode_function)(sjme_nvm_frame frame);
721 * Contains a mapping of a byte code instruction to an actual operation.
723 * @since 2023/11/18
725 typedef struct sjme_byteCode_functionMap
727 /** The instruction this maps. */
728 sjme_byteCode_instruction instruction;
730 /** The function to execute. */
731 sjme_byteCode_function function;
732 } sjme_byteCode_functionMap;
735 * Maps a specific bytecode to the mapping for later execution.
737 * @param inInstruction The instruction to map.
738 * @param outMapping The output mapping.
739 * @return Returns @c SJME_JNI_TRUE if the instruction is valid and mappable.
740 * @since 2023/11/18
742 sjme_errorCode sjme_byteCode_map(
743 sjme_attrInValue sjme_byteCode_instruction inInstruction,
744 sjme_attrOutNotNull const sjme_byteCode_functionMap** outMapping);
746 /*--------------------------------------------------------------------------*/
748 /* Anti-C++. */
749 #ifdef __cplusplus
750 #ifdef SJME_CXX_SQUIRRELJME_BYTECODE_H
752 #undef SJME_CXX_SQUIRRELJME_BYTECODE_H
753 #undef SJME_CXX_IS_EXTERNED
754 #endif /* #ifdef SJME_CXX_SQUIRRELJME_BYTECODE_H */
755 #endif /* #ifdef __cplusplus */
757 #endif /* SQUIRRELJME_BYTECODE_H */