aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/jvm.lux
diff options
context:
space:
mode:
authorEduardo Julian2018-07-29 02:30:13 -0400
committerEduardo Julian2018-07-29 02:30:13 -0400
commita59fc865aee240afe21b82ffef2681bb9a6ea693 (patch)
treeb5a2d95ffdec3edd2ecf7615c477ba522779d985 /new-luxc/source/luxc/lang/translation/jvm.lux
parent3b156dca7b4750e99bdd68b3858521e3fd6b3de5 (diff)
Adapted new-luxc to some of the latest changes to Lux.
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm.lux22
1 files changed, 11 insertions, 11 deletions
diff --git a/new-luxc/source/luxc/lang/translation/jvm.lux b/new-luxc/source/luxc/lang/translation/jvm.lux
index 3e239798b..52b104149 100644
--- a/new-luxc/source/luxc/lang/translation/jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm.lux
@@ -57,11 +57,11 @@
(def: ClassLoader::defineClass
Method
(case (Class::getDeclaredMethod ["defineClass"
- (|> (host.array (Class Object) +4)
- (host.array-write +0 (:coerce (Class Object) (host.class-for String)))
- (host.array-write +1 (Object::getClass [] (host.array byte +0)))
- (host.array-write +2 (:coerce (Class Object) Integer::TYPE))
- (host.array-write +3 (:coerce (Class Object) Integer::TYPE)))]
+ (|> (host.array (Class Object) 4)
+ (host.array-write 0 (:coerce (Class Object) (host.class-for String)))
+ (host.array-write 1 (Object::getClass [] (host.array byte 0)))
+ (host.array-write 2 (:coerce (Class Object) Integer::TYPE))
+ (host.array-write 3 (:coerce (Class Object) Integer::TYPE)))]
(host.class-for java/lang/ClassLoader))
(#error.Success method)
(do-to method
@@ -77,7 +77,7 @@
(Method::invoke [loader
(array.from-list (list (:coerce Object class-name)
(:coerce Object bytecode)
- (:coerce Object (host.long-to-int 0))
+ (:coerce Object (host.long-to-int +0))
(:coerce Object (host.long-to-int (.int (host.array-length bytecode))))))]
ClassLoader::defineClass))
@@ -160,10 +160,10 @@
(#error.Error error)
(ex.throw invalid-field [class-name ..value-field])))
-(def: (eval store loader valueI)
- (-> Store ClassLoader Inst (Error Any))
+(def: (eval store loader temp-label valueI)
+ (-> Store ClassLoader Text Inst (Error Any))
(do error.Monad<Error>
- [#let [eval-class "eval"
+ [#let [eval-class (|> temp-label name.normalize (text.replace-all " " "$"))
bytecode (def.class #jvm.V1_6
#jvm.Public jvm.noneC
eval-class
@@ -181,8 +181,8 @@
class (..load! eval-class loader)]
(class-value eval-class class)))
-(def: (define store loader [class-name class-bytecode])
- (-> Store ClassLoader Definition (Error Any))
+(def: (define store loader temp-label [class-name class-bytecode])
+ (-> Store ClassLoader Text Definition (Error Any))
(do error.Monad<Error>
[_ (..store! class-name class-bytecode store)
class (..load! class-name loader)]