aboutsummaryrefslogtreecommitdiff
path: root/lux-jvm/source/luxc/lang/host/jvm/inst.lux
diff options
context:
space:
mode:
authorEduardo Julian2021-06-12 01:32:40 -0400
committerEduardo Julian2021-06-12 01:32:40 -0400
commitaf3e6e2cb011dc2ad9204440990731a2f272716d (patch)
tree3521c74b05fc5b3ddddbe901d32ace87dbb6c018 /lux-jvm/source/luxc/lang/host/jvm/inst.lux
parent8f575da5095e3b259d4eb6b6f13d3e37ef1d38e4 (diff)
Constraining the year of the snapshot time in Aedifex.
Diffstat (limited to 'lux-jvm/source/luxc/lang/host/jvm/inst.lux')
-rw-r--r--lux-jvm/source/luxc/lang/host/jvm/inst.lux86
1 files changed, 43 insertions, 43 deletions
diff --git a/lux-jvm/source/luxc/lang/host/jvm/inst.lux b/lux-jvm/source/luxc/lang/host/jvm/inst.lux
index 1f9e93c71..efc4a0d0c 100644
--- a/lux-jvm/source/luxc/lang/host/jvm/inst.lux
+++ b/lux-jvm/source/luxc/lang/host/jvm/inst.lux
@@ -1,6 +1,6 @@
(.module:
[lux (#- Type int char)
- ["." host (#+ import: do_to)]
+ ["." ffi (#+ import: do_to)]
[abstract
[monad (#+ do)]]
[control
@@ -162,13 +162,13 @@
(-> <type> Inst)
(function (_ visitor)
(do_to visitor
- (org/objectweb/asm/MethodVisitor::visitLdcInsn (<prepare> value)))))]
+ (org/objectweb/asm/MethodVisitor::visitLdcInsn (<prepare> value)))))]
[boolean Bit function.identity]
- [int Int host.long_to_int]
+ [int Int ffi.long_to_int]
[long Int function.identity]
[double Frac function.identity]
- [char Nat (|>> .int host.long_to_int host.int_to_char)]
+ [char Nat (|>> .int ffi.long_to_int ffi.int_to_char)]
[string Text function.identity]
)
@@ -180,7 +180,7 @@
Inst
(function (_ visitor)
(do_to visitor
- (org/objectweb/asm/MethodVisitor::visitInsn (!prefix <constant>)))))]
+ (org/objectweb/asm/MethodVisitor::visitInsn (!prefix <constant>)))))]
[ICONST_M1] [ICONST_0] [ICONST_1] [ICONST_2] [ICONST_3] [ICONST_4] [ICONST_5]
[LCONST_0] [LCONST_1]
@@ -192,14 +192,14 @@
Inst
(function (_ visitor)
(do_to visitor
- (org/objectweb/asm/MethodVisitor::visitInsn (!prefix ACONST_NULL)))))
+ (org/objectweb/asm/MethodVisitor::visitInsn (!prefix ACONST_NULL)))))
(template [<constant>]
[(def: #export (<constant> constant)
(-> Int Inst)
(function (_ visitor)
(do_to visitor
- (org/objectweb/asm/MethodVisitor::visitIntInsn (!prefix <constant>) constant))))]
+ (org/objectweb/asm/MethodVisitor::visitIntInsn (!prefix <constant>) constant))))]
[BIPUSH]
[SIPUSH]
@@ -210,7 +210,7 @@
Inst
(function (_ visitor)
(do_to visitor
- (org/objectweb/asm/MethodVisitor::visitInsn (!prefix <name>)))))]
+ (org/objectweb/asm/MethodVisitor::visitInsn (!prefix <name>)))))]
[NOP]
@@ -273,7 +273,7 @@
(-> Register Inst)
(function (_ visitor)
(do_to visitor
- (org/objectweb/asm/MethodVisitor::visitVarInsn (!prefix <name>) (.int register)))))]
+ (org/objectweb/asm/MethodVisitor::visitVarInsn (!prefix <name>) (.int register)))))]
[IINC]
[ILOAD] [LLOAD] [FLOAD] [DLOAD] [ALOAD]
@@ -285,7 +285,7 @@
(-> (Type Class) Text (Type Value) Inst)
(function (_ visitor)
(do_to visitor
- (org/objectweb/asm/MethodVisitor::visitFieldInsn (<inst>) (..class_name class) field (..descriptor type)))))]
+ (org/objectweb/asm/MethodVisitor::visitFieldInsn (<inst>) (..class_name class) field (..descriptor type)))))]
[GETSTATIC org/objectweb/asm/Opcodes::GETSTATIC]
[PUTSTATIC org/objectweb/asm/Opcodes::PUTSTATIC]
@@ -300,7 +300,7 @@
(-> (Type <category>) Inst)
(function (_ visitor)
(do_to visitor
- (org/objectweb/asm/MethodVisitor::visitTypeInsn (<inst>) (..class_name class)))))]
+ (org/objectweb/asm/MethodVisitor::visitTypeInsn (<inst>) (..class_name class)))))]
(~~ (template.splice <instructions>+))))]
@@ -317,31 +317,31 @@
(-> (Type Primitive) Inst)
(function (_ visitor)
(do_to visitor
- (org/objectweb/asm/MethodVisitor::visitIntInsn (org/objectweb/asm/Opcodes::NEWARRAY)
- (`` (cond (~~ (template [<descriptor> <opcode>]
- [(type@= <descriptor> type) (<opcode>)]
-
- [type.boolean org/objectweb/asm/Opcodes::T_BOOLEAN]
- [type.byte org/objectweb/asm/Opcodes::T_BYTE]
- [type.short org/objectweb/asm/Opcodes::T_SHORT]
- [type.int org/objectweb/asm/Opcodes::T_INT]
- [type.long org/objectweb/asm/Opcodes::T_LONG]
- [type.float org/objectweb/asm/Opcodes::T_FLOAT]
- [type.double org/objectweb/asm/Opcodes::T_DOUBLE]
- [type.char org/objectweb/asm/Opcodes::T_CHAR]))
- ## else
- (undefined)))))))
+ (org/objectweb/asm/MethodVisitor::visitIntInsn (org/objectweb/asm/Opcodes::NEWARRAY)
+ (`` (cond (~~ (template [<descriptor> <opcode>]
+ [(type@= <descriptor> type) (<opcode>)]
+
+ [type.boolean org/objectweb/asm/Opcodes::T_BOOLEAN]
+ [type.byte org/objectweb/asm/Opcodes::T_BYTE]
+ [type.short org/objectweb/asm/Opcodes::T_SHORT]
+ [type.int org/objectweb/asm/Opcodes::T_INT]
+ [type.long org/objectweb/asm/Opcodes::T_LONG]
+ [type.float org/objectweb/asm/Opcodes::T_FLOAT]
+ [type.double org/objectweb/asm/Opcodes::T_DOUBLE]
+ [type.char org/objectweb/asm/Opcodes::T_CHAR]))
+ ## else
+ (undefined)))))))
(template [<name> <inst> <interface?>]
[(def: #export (<name> class method_name method)
(-> (Type Class) Text (Type Method) Inst)
(function (_ visitor)
(do_to visitor
- (org/objectweb/asm/MethodVisitor::visitMethodInsn (<inst>)
- (..class_name class)
- method_name
- (|> method type.descriptor descriptor.descriptor)
- <interface?>))))]
+ (org/objectweb/asm/MethodVisitor::visitMethodInsn (<inst>)
+ (..class_name class)
+ method_name
+ (|> method type.descriptor descriptor.descriptor)
+ <interface?>))))]
[INVOKESTATIC org/objectweb/asm/Opcodes::INVOKESTATIC false]
[INVOKEVIRTUAL org/objectweb/asm/Opcodes::INVOKEVIRTUAL false]
@@ -354,7 +354,7 @@
(-> //.Label Inst)
(function (_ visitor)
(do_to visitor
- (org/objectweb/asm/MethodVisitor::visitJumpInsn (!prefix <name>) @where))))]
+ (org/objectweb/asm/MethodVisitor::visitJumpInsn (!prefix <name>) @where))))]
[IF_ICMPEQ] [IF_ICMPGT] [IF_ICMPLT]
[IF_ICMPNE] [IF_ICMPGE] [IF_ICMPLE]
@@ -370,45 +370,45 @@
(i.< (product.left left) (product.left right)))
keys+labels)
array_size (list.size keys+labels)
- keys_array (host.array int array_size)
- labels_array (host.array org/objectweb/asm/Label array_size)
+ keys_array (ffi.array int array_size)
+ labels_array (ffi.array org/objectweb/asm/Label array_size)
_ (loop [idx 0]
(if (n.< array_size idx)
(let [[key label] (maybe.assume (list.nth idx keys+labels))]
(exec
- (host.array_write idx (host.long_to_int key) keys_array)
- (host.array_write idx label labels_array)
+ (ffi.array_write idx (ffi.long_to_int key) keys_array)
+ (ffi.array_write idx label labels_array)
(recur (inc idx))))
[]))]
(do_to visitor
- (org/objectweb/asm/MethodVisitor::visitLookupSwitchInsn default keys_array labels_array)))))
+ (org/objectweb/asm/MethodVisitor::visitLookupSwitchInsn default keys_array labels_array)))))
(def: #export (TABLESWITCH min max default labels)
(-> Int Int //.Label (List //.Label) Inst)
(function (_ visitor)
(let [num_labels (list.size labels)
- labels_array (host.array org/objectweb/asm/Label num_labels)
+ labels_array (ffi.array org/objectweb/asm/Label num_labels)
_ (loop [idx 0]
(if (n.< num_labels idx)
- (exec (host.array_write idx
- (maybe.assume (list.nth idx labels))
- labels_array)
+ (exec (ffi.array_write idx
+ (maybe.assume (list.nth idx labels))
+ labels_array)
(recur (inc idx)))
[]))]
(do_to visitor
- (org/objectweb/asm/MethodVisitor::visitTableSwitchInsn min max default labels_array)))))
+ (org/objectweb/asm/MethodVisitor::visitTableSwitchInsn min max default labels_array)))))
(def: #export (try @from @to @handler exception)
(-> //.Label //.Label //.Label (Type Class) Inst)
(function (_ visitor)
(do_to visitor
- (org/objectweb/asm/MethodVisitor::visitTryCatchBlock @from @to @handler (..class_name exception)))))
+ (org/objectweb/asm/MethodVisitor::visitTryCatchBlock @from @to @handler (..class_name exception)))))
(def: #export (label @label)
(-> //.Label Inst)
(function (_ visitor)
(do_to visitor
- (org/objectweb/asm/MethodVisitor::visitLabel @label))))
+ (org/objectweb/asm/MethodVisitor::visitLabel @label))))
(def: #export (array elementT)
(-> (Type Value) Inst)