aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/target/jvm.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux/target/jvm.lux282
1 files changed, 282 insertions, 0 deletions
diff --git a/stdlib/source/lux/target/jvm.lux b/stdlib/source/lux/target/jvm.lux
new file mode 100644
index 000000000..4998f0f05
--- /dev/null
+++ b/stdlib/source/lux/target/jvm.lux
@@ -0,0 +1,282 @@
+(.module:
+ [lux (#- Type)
+ [data
+ [collection
+ [row (#+ Row)]]]
+ [target
+ [jvm
+ [type (#+ Type)
+ ["." category (#+ Primitive Class Value Method)]]]]])
+
+(type: #export Literal
+ (#Boolean Bit)
+ (#Int Int)
+ (#Long Int)
+ (#Double Frac)
+ (#Char Nat)
+ (#String Text))
+
+(type: #export Constant
+ (#BIPUSH Int)
+
+ (#SIPUSH Int)
+
+ #ICONST_M1
+ #ICONST_0
+ #ICONST_1
+ #ICONST_2
+ #ICONST_3
+ #ICONST_4
+ #ICONST_5
+
+ #LCONST_0
+ #LCONST_1
+
+ #FCONST_0
+ #FCONST_1
+ #FCONST_2
+
+ #DCONST_0
+ #DCONST_1
+
+ #ACONST_NULL
+
+ (#LDC Literal))
+
+(type: #export Int-Arithmetic
+ #IADD
+ #ISUB
+ #IMUL
+ #IDIV
+ #IREM
+ #INEG)
+
+(type: #export Long-Arithmetic
+ #LADD
+ #LSUB
+ #LMUL
+ #LDIV
+ #LREM
+ #LNEG)
+
+(type: #export Float-Arithmetic
+ #FADD
+ #FSUB
+ #FMUL
+ #FDIV
+ #FREM
+ #FNEG)
+
+(type: #export Double-Arithmetic
+ #DADD
+ #DSUB
+ #DMUL
+ #DDIV
+ #DREM
+ #DNEG)
+
+(type: #export Arithmetic
+ (#Int-Arithmetic Int-Arithmetic)
+ (#Long-Arithmetic Long-Arithmetic)
+ (#Float-Arithmetic Float-Arithmetic)
+ (#Double-Arithmetic Double-Arithmetic))
+
+(type: #export Int-Bitwise
+ #IOR
+ #IXOR
+ #IAND
+ #ISHL
+ #ISHR
+ #IUSHR)
+
+(type: #export Long-Bitwise
+ #LOR
+ #LXOR
+ #LAND
+ #LSHL
+ #LSHR
+ #LUSHR)
+
+(type: #export Bitwise
+ (#Int-Bitwise Int-Bitwise)
+ (#Long-Bitwise Long-Bitwise))
+
+(type: #export Conversion
+ #I2B
+ #I2S
+ #I2L
+ #I2F
+ #I2D
+ #I2C
+
+ #L2I
+ #L2F
+ #L2D
+
+ #F2I
+ #F2L
+ #F2D
+
+ #D2I
+ #D2L
+ #D2F)
+
+(type: #export Array
+ #ARRAYLENGTH
+
+ (#NEWARRAY (Type Primitive))
+ (#ANEWARRAY (Type category.Object))
+
+ #BALOAD
+ #BASTORE
+
+ #SALOAD
+ #SASTORE
+
+ #IALOAD
+ #IASTORE
+
+ #LALOAD
+ #LASTORE
+
+ #FALOAD
+ #FASTORE
+
+ #DALOAD
+ #DASTORE
+
+ #CALOAD
+ #CASTORE
+
+ #AALOAD
+ #AASTORE)
+
+(type: #export Object
+ (#GETSTATIC (Type Class) Text (Type Value))
+ (#PUTSTATIC (Type Class) Text (Type Value))
+
+ (#NEW (Type Class))
+
+ (#INSTANCEOF (Type Class))
+ (#CHECKCAST (Type category.Object))
+
+ (#GETFIELD (Type Class) Text (Type Value))
+ (#PUTFIELD (Type Class) Text (Type Value))
+
+ (#INVOKEINTERFACE (Type Class) Text (Type Method))
+ (#INVOKESPECIAL (Type Class) Text (Type Method))
+ (#INVOKESTATIC (Type Class) Text (Type Method))
+ (#INVOKEVIRTUAL (Type Class) Text (Type Method)))
+
+(type: #export Register Nat)
+
+(type: #export Local-Int
+ (#ILOAD Register)
+ (#ISTORE Register))
+
+(type: #export Local-Long
+ (#LLOAD Register)
+ (#LSTORE Register))
+
+(type: #export Local-Float
+ (#FLOAD Register)
+ (#FSTORE Register))
+
+(type: #export Local-Double
+ (#DLOAD Register)
+ (#DSTORE Register))
+
+(type: #export Local-Object
+ (#ALOAD Register)
+ (#ASTORE Register))
+
+(type: #export Local
+ (#Local-Int Local-Int)
+ (#IINC Register)
+ (#Local-Long Local-Long)
+ (#Local-Float Local-Float)
+ (#Local-Double Local-Double)
+ (#Local-Object Local-Object))
+
+(type: #export Stack
+ #DUP
+ #DUP_X1
+ #DUP_X2
+ #DUP2
+ #DUP2_X1
+ #DUP2_X2
+ #SWAP
+ #POP
+ #POP2)
+
+(type: #export Comparison
+ #LCMP
+
+ #FCMPG
+ #FCMPL
+
+ #DCMPG
+ #DCMPL)
+
+(type: #export Label Nat)
+
+(type: #export (Branching label)
+ (#IF_ICMPEQ label)
+ (#IF_ICMPGE label)
+ (#IF_ICMPGT label)
+ (#IF_ICMPLE label)
+ (#IF_ICMPLT label)
+ (#IF_ICMPNE label)
+ (#IFEQ label)
+ (#IFNE label)
+ (#IFGE label)
+ (#IFGT label)
+ (#IFLE label)
+ (#IFLT label)
+
+ (#TABLESWITCH Int Int label (List label))
+ (#LOOKUPSWITCH label (List [Int label]))
+
+ (#IF_ACMPEQ label)
+ (#IF_ACMPNE label)
+ (#IFNONNULL label)
+ (#IFNULL label))
+
+(type: #export (Exception label)
+ (#Try label label label (Type Class))
+ #ATHROW)
+
+(type: #export Concurrency
+ #MONITORENTER
+ #MONITOREXIT)
+
+(type: #export Return
+ #RETURN
+ #IRETURN
+ #LRETURN
+ #FRETURN
+ #DRETURN
+ #ARETURN)
+
+(type: #export (Control label)
+ (#GOTO label)
+ (#Branching (Branching label))
+ (#Exception (Exception label))
+ (#Concurrency Concurrency)
+ (#Return Return))
+
+(type: #export (Instruction label)
+ #NOP
+ (#Constant Constant)
+ (#Arithmetic Arithmetic)
+ (#Bitwise Bitwise)
+ (#Conversion Conversion)
+ (#Array Array)
+ (#Object Object)
+ (#Local Local)
+ (#Stack Stack)
+ (#Comparison Comparison)
+ (#Control (Control label)))
+
+(type: #export (Bytecode label)
+ (Row (Instruction label)))