rubyomr-preview / ruby

The Ruby+OMR Preview
Other
68 stars 9 forks source link

Print Intermediate Representation? #84

Open efferifick opened 7 years ago

efferifick commented 7 years ago

Hi,

is there a way to print the IR?

Thanks!

mgaudet commented 7 years ago

Yep. The most complete dump would be with (depending on how you are specifying the JIT option) -Xjit:tracefull,log=logname

You'll find a file in the current directory, suffixed with PID. If you have read my blog post about our JIT, some should be decipherable.

We need to work on a write up on 'how to read logs', but if you have specific questions, feel free to come back.

efferifick commented 7 years ago

Hi,

I am able to compile and install ruby

$ ruby --version
ruby 2.4.0p0 (2016-12-24 revision 57163) [x86_64-linux]
last_commit=Merge pull request #71 from mgaudet/updates

I am trying to print the intermediate representation.

If I do not use the just-in-time compiler, then the code is interpreted and understandably the output log is empty.

$ cat hello.rb
def hello()
  print("hello\n")
end
hello()

$ OMR_JIT_OPTIONS=tracefull,log=log.out ruby < hello.rb

If I use the just-in-time compiler, then the operation aborts.

$ OMR_JIT_OPTIONS=count=0,tracefull,log=log.out ruby < hello.rb

Do you know what could be the issue?

I am attaching the stderr.

hello.txt

Thanks!

mgaudet commented 7 years ago

Curious.

What operating system, compiler version did you use to build? Could you share your configure line as well?

(Don't have a linux box handy, but that command line worked on my Mac just dandy)

mgaudet commented 7 years ago

Actually, also, could I get you to open a separate issue for investigation w/ the info?