diff options
Diffstat (limited to '')
-rw-r--r-- | lux-jvm/source/luxc/lang/host/jvm.lux | 10 | ||||
-rw-r--r-- | lux-jvm/source/luxc/lang/host/jvm/def.lux | 87 | ||||
-rw-r--r-- | lux-jvm/source/luxc/lang/host/jvm/inst.lux | 263 |
3 files changed, 184 insertions, 176 deletions
diff --git a/lux-jvm/source/luxc/lang/host/jvm.lux b/lux-jvm/source/luxc/lang/host/jvm.lux index 017dd834a..dc942529d 100644 --- a/lux-jvm/source/luxc/lang/host/jvm.lux +++ b/lux-jvm/source/luxc/lang/host/jvm.lux @@ -30,13 +30,15 @@ [meta [archive {"+" Archive}]]]]]]) -(import: org/objectweb/asm/MethodVisitor) +(import: org/objectweb/asm/MethodVisitor + "[1]::[0]") -(import: org/objectweb/asm/ClassWriter) +(import: org/objectweb/asm/ClassWriter + "[1]::[0]") (import: org/objectweb/asm/Label - ["[1]::[0]" - (new [])]) + "[1]::[0]" + (new [])) (type: .public Def (-> org/objectweb/asm/ClassWriter org/objectweb/asm/ClassWriter)) diff --git a/lux-jvm/source/luxc/lang/host/jvm/def.lux b/lux-jvm/source/luxc/lang/host/jvm/def.lux index e7174a61e..fd79d2119 100644 --- a/lux-jvm/source/luxc/lang/host/jvm/def.lux +++ b/lux-jvm/source/luxc/lang/host/jvm/def.lux @@ -28,56 +28,59 @@ (def: descriptor (|>> type.descriptor descriptor.descriptor)) (def: class_name (|>> type.descriptor descriptor.class_name name.read)) -(import: java/lang/Object) -(import: java/lang/String) +(import: java/lang/Object + "[1]::[0]") + +(import: java/lang/String + "[1]::[0]") (import: org/objectweb/asm/Opcodes - ["[1]::[0]" - ("static" ACC_PUBLIC int) - ("static" ACC_PROTECTED int) - ("static" ACC_PRIVATE int) - - ("static" ACC_TRANSIENT int) - ("static" ACC_VOLATILE int) - - ("static" ACC_ABSTRACT int) - ("static" ACC_FINAL int) - ("static" ACC_STATIC int) - ("static" ACC_SYNCHRONIZED int) - ("static" ACC_STRICT int) - - ("static" ACC_SUPER int) - ("static" ACC_INTERFACE int) - - ("static" V1_1 int) - ("static" V1_2 int) - ("static" V1_3 int) - ("static" V1_4 int) - ("static" V1_5 int) - ("static" V1_6 int) - ("static" V1_7 int) - ("static" V1_8 int)]) + "[1]::[0]" + ("static" ACC_PUBLIC int) + ("static" ACC_PROTECTED int) + ("static" ACC_PRIVATE int) + + ("static" ACC_TRANSIENT int) + ("static" ACC_VOLATILE int) + + ("static" ACC_ABSTRACT int) + ("static" ACC_FINAL int) + ("static" ACC_STATIC int) + ("static" ACC_SYNCHRONIZED int) + ("static" ACC_STRICT int) + + ("static" ACC_SUPER int) + ("static" ACC_INTERFACE int) + + ("static" V1_1 int) + ("static" V1_2 int) + ("static" V1_3 int) + ("static" V1_4 int) + ("static" V1_5 int) + ("static" V1_6 int) + ("static" V1_7 int) + ("static" V1_8 int)) (import: org/objectweb/asm/FieldVisitor - ["[1]::[0]" - (visitEnd [] void)]) + "[1]::[0]" + (visitEnd [] void)) (import: org/objectweb/asm/MethodVisitor - ["[1]::[0]" - (visitCode [] void) - (visitMaxs [int int] void) - (visitEnd [] void)]) + "[1]::[0]" + (visitCode [] void) + (visitMaxs [int int] void) + (visitEnd [] void)) (import: org/objectweb/asm/ClassWriter - ["[1]::[0]" - ("static" COMPUTE_MAXS int) - ("static" COMPUTE_FRAMES int) - (new [int]) - (visit [int int java/lang/String java/lang/String java/lang/String [java/lang/String]] void) - (visitEnd [] void) - (visitField [int java/lang/String java/lang/String java/lang/String java/lang/Object] org/objectweb/asm/FieldVisitor) - (visitMethod [int java/lang/String java/lang/String java/lang/String [java/lang/String]] org/objectweb/asm/MethodVisitor) - (toByteArray [] [byte])]) + "[1]::[0]" + ("static" COMPUTE_MAXS int) + ("static" COMPUTE_FRAMES int) + (new [int]) + (visit [int int java/lang/String java/lang/String java/lang/String [java/lang/String]] void) + (visitEnd [] void) + (visitField [int java/lang/String java/lang/String java/lang/String java/lang/Object] org/objectweb/asm/FieldVisitor) + (visitMethod [int java/lang/String java/lang/String java/lang/String [java/lang/String]] org/objectweb/asm/MethodVisitor) + (toByteArray [] [byte])) (def: (string_array values) (-> (List Text) (Array Text)) 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 |