aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library
diff options
context:
space:
mode:
authorEduardo Julian2022-01-06 19:47:43 -0400
committerEduardo Julian2022-01-06 19:47:43 -0400
commitd0f33f630aedb67d2888e32ceb7bc237839b274e (patch)
tree1d5d4545a9480caac6bbd7c98ebe9cb044e80ebb /stdlib/source/library
parentd37982f0af44714d95caf24d7f944e4e659b3e69 (diff)
Small optimizations to JVM bytecode generation.
Diffstat (limited to 'stdlib/source/library')
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/case.lux2
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function.lux5
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/constant/arity.lux8
-rw-r--r--stdlib/source/library/lux/tool/compiler/reference.lux39
4 files changed, 22 insertions, 32 deletions
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/case.lux
index b28f5b5a7..a22654346 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/case.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/case.lux
@@ -252,9 +252,7 @@
{.#Some _}
($_ _.composite
(_.set_label @else)
- _.pop ... TODO: Comment this line
//runtime.pm_failure
- _.aconst_null ... TODO: Comment this line
(_.goto @end)
)))
))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function.lux
index fd110c5d2..343aa7f1f 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function.lux
@@ -68,9 +68,8 @@
(Bytecode Any)]))
(let [classT (type.class class (list))
fields (: (List (Resource Field))
- (list& /arity.constant
- (list#composite (/foreign.variables environment)
- (/partial.variables arity))))
+ (list#composite (/foreign.variables environment)
+ (/partial.variables arity)))
methods (: (List (Resource Method))
(list& (/init.method classT environment arity)
(/reset.method classT environment arity)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/constant/arity.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/constant/arity.lux
index 878bbac3a..1828fe5c1 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/constant/arity.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/constant/arity.lux
@@ -4,19 +4,13 @@
[target
[jvm
["[0]" type]
- ["[0]" field {"+" Field}]
[constant
[pool {"+" Resource}]]]]]]
["[0]" //
[/////////
[arity {"+" Arity}]]])
-(def: .public name "arity")
-(def: .public type type.int)
-
(def: .public minimum Arity 1)
(def: .public maximum Arity 8)
-(def: .public constant
- (Resource Field)
- (//.constant ..name ..type))
+(def: .public type type.int)
diff --git a/stdlib/source/library/lux/tool/compiler/reference.lux b/stdlib/source/library/lux/tool/compiler/reference.lux
index 2e57e77d9..56f9b9589 100644
--- a/stdlib/source/library/lux/tool/compiler/reference.lux
+++ b/stdlib/source/library/lux/tool/compiler/reference.lux
@@ -1,21 +1,21 @@
(.using
- [library
- [lux {"-" local}
- [abstract
- [equivalence {"+" Equivalence}]
- [hash {"+" Hash}]]
- [control
- [pipe {"+" case>}]]
- [data
- [text
- ["%" format {"+" Format}]]]
- [math
- [number
- ["n" nat]]]
- [meta
- ["[0]" symbol]]]]
- ["[0]" / "_"
- ["[1][0]" variable {"+" Variable}]])
+ [library
+ [lux {"-" local}
+ [abstract
+ [equivalence {"+" Equivalence}]
+ [hash {"+" Hash}]]
+ [control
+ [pipe {"+" case>}]]
+ [data
+ [text
+ ["%" format {"+" Format}]]]
+ [math
+ [number
+ ["n" nat]]]
+ [meta
+ ["[0]" symbol]]]]
+ ["[0]" / "_"
+ ["[1][0]" variable {"+" Variable}]])
(type: .public Constant
Symbol)
@@ -75,9 +75,8 @@
[constant ..#Constant]
)
-(def: .public self
- Reference
- (..local 0))
+(`` (template: .public self
+ [(..variable (~~ (/variable.self)))]))
(def: .public format
(Format Reference)