How can I retrieve target-level language's bytecode in functions of JitHookInterface?

Hi all, My name is Ruochen Huang, I’m developing an Erlang bytecode virtual machine called Pyrlang. Recently I’m trying to apply a new tracing JIT policy to Pyrlang, I found there are some traces that were too long and therefore aborted by JIT according to rpython’s JIT log. In order to find those ‘too long’ traces in my benchmark programs, I’m trying to implement the JitHookInterface in rpython, and rewrite the on_abort function there. However, until now I can only print out the rpython level bytecode instructions from the ‘operations’ arguments, but what I want are the target language (e.g., Erlang in my project) bytecode instructions. Could somebody tell me that is it possible to retrieve it by calling some rpython API? Best Regards, Ruochen Huang Tokyo Institute of Technology

Hi Ruochen, On 5 May 2016 at 08:17, 黄若尘 <hrc706@gmail.com> wrote:
Recently I’m trying to apply a new tracing JIT policy to Pyrlang, I found there are some traces that were too long and therefore aborted by JIT according to rpython’s JIT log.
You can find them without using JitHookInterface: jitdriver = JitDriver(..., get_printable_location=get_printable_location) Then get_printable_location() should translate the greenkey into a human-readable string that describes the location. Once this is done, you can usually figure out why some specific traces are too long by looking at the PYPYLOG output: PYPYLOG=jit:log pyrlang-c args... This produces a file called "log" where the output of `get_printable_location()` is found in the `debug_merge_point` intructions, so that you should be able to follow it (even it is a bit large). A bientôt, Armin.
participants (2)
-
Armin Rigo
-
黄若尘