diff options
Diffstat (limited to 'stdlib/source/library/lux/target/jvm')
18 files changed, 80 insertions, 74 deletions
diff --git a/stdlib/source/library/lux/target/jvm/attribute.lux b/stdlib/source/library/lux/target/jvm/attribute.lux index 72e054d5f..1dd3c323e 100644 --- a/stdlib/source/library/lux/target/jvm/attribute.lux +++ b/stdlib/source/library/lux/target/jvm/attribute.lux @@ -87,7 +87,7 @@ (def: (constant' @name index) (-> (Index UTF8) (Constant Any) Attribute) (#Constant {#name @name - #length (|> /constant.length //unsigned.u4 try.assumed) + #length (|> /constant.length //unsigned.u4 try.trusted) #info index})) (def: .public (constant index) @@ -104,7 +104,7 @@ #length (|> specification (/code.length ..length) //unsigned.u4 - try.assumed) + try.trusted) #info specification})) (def: .public (code specification) diff --git a/stdlib/source/library/lux/target/jvm/bytecode.lux b/stdlib/source/library/lux/target/jvm/bytecode.lux index b742f16cc..87b0a75c5 100644 --- a/stdlib/source/library/lux/target/jvm/bytecode.lux +++ b/stdlib/source/library/lux/target/jvm/bytecode.lux @@ -198,7 +198,7 @@ []]])))) (template [<name> <frames>] - [(def: <name> U2 (|> <frames> //unsigned.u2 try.assumed))] + [(def: <name> U2 (|> <frames> //unsigned.u2 try.trusted))] [$0 0] [$1 1] @@ -210,7 +210,7 @@ ) (template [<name> <registry>] - [(def: <name> Registry (|> <registry> //unsigned.u2 try.assumed /registry.registry))] + [(def: <name> Registry (|> <registry> //unsigned.u2 try.trusted /registry.registry))] [@_ 0] [@0 1] @@ -436,7 +436,7 @@ (-> S1 (Bytecode Any)) (..bytecode $0 $1 @_ _.bipush [byte])) -(def: (lift resource) +(def: (lifted resource) (All [a] (-> (Resource a) (Bytecode a))) @@ -450,7 +450,7 @@ (def: .public (string value) (-> //constant.UTF8 (Bytecode Any)) (do ..monad - [index (..lift (//constant/pool.string value))] + [index (..lifted (//constant/pool.string value))] (case (|> index //index.value //unsigned.value //unsigned.u1) (#try.Success index) (..bytecode $0 $1 @_ _.ldc [index]) @@ -475,7 +475,7 @@ <specializations> _ (do ..monad - [index (..lift (<constant> (<constructor> value)))] + [index (..lifted (<constant> (<constructor> value)))] (case (|> index //index.value //unsigned.value //unsigned.u1) (#try.Success index) (..bytecode $0 $1 @_ _.ldc [index]) @@ -497,7 +497,7 @@ (def: (arbitrary_float value) (-> java/lang/Float (Bytecode Any)) (do ..monad - [index (..lift (//constant/pool.float (//constant.float value)))] + [index (..lifted (//constant/pool.float (//constant.float value)))] (case (|> index //index.value //unsigned.value //unsigned.u1) (#try.Success index) (..bytecode $0 $1 @_ _.ldc [index]) @@ -537,7 +537,7 @@ <specializations> _ (do ..monad - [index (..lift (<constant> (<constructor> value)))] + [index (..lifted (<constant> (<constructor> value)))] (..bytecode $0 $2 @_ <wide> [index]))))] [long Int //constant.long //constant/pool.long _.ldc2_w/long @@ -549,7 +549,7 @@ (def: (arbitrary_double value) (-> java/lang/Double (Bytecode Any)) (do ..monad - [index (..lift (//constant/pool.double (//constant.double (:as Frac value))))] + [index (..lifted (//constant/pool.double (//constant.double (:as Frac value))))] (..bytecode $0 $2 @_ _.ldc2_w/double [index]))) (def: double_bits @@ -821,7 +821,7 @@ (in [..no_exceptions (bytecode jump)])] [goto_w _.goto_w (in [..no_exceptions (bytecode jump)]) - (in [..no_exceptions (bytecode (/jump.lift jump))])] + (in [..no_exceptions (bytecode (/jump.lifted jump))])] ) (def: (big_jump jump) @@ -831,7 +831,7 @@ big (#.Right small) - (/jump.lift small))) + (/jump.lifted small))) (exception: .public invalid_tableswitch) @@ -924,7 +924,7 @@ (-> (Type <category>) (Bytecode Any)) (do ..monad [... TODO: Make sure it's impossible to have indexes greater than U2. - index (..lift (//constant/pool.class (//name.internal (..reflection class))))] + index (..lifted (//constant/pool.class (//name.internal (..reflection class))))] (..bytecode <consumption> <production> @_ <instruction> [index])))] [$0 $1 new Class _.new] @@ -949,8 +949,8 @@ (case (|> dimensions //unsigned.value) 0 (..except ..multiarray_cannot_be_zero_dimensional [class]) _ (in []))) - index (..lift (//constant/pool.class (//name.internal (..reflection class))))] - (..bytecode (//unsigned.lift/2 dimensions) $1 @_ _.multianewarray [index dimensions]))) + index (..lifted (//constant/pool.class (//name.internal (..reflection class))))] + (..bytecode (//unsigned.lifted/2 dimensions) $1 @_ _.multianewarray [index dimensions]))) (def: (type_size type) (-> (Type Return) Nat) @@ -969,7 +969,7 @@ (-> (Type Class) Text (Type Method) (Bytecode Any)) (let [[type_variables inputs output exceptions] (parser.method type)] (do ..monad - [index (<| ..lift + [index (<| ..lifted (<method> (..reflection class)) {#//constant/pool.name method #//constant/pool.descriptor (type.descriptor type)}) @@ -977,10 +977,10 @@ (list\map ..type_size) (list\fold n.+ (if <static?> 0 1)) //unsigned.u1 - try.assumed) - production (|> output ..type_size //unsigned.u1 try.assumed)]] - (..bytecode (//unsigned.lift/2 consumption) - (//unsigned.lift/2 production) + try.trusted) + production (|> output ..type_size //unsigned.u1 try.trusted)]] + (..bytecode (//unsigned.lifted/2 consumption) + (//unsigned.lifted/2 production) @_ <instruction> [index consumption production]))))] @@ -994,7 +994,7 @@ [(def: .public (<name> class field type) (-> (Type Class) Text (Type Value) (Bytecode Any)) (do ..monad - [index (<| ..lift + [index (<| ..lifted (//constant/pool.field (..reflection class)) {#//constant/pool.name field #//constant/pool.descriptor (type.descriptor type)})] @@ -1017,7 +1017,7 @@ (def: .public (try @start @end @handler catch) (-> Label Label Label (Type Class) (Bytecode Any)) (do ..monad - [@catch (..lift (//constant/pool.class (//name.internal (..reflection catch))))] + [@catch (..lifted (//constant/pool.class (//name.internal (..reflection catch))))] (function (_ [pool environment tracker]) (#try.Success [[pool @@ -1038,7 +1038,7 @@ _.empty]))) []]])))) -(def: .public (compose pre post) +(def: .public (composite pre post) (All [pre post] (-> (Bytecode pre) (Bytecode post) (Bytecode post))) (do ..monad diff --git a/stdlib/source/library/lux/target/jvm/bytecode/address.lux b/stdlib/source/library/lux/target/jvm/bytecode/address.lux index d7f2f612f..669b49548 100644 --- a/stdlib/source/library/lux/target/jvm/bytecode/address.lux +++ b/stdlib/source/library/lux/target/jvm/bytecode/address.lux @@ -34,7 +34,7 @@ (def: .public start Address - (|> 0 ///unsigned.u2 try.assumed :abstraction)) + (|> 0 ///unsigned.u2 try.trusted :abstraction)) (def: .public (move distance) (-> U2 (-> Address (Try Address))) diff --git a/stdlib/source/library/lux/target/jvm/bytecode/environment/limit/registry.lux b/stdlib/source/library/lux/target/jvm/bytecode/environment/limit/registry.lux index ddc600162..43cb70e87 100644 --- a/stdlib/source/library/lux/target/jvm/bytecode/environment/limit/registry.lux +++ b/stdlib/source/library/lux/target/jvm/bytecode/environment/limit/registry.lux @@ -78,10 +78,10 @@ (template [<name> <extra>] [(def: .public <name> (-> Register Registry) - (let [extra (|> <extra> /////unsigned.u2 try.assumed)] - (|>> /////unsigned.lift/2 + (let [extra (|> <extra> /////unsigned.u2 try.trusted)] + (|>> /////unsigned.lifted/2 (/////unsigned.+/2 extra) - try.assumed + try.trusted :abstraction)))] [for ..normal] diff --git a/stdlib/source/library/lux/target/jvm/bytecode/environment/limit/stack.lux b/stdlib/source/library/lux/target/jvm/bytecode/environment/limit/stack.lux index 5499207cf..ac3934f87 100644 --- a/stdlib/source/library/lux/target/jvm/bytecode/environment/limit/stack.lux +++ b/stdlib/source/library/lux/target/jvm/bytecode/environment/limit/stack.lux @@ -25,7 +25,7 @@ (template [<frames> <name>] [(def: .public <name> Stack - (|> <frames> /////unsigned.u2 maybe.assume :abstraction))] + (|> <frames> /////unsigned.u2 maybe.trusted :abstraction))] [0 empty] [1 catch] diff --git a/stdlib/source/library/lux/target/jvm/bytecode/instruction.lux b/stdlib/source/library/lux/target/jvm/bytecode/instruction.lux index 22777c083..7f8638dca 100644 --- a/stdlib/source/library/lux/target/jvm/bytecode/instruction.lux +++ b/stdlib/source/library/lux/target/jvm/bytecode/instruction.lux @@ -59,7 +59,7 @@ (type: Opcode Nat) (template [<name> <size>] - [(def: <name> Size (|> <size> ///unsigned.u2 try.assumed))] + [(def: <name> Size (|> <size> ///unsigned.u2 try.trusted))] [opcode_size 1] [register_size 1] @@ -74,7 +74,7 @@ (function (_ [offset binary]) [(n.+ (///unsigned.value ..opcode_size) offset) - (try.assumed + (try.trusted (binary.write/8! offset opcode binary))])) (def: nullary @@ -90,7 +90,7 @@ Size (|> ..opcode_size (///unsigned.+/2 <size>) - try.assumed))] + try.trusted))] [size/1 ..register_size] [size/2 ..index_size] @@ -103,7 +103,7 @@ (-> Opcode <inputT> Mutation) (function (_ [offset binary]) [(n.+ (///unsigned.value <shift>) offset) - (try.assumed + (try.trusted (do try.monad [_ (binary.write/8! offset opcode binary)] (<writer> (n.+ (///unsigned.value ..opcode_size) offset) @@ -129,7 +129,7 @@ (-> Opcode <inputT> Mutation) (function (_ [offset binary]) [(n.+ (///unsigned.value <shift>) offset) - (try.assumed + (try.trusted (do try.monad [_ (binary.write/8! offset opcode binary)] (<writer> (n.+ (///unsigned.value ..opcode_size) offset) @@ -150,14 +150,14 @@ (def: size/11 Size (|> ..opcode_size - (///unsigned.+/2 ..register_size) try.assumed - (///unsigned.+/2 ..byte_size) try.assumed)) + (///unsigned.+/2 ..register_size) try.trusted + (///unsigned.+/2 ..byte_size) try.trusted)) (def: (binary/11' opcode input0 input1) (-> Opcode U1 U1 Mutation) (function (_ [offset binary]) [(n.+ (///unsigned.value ..size/11) offset) - (try.assumed + (try.trusted (do try.monad [_ (binary.write/8! offset opcode binary) _ (binary.write/8! (n.+ (///unsigned.value ..opcode_size) offset) @@ -177,14 +177,14 @@ (def: size/21 Size (|> ..opcode_size - (///unsigned.+/2 ..index_size) try.assumed - (///unsigned.+/2 ..byte_size) try.assumed)) + (///unsigned.+/2 ..index_size) try.trusted + (///unsigned.+/2 ..byte_size) try.trusted)) (def: (binary/21' opcode input0 input1) (-> Opcode U2 U1 Mutation) (function (_ [offset binary]) [(n.+ (///unsigned.value ..size/21) offset) - (try.assumed + (try.trusted (do try.monad [_ (binary.write/8! offset opcode binary) _ (binary.write/16! (n.+ (///unsigned.value ..opcode_size) offset) @@ -204,15 +204,15 @@ (def: size/211 Size (|> ..opcode_size - (///unsigned.+/2 ..index_size) try.assumed - (///unsigned.+/2 ..byte_size) try.assumed - (///unsigned.+/2 ..byte_size) try.assumed)) + (///unsigned.+/2 ..index_size) try.trusted + (///unsigned.+/2 ..byte_size) try.trusted + (///unsigned.+/2 ..byte_size) try.trusted)) (def: (trinary/211' opcode input0 input1 input2) (-> Opcode U2 U1 U1 Mutation) (function (_ [offset binary]) [(n.+ (///unsigned.value ..size/211) offset) - (try.assumed + (try.trusted (do try.monad [_ (binary.write/8! offset opcode binary) _ (binary.write/16! (n.+ (///unsigned.value ..opcode_size) offset) @@ -242,7 +242,7 @@ (|>> :representation)) (template [<code> <name>] - [(def: .public <name> (|> <code> ///unsigned.u1 try.assumed :abstraction))] + [(def: .public <name> (|> <code> ///unsigned.u1 try.trusted :abstraction))] [04 t_boolean] [05 t_char] @@ -573,7 +573,7 @@ [["C5" multianewarray [[index (Index Class)] [count U1]] [(///index.value index) count]]]] [..trinary/211 - [["B9" invokeinterface [[index (Index (Reference Method))] [count U1] [output_count U1]] [(///index.value index) count (try.assumed (///unsigned.u1 0))]]]] + [["B9" invokeinterface [[index (Index (Reference Method))] [count U1] [output_count U1]] [(///index.value index) count (try.trusted (///unsigned.u1 0))]]]] )) (def: (switch_padding offset) @@ -598,14 +598,14 @@ (n.* (///unsigned.value ..big_jump_size) (inc amount_of_afterwards))) ///unsigned.u2 - try.assumed)))] + try.trusted)))] [estimator (function (_ minimum default [at_minimum afterwards]) (let [amount_of_afterwards (list.size afterwards) estimator (estimator amount_of_afterwards)] (function (_ [size mutation]) (let [padding (switch_padding size) - tableswitch_size (try.assumed + tableswitch_size (try.trusted (do {! try.monad} [size (///unsigned.u2 size)] (\ ! map (|>> estimator ///unsigned.value) @@ -613,7 +613,7 @@ tableswitch_mutation (: Mutation (function (_ [offset binary]) [(n.+ tableswitch_size offset) - (try.assumed + (try.trusted (do {! try.monad} [amount_of_afterwards (|> amount_of_afterwards .int ///signed.s4) maximum (///signed.+/4 minimum amount_of_afterwards) @@ -662,14 +662,14 @@ (///unsigned.value ..integer_size) (n.* amount_of_cases case_size)) ///unsigned.u2 - try.assumed)))] + try.trusted)))] [estimator (function (_ default cases) (let [amount_of_cases (list.size cases) estimator (estimator amount_of_cases)] (function (_ [size mutation]) (let [padding (switch_padding size) - lookupswitch_size (try.assumed + lookupswitch_size (try.trusted (do {! try.monad} [size (///unsigned.u2 size)] (\ ! map (|>> estimator ///unsigned.value) @@ -677,7 +677,7 @@ lookupswitch_mutation (: Mutation (function (_ [offset binary]) [(n.+ lookupswitch_size offset) - (try.assumed + (try.trusted (do {! try.monad} [_ (binary.write/8! offset (hex "AB") binary) .let [offset (n.+ (///unsigned.value ..opcode_size) offset)] diff --git a/stdlib/source/library/lux/target/jvm/bytecode/jump.lux b/stdlib/source/library/lux/target/jvm/bytecode/jump.lux index 53fdd6081..74821d838 100644 --- a/stdlib/source/library/lux/target/jvm/bytecode/jump.lux +++ b/stdlib/source/library/lux/target/jvm/bytecode/jump.lux @@ -22,6 +22,6 @@ (type: .public Big_Jump S4) -(def: .public lift +(def: .public lifted (-> Jump Big_Jump) - ///signed.lift/4) + ///signed.lifted/4) diff --git a/stdlib/source/library/lux/target/jvm/constant/pool.lux b/stdlib/source/library/lux/target/jvm/constant/pool.lux index a82683e1b..2278889b8 100644 --- a/stdlib/source/library/lux/target/jvm/constant/pool.lux +++ b/stdlib/source/library/lux/target/jvm/constant/pool.lux @@ -154,5 +154,5 @@ (def: .public empty Pool - [(|> 1 //unsigned.u2 try.assumed //index.index) + [(|> 1 //unsigned.u2 try.trusted //index.index) row.empty]) diff --git a/stdlib/source/library/lux/target/jvm/constant/tag.lux b/stdlib/source/library/lux/target/jvm/constant/tag.lux index 7d53837f0..54b4dbba1 100644 --- a/stdlib/source/library/lux/target/jvm/constant/tag.lux +++ b/stdlib/source/library/lux/target/jvm/constant/tag.lux @@ -28,7 +28,7 @@ (template [<code> <name>] [(def: .public <name> Tag - (|> <code> ///unsigned.u1 try.assumed :abstraction))] + (|> <code> ///unsigned.u1 try.trusted :abstraction))] [01 utf8] [03 integer] diff --git a/stdlib/source/library/lux/target/jvm/encoding/signed.lux b/stdlib/source/library/lux/target/jvm/encoding/signed.lux index 196f60380..8fed13354 100644 --- a/stdlib/source/library/lux/target/jvm/encoding/signed.lux +++ b/stdlib/source/library/lux/target/jvm/encoding/signed.lux @@ -93,8 +93,8 @@ (-> <from> <to>) (|>> :transmutation))] - [lift/2 S1 S2] - [lift/4 S2 S4] + [lifted/2 S1 S2] + [lifted/4 S2 S4] ) (template [<writer_name> <type> <writer>] diff --git a/stdlib/source/library/lux/target/jvm/encoding/unsigned.lux b/stdlib/source/library/lux/target/jvm/encoding/unsigned.lux index e9084bb9d..8a889a1ad 100644 --- a/stdlib/source/library/lux/target/jvm/encoding/unsigned.lux +++ b/stdlib/source/library/lux/target/jvm/encoding/unsigned.lux @@ -107,8 +107,8 @@ (-> <from> <to>) (|>> :transmutation))] - [lift/2 U1 U2] - [lift/4 U2 U4] + [lifted/2 U1 U2] + [lifted/4 U2 U4] ) (template [<writer_name> <type> <writer>] diff --git a/stdlib/source/library/lux/target/jvm/magic.lux b/stdlib/source/library/lux/target/jvm/magic.lux index c08360f9e..b2b547fcf 100644 --- a/stdlib/source/library/lux/target/jvm/magic.lux +++ b/stdlib/source/library/lux/target/jvm/magic.lux @@ -14,7 +14,9 @@ (def: .public code Magic - (|> (hex "CAFEBABE") //unsigned.u4 try.assumed)) + (|> (hex "CAFEBABE") + //unsigned.u4 + try.trusted)) (def: .public writer //unsigned.writer/4) diff --git a/stdlib/source/library/lux/target/jvm/modifier.lux b/stdlib/source/library/lux/target/jvm/modifier.lux index 523a9a722..c7eb021b2 100644 --- a/stdlib/source/library/lux/target/jvm/modifier.lux +++ b/stdlib/source/library/lux/target/jvm/modifier.lux @@ -43,7 +43,7 @@ (template: (!wrap value) [(|> value //unsigned.u2 - try.assumed + try.trusted :abstraction)]) (template: (!unwrap value) diff --git a/stdlib/source/library/lux/target/jvm/type/alias.lux b/stdlib/source/library/lux/target/jvm/type/alias.lux index 6b3a2ee45..5ba678bf6 100644 --- a/stdlib/source/library/lux/target/jvm/type/alias.lux +++ b/stdlib/source/library/lux/target/jvm/type/alias.lux @@ -128,4 +128,4 @@ return (..return aliasing) exceptions (<>.some (..exception aliasing))] (in (//.method [type_variables inputs return exceptions])))) - try.assumed)) + try.trusted)) diff --git a/stdlib/source/library/lux/target/jvm/type/descriptor.lux b/stdlib/source/library/lux/target/jvm/type/descriptor.lux index 60e8eead3..9c0f56021 100644 --- a/stdlib/source/library/lux/target/jvm/type/descriptor.lux +++ b/stdlib/source/library/lux/target/jvm/type/descriptor.lux @@ -98,7 +98,7 @@ (:abstraction (format (|> inputs (list\map ..descriptor) - (text.join_with "") + text.joined (text.enclosed ["(" ")"])) (:representation output)))) @@ -122,5 +122,5 @@ (n.- prefix_size) (n.- suffix_size))) (\ maybe.monad map ///name.internal) - maybe.assume)))))) + maybe.trusted)))))) ) diff --git a/stdlib/source/library/lux/target/jvm/type/parser.lux b/stdlib/source/library/lux/target/jvm/type/parser.lux index 6712f7ee0..2bbbca6ca 100644 --- a/stdlib/source/library/lux/target/jvm/type/parser.lux +++ b/stdlib/source/library/lux/target/jvm/type/parser.lux @@ -98,7 +98,7 @@ (|>> //.signature //signature.signature (<text>.result ..var') - try.assumed)) + try.trusted)) (template [<name> <prefix> <constructor>] [(def: <name> @@ -166,7 +166,7 @@ (|>> //.signature //signature.signature (<text>.result (..class'' ..parameter)) - try.assumed)) + try.trusted)) (def: .public value (Parser (Type Value)) @@ -224,7 +224,7 @@ (|>> //.signature //signature.signature (<text>.result parser) - try.assumed))) + try.trusted))) (template [<name> <category> <parser>] [(def: .public <name> @@ -262,4 +262,4 @@ (|>> //.signature //signature.signature (<text>.result ..declaration') - try.assumed)) + try.trusted)) diff --git a/stdlib/source/library/lux/target/jvm/type/signature.lux b/stdlib/source/library/lux/target/jvm/type/signature.lux index 23038130a..683ba1432 100644 --- a/stdlib/source/library/lux/target/jvm/type/signature.lux +++ b/stdlib/source/library/lux/target/jvm/type/signature.lux @@ -94,7 +94,7 @@ (format ..parameters_start (|> parameters (list\map ..signature) - (text.join_with "")) + text.joined) ..parameters_end)) //descriptor.class_suffix))) @@ -130,18 +130,18 @@ (|> type_variables (list\map (|>> ..var_name (text.suffix ..class_bound))) - (text.join_with "") + text.joined (text.enclosed [..parameters_start ..parameters_end]))) (|> inputs (list\map ..signature) - (text.join_with "") + text.joined (text.enclosed [..arguments_start ..arguments_end])) (:representation output) (|> exceptions (list\map (|>> :representation (format ..exception_prefix))) - (text.join_with ""))))) + text.joined)))) (implementation: .public equivalence (All [category] (Equivalence (Signature category))) diff --git a/stdlib/source/library/lux/target/jvm/version.lux b/stdlib/source/library/lux/target/jvm/version.lux index f5db348ef..7fbf55c35 100644 --- a/stdlib/source/library/lux/target/jvm/version.lux +++ b/stdlib/source/library/lux/target/jvm/version.lux @@ -13,12 +13,16 @@ (def: .public default_minor Minor - (|> 0 //unsigned.u2 try.assumed)) + (|> 0 + //unsigned.u2 + try.trusted)) (template [<number> <name>] [(def: .public <name> Major - (|> <number> //unsigned.u2 try.assumed))] + (|> <number> + //unsigned.u2 + try.trusted))] [45 v1_1] [46 v1_2] |