OptimizationLevel

enum OptimizationLevel : Enum<OptimizationLevel>

OptimizationLevel is an enum class indicating the possible degrees of optimization effort. These are arranged approximately monotonically increasing in terms of both cost to generate and expected performance improvement.

Entries

Link copied to clipboard
CHASED_BLOCKS(Long.MAX_VALUE)

Unimplemented. The idea is that at this level some inlining of non-primitives will take place, emphasizing inlining of function application. Invocations of methods that take a literal function should tend very strongly to get inlined, as the potential to turn things like continuation-based conditionals and loops into mere jumps is expected to be highly profitable.

Link copied to clipboard
SECOND_JVM_TRANSLATION(Long.MAX_VALUE)

The initial translation into Level Two instructions customized to a particular raw function. This at least should avoid the cost of fetching nybblecodes. It also avoids looking up monomorphic methods at execution time, and can inline or even fold calls to suitable primitives. The inlined calls to infallible primitives are simpler than the calls to fallible ones or non-primitives or polymorphic methods. Inlined primitive attempts avoid having to reify the calling continuation in the case that they're successful, but have to reify if the primitive fails.

Link copied to clipboard

The initial translation into Level Two instructions customized to a particular raw function. This at least should avoid the cost of fetching nybblecodes. It also avoids looking up monomorphic methods at execution time, and can inline or even fold calls to suitable primitives. The inlined calls to infallible primitives are simpler than the calls to fallible ones or non-primitives or polymorphic methods. Inlined primitive attempts avoid having to reify the calling continuation in the case that they're successful, but have to reify if the primitive fails.

Link copied to clipboard

Translate the nybblecodes quickly into an L2SimpleChunk.

Link copied to clipboard

Unoptimized code, interpreted via Level One machinery. Technically the current implementation only executes Level Two code, but the default Level Two chunk relies on a Level Two instruction that simply fetches each nybblecode and interprets it.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract fun optimize(code: A_RawFunction, interpreter: Interpreter)

Perform this level of optimization on the given A_RawFunction.

Properties

Link copied to clipboard
val countdown: Long

The value to use for the countdown after the translation at this level has taken place (i.e., how many calls to endure before the next level of optimization is attempted).

Link copied to clipboard
val name: String
Link copied to clipboard
val ordinal: Int