aboutsummaryrefslogtreecommitdiff
path: root/lux-jvm/source/luxc/lang/host/jvm/inst.lux
diff options
context:
space:
mode:
Diffstat (limited to 'lux-jvm/source/luxc/lang/host/jvm/inst.lux')
-rw-r--r--lux-jvm/source/luxc/lang/host/jvm/inst.lux263
1 files changed, 133 insertions, 130 deletions
diff --git a/lux-jvm/source/luxc/lang/host/jvm/inst.lux b/lux-jvm/source/luxc/lang/host/jvm/inst.lux
index 7af807189..8b75e4169 100644
--- a/lux-jvm/source/luxc/lang/host/jvm/inst.lux
+++ b/lux-jvm/source/luxc/lang/host/jvm/inst.lux
@@ -1,48 +1,51 @@
(.using
- [library
- [lux {"-" Type Primitive int char try}
- ["[0]" ffi {"+" import: do_to}]
- [abstract
- [monad {"+" do}]]
- [control
- ["[0]" function]
- ["[0]" maybe]
- ["[0]" try]
- ["p" parser
- ["s" code]]]
- [data
- ["[0]" product]
- [collection
- ["[0]" list ("[1]@[0]" functor)]]]
- [macro
- [syntax {"+" syntax:}]
- ["[0]" code]
- ["[0]" template]]
- [math
- [number
- ["n" nat]
- ["i" int]]]
- [target
- [jvm
- [encoding
- ["[0]" name {"+" External}]]
- ["[0]" type {"+" Type} ("[1]@[0]" equivalence)
- [category {"+" Void Value Return Method Primitive Object Class Array Var Parameter}]
- ["[0]" box]
- ["[0]" descriptor]
- ["[0]" reflection]]]]
- [tool
- [compiler
- [phase {"+" Operation}]]]]]
- ["[0]" // {"+" Inst}])
+ [library
+ [lux {"-" Type Primitive int char try}
+ ["[0]" ffi {"+" import: do_to}]
+ [abstract
+ [monad {"+" do}]]
+ [control
+ ["[0]" function]
+ ["[0]" maybe]
+ ["[0]" try]
+ ["p" parser
+ ["s" code]]]
+ [data
+ ["[0]" product]
+ [collection
+ ["[0]" list ("[1]@[0]" functor)]]]
+ [macro
+ [syntax {"+" syntax:}]
+ ["[0]" code]
+ ["[0]" template]]
+ [math
+ [number
+ ["n" nat]
+ ["i" int]]]
+ [target
+ [jvm
+ [encoding
+ ["[0]" name {"+" External}]]
+ ["[0]" type {"+" Type} ("[1]@[0]" equivalence)
+ [category {"+" Void Value Return Method Primitive Object Class Array Var Parameter}]
+ ["[0]" box]
+ ["[0]" descriptor]
+ ["[0]" reflection]]]]
+ [tool
+ [compiler
+ [phase {"+" Operation}]]]]]
+ ["[0]" // {"+" Inst}])
(def: class_name (|>> type.descriptor descriptor.class_name name.read))
(def: descriptor (|>> type.descriptor descriptor.descriptor))
(def: reflection (|>> type.reflection reflection.reflection))
... [Host]
-(import: java/lang/Object)
-(import: java/lang/String)
+(import: java/lang/Object
+ "[1]::[0]")
+
+(import: java/lang/String
+ "[1]::[0]")
(syntax: (declare [codes (p.many s.local_symbol)])
(|> codes
@@ -50,103 +53,103 @@
in))
(`` (import: org/objectweb/asm/Opcodes
- ["[1]::[0]"
- ("static" NOP int)
-
- ... Conversion
- (~~ (declare D2F D2I D2L
- F2D F2I F2L
- I2B I2C I2D I2F I2L I2S
- L2D L2F L2I))
-
- ... Primitive
- (~~ (declare T_BOOLEAN T_CHAR T_FLOAT T_DOUBLE
- T_BYTE T_SHORT T_INT T_LONG))
-
- ... Class
- (~~ (declare CHECKCAST NEW INSTANCEOF))
-
- ... Stack
- (~~ (declare DUP DUP_X1 DUP_X2
- DUP2 DUP2_X1 DUP2_X2
- POP POP2
- SWAP))
-
- ... Jump
- (~~ (declare IF_ICMPEQ IF_ICMPGT IF_ICMPLT
- IF_ICMPNE IF_ICMPGE IF_ICMPLE
- IF_ACMPEQ IF_ACMPNE IFNULL IFNONNULL
- IFEQ IFNE IFLT IFLE IFGT IFGE
- GOTO))
-
- (~~ (declare BIPUSH SIPUSH))
- (~~ (declare 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))
- ("static" ACONST_NULL int)
-
- ... Var
- (~~ (declare IINC
- ILOAD LLOAD FLOAD DLOAD ALOAD
- ISTORE LSTORE FSTORE DSTORE ASTORE))
-
- ... Arithmetic
- (~~ (declare IADD ISUB IMUL IDIV IREM INEG
- LADD LSUB LMUL LDIV LREM LNEG LCMP
- FADD FSUB FMUL FDIV FREM FNEG FCMPG FCMPL
- DADD DSUB DMUL DDIV DREM DNEG DCMPG DCMPL))
-
- ... Bit-wise
- (~~ (declare IAND IOR IXOR ISHL ISHR IUSHR
- LAND LOR LXOR LSHL LSHR LUSHR))
-
- ... Array
- (~~ (declare ARRAYLENGTH NEWARRAY ANEWARRAY
- AALOAD AASTORE
- BALOAD BASTORE
- SALOAD SASTORE
- IALOAD IASTORE
- LALOAD LASTORE
- FALOAD FASTORE
- DALOAD DASTORE
- CALOAD CASTORE))
-
- ... Member
- (~~ (declare GETSTATIC PUTSTATIC GETFIELD PUTFIELD
- INVOKESTATIC INVOKESPECIAL INVOKEVIRTUAL INVOKEINTERFACE))
-
- ("static" ATHROW int)
-
- ... Concurrency
- (~~ (declare MONITORENTER MONITOREXIT))
-
- ... Return
- (~~ (declare RETURN IRETURN LRETURN FRETURN DRETURN ARETURN))]
+ "[1]::[0]"
+ ("static" NOP int)
+
+ ... Conversion
+ (~~ (declare D2F D2I D2L
+ F2D F2I F2L
+ I2B I2C I2D I2F I2L I2S
+ L2D L2F L2I))
+
+ ... Primitive
+ (~~ (declare T_BOOLEAN T_CHAR T_FLOAT T_DOUBLE
+ T_BYTE T_SHORT T_INT T_LONG))
+
+ ... Class
+ (~~ (declare CHECKCAST NEW INSTANCEOF))
+
+ ... Stack
+ (~~ (declare DUP DUP_X1 DUP_X2
+ DUP2 DUP2_X1 DUP2_X2
+ POP POP2
+ SWAP))
+
+ ... Jump
+ (~~ (declare IF_ICMPEQ IF_ICMPGT IF_ICMPLT
+ IF_ICMPNE IF_ICMPGE IF_ICMPLE
+ IF_ACMPEQ IF_ACMPNE IFNULL IFNONNULL
+ IFEQ IFNE IFLT IFLE IFGT IFGE
+ GOTO))
+
+ (~~ (declare BIPUSH SIPUSH))
+ (~~ (declare 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))
+ ("static" ACONST_NULL int)
+
+ ... Var
+ (~~ (declare IINC
+ ILOAD LLOAD FLOAD DLOAD ALOAD
+ ISTORE LSTORE FSTORE DSTORE ASTORE))
+
+ ... Arithmetic
+ (~~ (declare IADD ISUB IMUL IDIV IREM INEG
+ LADD LSUB LMUL LDIV LREM LNEG LCMP
+ FADD FSUB FMUL FDIV FREM FNEG FCMPG FCMPL
+ DADD DSUB DMUL DDIV DREM DNEG DCMPG DCMPL))
+
+ ... Bit-wise
+ (~~ (declare IAND IOR IXOR ISHL ISHR IUSHR
+ LAND LOR LXOR LSHL LSHR LUSHR))
+
+ ... Array
+ (~~ (declare ARRAYLENGTH NEWARRAY ANEWARRAY
+ AALOAD AASTORE
+ BALOAD BASTORE
+ SALOAD SASTORE
+ IALOAD IASTORE
+ LALOAD LASTORE
+ FALOAD FASTORE
+ DALOAD DASTORE
+ CALOAD CASTORE))
+
+ ... Member
+ (~~ (declare GETSTATIC PUTSTATIC GETFIELD PUTFIELD
+ INVOKESTATIC INVOKESPECIAL INVOKEVIRTUAL INVOKEINTERFACE))
+
+ ("static" ATHROW int)
+
+ ... Concurrency
+ (~~ (declare MONITORENTER MONITOREXIT))
+
+ ... Return
+ (~~ (declare RETURN IRETURN LRETURN FRETURN DRETURN ARETURN))
))
(import: org/objectweb/asm/Label
- ["[1]::[0]"
- (new [])])
+ "[1]::[0]"
+ (new []))
(import: org/objectweb/asm/MethodVisitor
- ["[1]::[0]"
- (visitCode [] void)
- (visitMaxs [int int] void)
- (visitEnd [] void)
- (visitInsn [int] void)
- (visitLdcInsn [java/lang/Object] void)
- (visitFieldInsn [int java/lang/String java/lang/String java/lang/String] void)
- (visitTypeInsn [int java/lang/String] void)
- (visitVarInsn [int int] void)
- (visitIntInsn [int int] void)
- (visitMethodInsn [int java/lang/String java/lang/String java/lang/String boolean] void)
- (visitLabel [org/objectweb/asm/Label] void)
- (visitJumpInsn [int org/objectweb/asm/Label] void)
- (visitTryCatchBlock [org/objectweb/asm/Label org/objectweb/asm/Label org/objectweb/asm/Label java/lang/String] void)
- (visitLookupSwitchInsn [org/objectweb/asm/Label [int] [org/objectweb/asm/Label]] void)
- (visitTableSwitchInsn [int int org/objectweb/asm/Label [org/objectweb/asm/Label]] void)
- ])
+ "[1]::[0]"
+ (visitCode [] void)
+ (visitMaxs [int int] void)
+ (visitEnd [] void)
+ (visitInsn [int] void)
+ (visitLdcInsn [java/lang/Object] void)
+ (visitFieldInsn [int java/lang/String java/lang/String java/lang/String] void)
+ (visitTypeInsn [int java/lang/String] void)
+ (visitVarInsn [int int] void)
+ (visitIntInsn [int int] void)
+ (visitMethodInsn [int java/lang/String java/lang/String java/lang/String boolean] void)
+ (visitLabel [org/objectweb/asm/Label] void)
+ (visitJumpInsn [int org/objectweb/asm/Label] void)
+ (visitTryCatchBlock [org/objectweb/asm/Label org/objectweb/asm/Label org/objectweb/asm/Label java/lang/String] void)
+ (visitLookupSwitchInsn [org/objectweb/asm/Label [int] [org/objectweb/asm/Label]] void)
+ (visitTableSwitchInsn [int int org/objectweb/asm/Label [org/objectweb/asm/Label]] void)
+ )
... [Insts]
(def: .public make_label