aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/tool
diff options
context:
space:
mode:
authorEduardo Julian2019-08-20 22:00:59 -0400
committerEduardo Julian2019-08-20 22:00:59 -0400
commit59ededb795732e04ac8e1eaceb2b1509a1c1cc23 (patch)
treec0498fbae7cd18fa9434c972a6f7e35d0e02b456 /stdlib/source/lux/tool
parentcdfda2f80b2abd8ec7d8021aab910ccc82271ade (diff)
WIP: Make new-luxc instructions rely on the Descriptor type.
Diffstat (limited to 'stdlib/source/lux/tool')
-rw-r--r--stdlib/source/lux/tool/compiler/phase/extension/analysis/jvm.lux14
-rw-r--r--stdlib/source/lux/tool/compiler/phase/generation/jvm/function/field/foreign.lux2
-rw-r--r--stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/apply.lux2
-rw-r--r--stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/init.lux2
-rw-r--r--stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/new.lux4
-rw-r--r--stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/reset.lux2
-rw-r--r--stdlib/source/lux/tool/compiler/phase/generation/jvm/primitive.lux4
-rw-r--r--stdlib/source/lux/tool/compiler/phase/generation/jvm/structure.lux2
-rw-r--r--stdlib/source/lux/tool/compiler/phase/generation/jvm/value.lux2
9 files changed, 17 insertions, 17 deletions
diff --git a/stdlib/source/lux/tool/compiler/phase/extension/analysis/jvm.lux b/stdlib/source/lux/tool/compiler/phase/extension/analysis/jvm.lux
index 85d7524f9..af85ebf1c 100644
--- a/stdlib/source/lux/tool/compiler/phase/extension/analysis/jvm.lux
+++ b/stdlib/source/lux/tool/compiler/phase/extension/analysis/jvm.lux
@@ -281,7 +281,7 @@
(^ (list arrayC))
(do ////.monad
[_ (typeA.infer ..int)
- arrayA (typeA.with-type (#.Primitive (jvm.descriptor (jvm.array 1 primitive-type)) (list))
+ arrayA (typeA.with-type (#.Primitive (reflection.class (jvm.array 1 primitive-type)) (list))
(analyse arrayC))]
(wrap (#/////analysis.Extension extension-name (list arrayA))))
@@ -315,7 +315,7 @@
(do ////.monad
[lengthA (typeA.with-type ..int
(analyse lengthC))
- _ (typeA.infer (#.Primitive (jvm.descriptor (jvm.array 1 primitive-type)) (list)))]
+ _ (typeA.infer (#.Primitive (reflection.class (jvm.array 1 primitive-type)) (list)))]
(wrap (#/////analysis.Extension extension-name (list lengthA))))
_
@@ -415,7 +415,7 @@
(-> .Type (Operation Text))
(if (is? .Any type)
(////@wrap jvm.void-descriptor)
- (////@map jvm.descriptor (check-jvm type))))
+ (////@map reflection.class (check-jvm type))))
(def: (read-primitive-array-handler lux-type jvm-type)
(-> .Type Type Handler)
@@ -426,7 +426,7 @@
[_ (typeA.infer lux-type)
idxA (typeA.with-type ..int
(analyse idxC))
- arrayA (typeA.with-type (#.Primitive (jvm.descriptor (jvm.array 1 jvm-type)) (list))
+ arrayA (typeA.with-type (#.Primitive (reflection.class (jvm.array 1 jvm-type)) (list))
(analyse arrayC))]
(wrap (#/////analysis.Extension extension-name (list idxA arrayA))))
@@ -458,7 +458,7 @@
(def: (write-primitive-array-handler lux-type jvm-type)
(-> .Type Type Handler)
- (let [array-type (#.Primitive (jvm.descriptor (jvm.array 1 jvm-type)) (list))]
+ (let [array-type (#.Primitive (reflection.class (jvm.array 1 jvm-type)) (list))]
(function (_ extension-name analyse args)
(case args
(^ (list idxC valueC arrayC))
@@ -924,7 +924,7 @@
[parameters (|> (java/lang/reflect/Method::getGenericParameterTypes method)
array.to-list
(monad.map try.monad reflection!.type)
- (:: try.monad map (list@map jvm.descriptor))
+ (:: try.monad map (list@map reflection.class))
////.lift)
#let [modifiers (java/lang/reflect/Method::getModifiers method)
correct-class? (java/lang/Object::equals class (java/lang/reflect/Method::getDeclaringClass method))
@@ -961,7 +961,7 @@
[parameters (|> (java/lang/reflect/Constructor::getGenericParameterTypes constructor)
array.to-list
(monad.map try.monad reflection!.type)
- (:: try.monad map (list@map jvm.descriptor))
+ (:: try.monad map (list@map reflection.class))
////.lift)]
(wrap (and (java/lang/Object::equals class (java/lang/reflect/Constructor::getDeclaringClass constructor))
(n.= (list.size arg-classes) (list.size parameters))
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/field/foreign.lux b/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/field/foreign.lux
index b4fa6727e..91e06c383 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/field/foreign.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/field/foreign.lux
@@ -20,7 +20,7 @@
[analysis (#+ Environment)]]]])
(def: #export (closure environment)
- (-> Environment (List (Descriptor (Value Any))))
+ (-> Environment (List (Descriptor Value)))
(list.repeat (list.size environment) ////value.type))
(def: #export fields
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/apply.lux b/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/apply.lux
index 3971610ff..d2f2b9380 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/apply.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/apply.lux
@@ -27,7 +27,7 @@
(def: #export name "apply")
(def: #export (type arity)
- (-> Arity [(List (Descriptor (Value Any))) (Descriptor (Return Any))])
+ (-> Arity [(List (Descriptor Value)) (Descriptor (Return Any))])
[(list.repeat arity ////value.type)
////value.type])
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/init.lux b/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/init.lux
index 0489b8f12..5a53ff9e0 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/init.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/init.lux
@@ -14,7 +14,7 @@
["." arity (#+ Arity)]]]])
(def: #export type
- [(List (Descriptor (Value Any)))
+ [(List (Descriptor Value))
(Descriptor (Return Any))]
[(list ///arity.type) descriptor.void])
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/new.lux b/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/new.lux
index c0bf6e44b..7196d60fd 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/new.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/new.lux
@@ -38,11 +38,11 @@
["." phase]]]]])
(def: (arguments arity)
- (-> Arity (List (Descriptor (Value Any))))
+ (-> Arity (List (Descriptor Value)))
(list.repeat (dec arity) ////value.type))
(def: #export (type environment arity)
- (-> Environment Arity [(List (Descriptor (Value Any)))
+ (-> Environment Arity [(List (Descriptor Value))
(Descriptor (Return Any))])
[(list@compose (///field/foreign.closure environment)
(if (arity.multiary? arity)
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/reset.lux b/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/reset.lux
index 7aee9e428..df9ea0ae8 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/reset.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/jvm/function/method/reset.lux
@@ -35,7 +35,7 @@
(def: #export type
(-> External (Descriptor descriptor.Method))
- (|>> descriptor.object [(list)] descriptor.method))
+ (|>> descriptor.class [(list)] descriptor.method))
(def: #export (method class environment arity)
(-> External Environment Arity (State Pool Method))
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/primitive.lux b/stdlib/source/lux/tool/compiler/phase/generation/jvm/primitive.lux
index 27a02d7b4..d2d51d992 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/primitive.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/jvm/primitive.lux
@@ -16,7 +16,7 @@
(-> Bit (Instruction Any))
(_.getstatic "java.lang.Boolean"
(if value "TRUE" "FALSE")
- (|.object "java.lang.Boolean")))
+ (|.class "java.lang.Boolean")))
(template [<name> <inputT> <ldc> <class> <inputD>]
[(def: #export (<name> value)
@@ -25,7 +25,7 @@
[_ (`` (|> value (~~ (template.splice <ldc>))))]
(_.invokestatic <class> "valueOf"
[(list <inputD>)
- (|.object <class>)])))]
+ (|.class <class>)])))]
[i64 (I64 Any) [.int constant.long _.ldc/long] "java.lang.Long" |.long]
[f64 Frac [constant.double _.ldc/double] "java.lang.Double" |.double]
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/structure.lux b/stdlib/source/lux/tool/compiler/phase/generation/jvm/structure.lux
index 8b2c6c270..380040fa5 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/structure.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/jvm/structure.lux
@@ -57,7 +57,7 @@
..unitG
_.aconst-null))
-(def: $Object (|.object "java.lang.Object"))
+(def: $Object (|.class "java.lang.Object"))
(def: #export (variant generate [lefts right? valueS])
(Generator (Variant Synthesis))
diff --git a/stdlib/source/lux/tool/compiler/phase/generation/jvm/value.lux b/stdlib/source/lux/tool/compiler/phase/generation/jvm/value.lux
index a598b9997..c0634ac25 100644
--- a/stdlib/source/lux/tool/compiler/phase/generation/jvm/value.lux
+++ b/stdlib/source/lux/tool/compiler/phase/generation/jvm/value.lux
@@ -6,4 +6,4 @@
(def: #export field "_value")
-(def: #export type (Descriptor (Value Any)) (descriptor.object "java.lang.Object"))
+(def: #export type (descriptor.class "java.lang.Object"))