Skip to content

Commit

Permalink
Fix block jitting by forcing full build before checking protocol.
Browse files Browse the repository at this point in the history
Fixes #3626.

I added code before 9.0.5.0 to ensure we only compiled blocks that
had full block protocol, since I don't want the JIT paths to have
by-hand protocol logic (interferes with call sites and indy opto.)
Unfortunately I checked the call protocol flag without forcing a
full build, so it was always false, so 9.0.5.0 was not ever
jitting blocks.

This fix forces a full JIT build of IR before checking for call
protocol on blocks.

This check may be unnecessary, if we *always* apply call protocol
to blocks now. I did not check whether that might be true, and
the only down side to this change is that more IR work happens
in the synchronous call thread, and if the build fails due to an
error it will be more fatal.
headius committed Mar 7, 2016
1 parent fab4f02 commit b41a66a
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -164,8 +164,15 @@ protected void promoteToFullBuild(ThreadContext context) {
if (context.runtime.isBooting()) return; // don't JIT during runtime boot

if (callCount >= 0) {
// ensure we've got code ready for JIT
ensureInstrsReady();
closure.prepareForCompilation();

// if we don't have an explicit protocol, disable JIT
if (!closure.hasExplicitCallProtocol()) {
if (Options.JIT_LOGGING.load()) {
LOG.info("JIT failed; no protocol found in block: " + closure);
}
callCount = -1;
return;
}

0 comments on commit b41a66a

Please sign in to comment.