aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/tool/compiler/phase/generation/jvm/runtime.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/lux/tool/compiler/phase/generation/jvm/runtime.lux')
-rw-r--r--stdlib/source/lux/tool/compiler/phase/generation/jvm/runtime.lux65
1 files changed, 52 insertions, 13 deletions
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/runtime.lux b/stdlib/source/lux/tool/compiler/phase/generation/jvm/runtime.lux
index 05ef66973..078a136b7 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/runtime.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/jvm/runtime.lux
@@ -1,17 +1,17 @@
(.module:
- [lux (#- Definition)
+ [lux (#- Type Definition case)
[data
[binary (#+ Binary)]]
[target
[jvm
["_" instruction (#+ Label Instruction)]
- [encoding
- [name (#+ External)]]
- ["." type
- [category (#+ Value Return Method)]]]]]
- ["." ///
- [///
- [reference (#+ Register)]]]
+ ["." type (#+ Type)
+ ["." category (#+ Method)]]]]]
+ ["." // #_
+ ["#." value]
+ ["/#" //
+ [///
+ [reference (#+ Register)]]]]
)
(type: #export Byte-Code Binary)
@@ -35,12 +35,51 @@
(def: #export class (type.class "LuxRuntime" (list)))
-(def: apply-failure-name
- "apply_fail")
+(def: #export $Tag type.int)
+(def: #export $Flag //value.type)
+(def: #export $Variant (type.array //value.type))
-(def: apply-failure-type
+(def: #export $Offset type.int)
+(def: #export $Tuple (type.array //value.type))
+
+(def: #export $Stack (type.array //value.type))
+
+(def: procedure
+ (-> Text (Type Method) (Instruction Any))
+ (_.invokestatic ..class))
+
+(def: failure-type
(type.method [(list) type.void (list)]))
(def: #export apply-failure
- (Instruction Any)
- (_.invokestatic ..class ..apply-failure-name ..apply-failure-type))
+ (..procedure "apply_failure" ..failure-type))
+
+(def: #export pm-failure
+ (..procedure "pm_failure" ..failure-type))
+
+(def: push-name
+ "push")
+
+(def: push-type
+ (type.method [(list ..$Stack //value.type) ..$Stack (list)]))
+
+(def: #export push
+ (..procedure ..push-name ..push-type))
+
+(def: case-name
+ "case")
+
+(def: case-type
+ (type.method [(list ..$Variant ..$Tag ..$Flag) //value.type (list)]))
+
+(def: #export case
+ (..procedure ..case-name ..case-type))
+
+(def: projection-type
+ (type.method [(list ..$Tuple $Offset) //value.type (list)]))
+
+(def: #export left
+ (..procedure "left" ..projection-type))
+
+(def: #export right
+ (..procedure "right" ..projection-type))