Skip to content

Commit

Permalink
lj_record.c: Record IFUNC/IFUNCV the same as FUNC/FUNCV
Browse files Browse the repository at this point in the history
Record calls to blacklisted functions the same way as calls to
uncompiled functions. This allows for the possibility that a
blacklisted function can be successfully recorded as part of a larger
trace.

If the function truly cannot be compiled into other traces then it
will continue to abort and lead to more blacklistings, at the cost of
some extra "due diligence" by the JIT to avoid false-negatives. This
is perfectly in line with the RaptorJIT goal of blacklisting code
conservatively and taking pains to find successful traces.

This change does not affect the treatment blacklisted loops. Those may
or may not deserve further consideration.

Resolves raptorjit/raptorjit#119.
  • Loading branch information
lukego committed Nov 8, 2017
1 parent c83fd4c commit f5d810e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lj_record.c
Original file line number Diff line number Diff line change
Expand Up @@ -2284,8 +2284,6 @@ void lj_record_ins(jit_State *J)
case BC_IFORL:
case BC_IITERL:
case BC_ILOOP:
case BC_IFUNCF:
case BC_IFUNCV:
lj_trace_err(J, LJ_TRERR_BLACKL);
break;

Expand All @@ -2297,13 +2295,15 @@ void lj_record_ins(jit_State *J)
/* -- Function headers -------------------------------------------------- */

case BC_FUNCF:
case BC_IFUNCF:
rec_func_lua(J);
break;
case BC_JFUNCF:
rec_func_jit(J, rc);
break;

case BC_FUNCV:
case BC_IFUNCV:
rec_func_vararg(J);
rec_func_lua(J);
break;
Expand Down

0 comments on commit f5d810e

Please sign in to comment.