public final class CompilerSettings extends Object
LuaCompiler.
The settings are the following
CompilerSettings.CPUAccountingMode): controls whether and how
the functions generated by the compiler account for number of ticks spent in execution
and pause when their time slice has expired;true, constants are folded at compile
time (note that this does not have an influence on the number of ticks counted);true, boxed numeric constants are stored
as static fields rather than being instantiated (and boxed) at execution time;To obtain the settings with sensible defaults, use defaultSettings().
To obtain the default settings with CPU accounting disabled,
use defaultNoAccountingSettings().
| Modifier and Type | Class and Description |
|---|---|
static class |
CompilerSettings.CPUAccountingMode
CPU accounting mode.
|
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEFAULT_BYTE_STRING_MODE
The default byte string mode.
|
static boolean |
DEFAULT_CONST_CACHING_MODE
The default const caching mode.
|
static boolean |
DEFAULT_CONST_FOLDING_MODE
The default const folding mode.
|
static CompilerSettings.CPUAccountingMode |
DEFAULT_CPU_ACCOUNTING_MODE
The default CPU accounting mode.
|
static int |
DEFAULT_NODE_SIZE_LIMIT
The default method size limit.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
byteStrings() |
boolean |
constCaching()
Returns the const caching mode.
|
boolean |
constFolding()
Returns the const folding mode.
|
CompilerSettings.CPUAccountingMode |
cpuAccountingMode()
Returns the CPU accounting mode.
|
static CompilerSettings |
defaultNoAccountingSettings()
Returns the default compiler settings without CPU accounting.
|
static CompilerSettings |
defaultSettings()
Returns the default compiler settings.
|
boolean |
equals(Object o) |
int |
hashCode() |
int |
nodeSizeLimit()
Returns the node size limit.
|
static CompilerSettings |
of(CompilerSettings.CPUAccountingMode cpuAccountingMode,
boolean constFolding,
boolean constCaching,
boolean byteStrings,
int nodeSizeLimit)
Returns the compiler settings with the given parameters.
|
CompilerSettings |
withByteStrings(boolean mode)
Returns compiler settings derived from this compiler settings by updating
the byte string mode to
mode. |
CompilerSettings |
withConstCaching(boolean mode)
Returns compiler settings derived from this compiler settings by updating
the const caching mode to
mode. |
CompilerSettings |
withConstFolding(boolean mode)
Returns compiler settings derived from this compiler settings by updating
the const folding mode to
mode. |
CompilerSettings |
withCPUAccountingMode(CompilerSettings.CPUAccountingMode mode)
Returns compiler settings derived from this compiler settings by updating
the CPU accounting mode to
mode. |
CompilerSettings |
withNodeSizeLimit(int limit)
Returns compiler settings derived from this compiler settings by updating
the node size limit to
limit. |
public static final CompilerSettings.CPUAccountingMode DEFAULT_CPU_ACCOUNTING_MODE
public static final boolean DEFAULT_CONST_FOLDING_MODE
public static final boolean DEFAULT_CONST_CACHING_MODE
public static final boolean DEFAULT_BYTE_STRING_MODE
public static final int DEFAULT_NODE_SIZE_LIMIT
public static CompilerSettings of(CompilerSettings.CPUAccountingMode cpuAccountingMode, boolean constFolding, boolean constCaching, boolean byteStrings, int nodeSizeLimit)
When nodeSizeLimit is non-positive, no chunking of the body method
will be performed.
cpuAccountingMode - CPU accounting mode, must not be nullconstFolding - const folding modeconstCaching - const caching modebyteStrings - byte string modenodeSizeLimit - node size limitNullPointerException - if cpuAccountingMode is nullpublic static CompilerSettings defaultSettings()
public static CompilerSettings defaultNoAccountingSettings()
public CompilerSettings.CPUAccountingMode cpuAccountingMode()
public boolean constFolding()
public boolean constCaching()
public boolean byteStrings()
public int nodeSizeLimit()
public CompilerSettings withCPUAccountingMode(CompilerSettings.CPUAccountingMode mode)
mode.mode - new CPU accounting mode, must not be nullthis by updating the CPU accounting mode
to modeNullPointerException - if mode is nullpublic CompilerSettings withConstFolding(boolean mode)
mode.mode - new const folding modethis by updating the const folding mode
to modepublic CompilerSettings withConstCaching(boolean mode)
mode.mode - new const caching modethis by updating the const caching mode
to modepublic CompilerSettings withByteStrings(boolean mode)
mode.mode - new byte string modethis by updating the byte string mode to modepublic CompilerSettings withNodeSizeLimit(int limit)
limit.limit - new node size limitthis by updating the node size limit
to limitCopyright © 2016–2017. All rights reserved.