From d9433d243aad3b7a41af9dee06be1137cc720326 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 14 Nov 2019 01:09:33 -0400 Subject: Fixed the test for INVOKEINTERFACE. --- stdlib/source/lux/target/jvm/bytecode.lux | 12 ++++++------ stdlib/source/test/lux/target/jvm.lux | 12 ++++-------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/stdlib/source/lux/target/jvm/bytecode.lux b/stdlib/source/lux/target/jvm/bytecode.lux index 3adfabe67..cb0df3383 100644 --- a/stdlib/source/lux/target/jvm/bytecode.lux +++ b/stdlib/source/lux/target/jvm/bytecode.lux @@ -753,13 +753,13 @@ ## else 1)) -(template [ ] +(template [ ] [(def: #export ( class method type) (-> (Type Class) Text (Type Method) (Bytecode Any)) (let [[inputs output exceptions] (parser.method type)] (do ..monad [index (<| ..lift - (//constant/pool.method (..reflection class)) + ( (..reflection class)) {#//constant/pool.name method #//constant/pool.descriptor (type.descriptor type)}) #let [consumption (|> inputs @@ -773,10 +773,10 @@ @_ [index consumption production]))))] - [#1 invokestatic _.invokestatic] - [#0 invokevirtual _.invokevirtual] - [#0 invokespecial _.invokespecial] - [#0 invokeinterface _.invokeinterface] + [#1 invokestatic _.invokestatic //constant/pool.method] + [#0 invokevirtual _.invokevirtual //constant/pool.method] + [#0 invokespecial _.invokespecial //constant/pool.method] + [#0 invokeinterface _.invokeinterface //constant/pool.interface-method] ) (template [ <1> <2>] diff --git a/stdlib/source/test/lux/target/jvm.lux b/stdlib/source/test/lux/target/jvm.lux index 13be558e5..1ab7ed5ab 100644 --- a/stdlib/source/test/lux/target/jvm.lux +++ b/stdlib/source/test/lux/target/jvm.lux @@ -739,16 +739,12 @@ (/.invokespecial ..$Double "" (/type.method [(list /type.double) /type.void (list)])))) (<| (_.lift "INVOKEINTERFACE") (do random.monad - [parameter ..$Double::random - subject ..$Double::random]) + [subject ..$String::random]) (..bytecode (|>> (:coerce java/lang/Long) - ("jvm leq" (java/lang/Double::compare parameter subject)))) + ("jvm leq" (text.size subject)))) (do /.monad - [_ (/.double subject) _ ..$Double::wrap - _ (/.double parameter) _ ..$Double::wrap - _ (/.invokeinterface (/type.class "java.lang.Comparable" (list)) - "compareTo​" - (/type.method [(list ..$Object) /type.int (list)])) + [_ (/.string subject) + _ (/.invokeinterface (/type.class "java.lang.CharSequence" (list)) "length" (/type.method [(list) /type.int (list)])) _ /.i2l] ..$Long::wrap)) ))) -- cgit v1.2.3