Closed marcosscriven closed 7 years ago
Ah, this is easy to solve. Constants should have a space preceding them in the emitted code.
I will try to locate the opcode that causes this.. but a test-case would help fix and validate faster.
Thanks @hrj - all I know is it's somewhere in the execution of code in a third-party jar.
If you can briefly describe how I find out what class/method is running at the time, I could probably decompile it and create a test case.
The emitted code is for the tableswitch opcode (which doesn't have a unit-test I think). I have pushed a tentative fix to this branch. Can you try it @marcosscriven ?
To figure out the source of error, on CLI you can add the -XX:+PrintCompilation
flag.
In the library, you can call JVM.setPrintJITCompilation(true)
and use the dev build.
Hi @hrj - that worked thanks. 🏆
Incidentally I tried -XX:+PrintCompilation
, but didn't seem to have any effect. I deliberately misspelt it too as a sanity check, and it's definitely being picked up (complains of no such option if I misspell it).
I've got stdout
and stderr
correctly piping to the console, so not sure what the issue there is.
@marcosscriven I believe that flag only works in development or fast-development builds. I'll open an issue, since we shouldn't list flags that aren't operational in a build.
Running Doppio from build off master, I got an
Unexpected Integer
Javascript error in Chrome.It appears to be in this emitted function:
Which formatted looks like:
Making it clearer the double-minus in the
readInt32BE(...)
args is the issue.I searched for when
f.opStack.pop()
first appeared, and found this commit by @hrj : https://github.com/plasma-umass/doppio/commit/4cf67d724547c0e9c2afe72f0781a98ac6cbdd85Running against the parent of that fixes the issue.
Unfortunately the code in question is third party, so I can't easily provide a test case, but do let me know if there's any further debug info I can provide.