From a59fc865aee240afe21b82ffef2681bb9a6ea693 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 29 Jul 2018 02:30:13 -0400 Subject: Adapted new-luxc to some of the latest changes to Lux. --- new-luxc/source/luxc/lang/translation/jvm.lux | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'new-luxc/source/luxc/lang/translation/jvm.lux') 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 - [#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 [_ (..store! class-name class-bytecode store) class (..load! class-name loader)] -- cgit v1.2.3