Browse thread
[Caml-list] calling native code from bytecode?
-
Chris Hecker
-
Xavier Leroy
-
Chris Hecker
-
Xavier Leroy
- Chris Hecker
- Florian Hars
- Fabrice Le Fessant
-
Xavier Leroy
-
Chris Hecker
-
Xavier Leroy
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Fabrice Le Fessant <fabrice.le_fessant@i...> |
| Subject: | Re: [Caml-list] calling native code from bytecode? |
A few years ago :), I implemented the mixing of bytecode and native code in JoCaml. The bytecode interpreter included in native code runtimes was modified so that bytecode functions were wrapped inside native code functions, using a special tag. This tag was checked before executing a closure, to either call a wrapper for real native code functions, or to find the bytecode pointer in the closure for bytecode functions. In native code, calling directly the wrapped function started a new interpreter to execute its bytecode. For exceptions, a flag is used to know whether the first exception handler is executing native code or bytecode. Depending on this flag, the exception is raised in bytecode or native style. I did not measure the cost of this, but I noticed a slowdown. I don't know if there is a better solution. One of my (unfortunately long list of) projects is to improve asmdynlink to produce JIT native code for bytecode ... maybe next year ! - Fabrice ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr