File tree 6 files changed +32
-3
lines changed
idris-jvm-core/src/main/idris/IdrisJvm/Core
idris-jvm-ffi/src/main/idris
6 files changed +32
-3
lines changed Original file line number Diff line number Diff line change 13
13
- oraclejdk8
14
14
15
15
before_install :
16
- - docker pull mmhelloworld/idris:1.0
16
+ - docker pull mmhelloworld/idris:1.1.1
17
17
- mkdir -p $HOME/bin/idris-packages $HOME/bin/idris-jvm
18
18
- wget https://github.com/mmhelloworld/idris-jvm/releases/download/1.0-SNAPSHOT-20170704/idris-jvm-1.0-SNAPSHOT-20170704.zip
19
19
- unzip -o idris-jvm-*.zip -d $HOME/bin
20
20
- export PATH=`pwd`/bin/travis:$HOME/bin/idris-jvm/codegen/bin:$HOME/.local/bin:$PATH
21
21
- export PROJECT_ROOT=`pwd`
22
- - docker run --name idris mmhelloworld/idris:1.0 idris -v && docker cp idris:/root/ .stack/snapshots /x86_64-linux/lts-8.18 /8.0.2/share/x86_64-linux-ghc-8.0.2/idris-1.0 /libs/. $HOME/bin/idris-packages && docker rm idris
22
+ - docker run --name idris mmhelloworld/idris:1.1.1 idris -v && docker cp idris:/.stack-work/install /x86_64-linux/lts-9.1 /8.0.2/share/x86_64-linux-ghc-8.0.2/idris-1.1.1 /libs/. $HOME/bin/idris-packages && docker rm idris
23
23
24
24
script :
25
25
- mvn -pl :idris-jvm-integration-test test -B
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- travis_long docker run -v $HOME /bin/idris-packages:/root/ .stack/snapshots /x86_64-linux/lts-8.18 /8.0.2/share/x86_64-linux-ghc-8.0.2/idris-1.0 /libs -v $PROJECT_ROOT :$PROJECT_ROOT -v $JAVA_HOME :/bin/jdk -v $HOME /bin/idris-jvm:/bin/idris-jvm -w ` pwd` mmhelloworld/idris:1.0 idris " $@ "
3
+ travis_long docker run -v $HOME /bin/idris-packages:/.stack-work/install /x86_64-linux/lts-9.1 /8.0.2/share/x86_64-linux-ghc-8.0.2/idris-1.1.1 /libs -v $PROJECT_ROOT :$PROJECT_ROOT -v $JAVA_HOME :/bin/jdk -v $HOME /bin/idris-jvm:/bin/idris-jvm -w ` pwd` mmhelloworld/idris:1.1.1 idris " $@ "
4
4
Original file line number Diff line number Diff line change @@ -271,6 +271,12 @@ cgOp2 (LSExt (ITFixed from) ITBig) [x] = signExtendToBigInteger x
271
271
272
272
cgOp2 (LSExt _ _ ) [x] = Aload $ locIndex x
273
273
274
+ cgOp2 (LTrunc ITNative (ITFixed IT64 )) [x] = do
275
+ Aload $ locIndex x
276
+ Checkcast " java/lang/Integer"
277
+ InvokeMethod InvokeVirtual " java/lang/Integer" " longValue" " ()J" False
278
+ boxLong
279
+
274
280
cgOp2 (LTrunc (ITFixed IT64 ) (ITFixed IT32 )) [x] = do
275
281
Aload $ locIndex x
276
282
Checkcast " java/lang/Long"
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import Effect.System
5
5
import Effect.StdIO
6
6
import IdrisJvm.IO
7
7
import IdrisJvm.System
8
+ import Java.Util.Concurrent
8
9
9
10
%access export
10
11
@@ -19,3 +20,6 @@ implementation Handler System JVM_IO where
19
20
handle () Time k = do x <- time; k x ()
20
21
handle () (GetEnv s) k = do x <- getEnv s; k x ()
21
22
handle () (CSystem s) k = do x <- system s; k x ()
23
+ handle () (Usleep timeout _ ) k = do
24
+ sleep microseconds $ prim__truncInt_B64 timeout
25
+ k () ()
Original file line number Diff line number Diff line change
1
+ module Java.Util.Concurrent
2
+
3
+ import IdrisJvm.FFI
4
+
5
+ %access public export
6
+
7
+ namespace TimeUnit
8
+ TimeUnitClass : JVM_NativeTy
9
+ TimeUnitClass = Class " java/util/concurrent/TimeUnit"
10
+
11
+ TimeUnit : Type
12
+ TimeUnit = JVM_Native TimeUnitClass
13
+
14
+ microseconds : TimeUnit
15
+ microseconds = unsafePerformIO $ getStaticField TimeUnitClass " MICROSECONDS" (JVM_IO TimeUnit )
16
+
17
+ sleep : TimeUnit -> Bits64 -> JVM_IO ()
18
+ sleep timeunit timeout = invokeInstance " sleep" (TimeUnit -> Bits64 -> JVM_IO () ) timeunit timeout
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ pkgs = effects
5
5
modules = IdrisJvm.FFI
6
6
, IdrisJvm.IO
7
7
, IdrisJvm.System
8
+ , Java.Util.Concurrent
8
9
, IdrisJvm.Effects
9
10
, Java.Lang
10
11
, Java.Util
You can’t perform that action at this time.
0 commit comments