← Back to team overview

lightspark-users team mailing list archive

New bytecode rewriter pushed in master


Hi everyone,

I've pushed upstream the results of a few days of work on a bytecode
optimizer/rewriter for lightspark. The idea is to get mildy "hot" (i.e.
frequently executed) methods to execute faster without using the whole
LLVM machinery which gets convenient only for very "hot" ones.

The code is divided mainly into two files:

src/scripting/abc_optimizer.cpp: Contains the optimizer that rewrites
the code while unpacking integers. Moreover, the control flow of the
code is analyzed and all branch are checked for correctness.

src/scripting/abc_fast_interpreter.cpp: Contains the interpreter for the
optimized/decompressed code. Since the control flow is guaranteed to be
corrected all branch checks can be avoided.

In the future more optimizations are possible, the most important of
them is probably resolving early the getLex lookups. Type inference may
also be used to improve the generic add opcode to add_i.