projects
/
mate.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
experiments with JNI;
[mate.git]
/
Mate
/
MethodPool.hs
diff --git
a/Mate/MethodPool.hs
b/Mate/MethodPool.hs
index da3e5e055808de09698423cc8173a4d3929178aa..4be3cf2577a7764660e59c19b1a55d01c33c6c1a 100644
(file)
--- a/
Mate/MethodPool.hs
+++ b/
Mate/MethodPool.hs
@@
-32,7
+32,7
@@
import Mate.NativeMachine
import Mate.ClassPool
import Mate.Debug
import Mate.Utilities
import Mate.ClassPool
import Mate.Debug
import Mate.Utilities
-import Mate.
GarbageAlloc
+import Mate.
Rts()
foreign import ccall "dynamic"
code_void :: FunPtr (IO ()) -> IO ()
foreign import ccall "dynamic"
code_void :: FunPtr (IO ()) -> IO ()
@@
-43,6
+43,9
@@
foreign import ccall "&demoInterfaceCall"
foreign import ccall "&printMemoryUsage"
printMemoryUsageAddr :: FunPtr (IO ())
foreign import ccall "&printMemoryUsage"
printMemoryUsageAddr :: FunPtr (IO ())
+foreign import ccall "&loadLibrary"
+ loadLibraryAddr :: FunPtr (IO ())
+
getMethodEntry :: CPtrdiff -> CPtrdiff -> IO CPtrdiff
getMethodEntry signal_from methodtable = do
mmap <- getMethodMap
getMethodEntry :: CPtrdiff -> CPtrdiff -> IO CPtrdiff
getMethodEntry signal_from methodtable = do
mmap <- getMethodMap
@@
-74,6
+77,8
@@
getMethodEntry signal_from methodtable = do
let scm = toString cm; smethod = toString method
if scm == "jmate/lang/MateRuntime" then do
case smethod of
let scm = toString cm; smethod = toString method
if scm == "jmate/lang/MateRuntime" then do
case smethod of
+ "loadLibrary" ->
+ return . funPtrToAddr $ loadLibraryAddr
"demoInterfaceCall" ->
return . funPtrToAddr $ demoInterfaceCallAddr
"printMemoryUsage" ->
"demoInterfaceCall" ->
return . funPtrToAddr $ demoInterfaceCallAddr
"printMemoryUsage" ->