Stay organized with collections
Save and categorize content based on your preferences.
Compiler
class Compiler
Does nothing on Android.
Summary
Public methods |
static Any! |
Executes an operation according to the specified command object.
|
static Boolean |
Compiles the specified class using the JIT compiler and indicates if compilation has been successful.
|
static Boolean |
Compiles all classes whose name matches the specified name using the JIT compiler and indicates if compilation has been successful.
|
static Unit |
Disables the JIT compiler.
|
static Unit |
Enables the JIT compiler.
|
Public methods
command
static fun command(cmd: Any!): Any!
Executes an operation according to the specified command object. This method is the low-level interface to the JIT compiler. It may return any object or null
if no JIT compiler is available. Returns null on Android, whether or not the system has a JIT.
Parameters |
cmd |
Any!: the command object for the JIT compiler. |
Return |
Any! |
the result of executing command or null . |
compileClass
static fun compileClass(classToCompile: Class<*>!): Boolean
Compiles the specified class using the JIT compiler and indicates if compilation has been successful. Does nothing and returns false on Android.
Parameters |
classToCompile |
Class<*>!: java.lang.Class the class to JIT compile |
Return |
Boolean |
true if the compilation has been successful; false if it has failed or if there is no JIT compiler available. |
compileClasses
static fun compileClasses(nameRoot: String!): Boolean
Compiles all classes whose name matches the specified name using the JIT compiler and indicates if compilation has been successful. Does nothing and returns false on Android.
Parameters |
nameRoot |
String!: the string to match class names with. |
Return |
Boolean |
true if the compilation has been successful; false if it has failed or if there is no JIT compiler available. |
disable
static fun disable(): Unit
Disables the JIT compiler. Does nothing on Android.
enable
static fun enable(): Unit
Enables the JIT compiler. Does nothing on Android.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# Compiler\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nCompiler\n========\n\n```\nclass Compiler\n```\n\n|---|-------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [java.lang.Compiler](#) |\n\nDoes nothing on Android.\n\nSummary\n-------\n\n| Public methods ||\n|-------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)! | [command](#command(kotlin.Any))`(`cmd:` `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)!`)` Executes an operation according to the specified command object. |\n| static [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [compileClass](#compileClass(java.lang.Class))`(`classToCompile:` `[Class](/reference/kotlin/java/lang/Class)\u003c*\u003e!`)` Compiles the specified class using the JIT compiler and indicates if compilation has been successful. |\n| static [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [compileClasses](#compileClasses(kotlin.String))`(`nameRoot:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Compiles all classes whose name matches the specified name using the JIT compiler and indicates if compilation has been successful. |\n| static [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [disable](#disable())`()` Disables the JIT compiler. |\n| static [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [enable](#enable())`()` Enables the JIT compiler. |\n\nPublic methods\n--------------\n\n### command\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic fun command(cmd: Any!): Any!\n```\n\nExecutes an operation according to the specified command object. This method is the low-level interface to the JIT compiler. It may return any object or `null` if no JIT compiler is available. Returns null on Android, whether or not the system has a JIT.\n\n| Parameters ||\n|-------|-----------------------------------------------------------------------------------------------------------------------|\n| `cmd` | [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)!: the command object for the JIT compiler. |\n\n| Return ||\n|-----------------------------------------------------------------------------|--------------------------------------------|\n| [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)! | the result of executing command or `null`. |\n\n### compileClass\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic fun compileClass(classToCompile: Class\u003c*\u003e!): Boolean\n```\n\nCompiles the specified class using the JIT compiler and indicates if compilation has been successful. Does nothing and returns false on Android.\n\n| Parameters ||\n|------------------|---------------------------------------------------------------------------------------------|\n| `classToCompile` | [Class](/reference/kotlin/java/lang/Class)\\\u003c\\*\\\u003e!: java.lang.Class the class to JIT compile |\n\n| Return ||\n|------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `true` if the compilation has been successful; `false` if it has failed or if there is no JIT compiler available. |\n\n### compileClasses\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic fun compileClasses(nameRoot: String!): Boolean\n```\n\nCompiles all classes whose name matches the specified name using the JIT compiler and indicates if compilation has been successful. Does nothing and returns false on Android.\n\n| Parameters ||\n|------------|--------------------------------------------------------------------------------------------------------------------------|\n| `nameRoot` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: the string to match class names with. |\n\n| Return ||\n|------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `true` if the compilation has been successful; `false` if it has failed or if there is no JIT compiler available. |\n\n### disable\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic fun disable(): Unit\n```\n\nDisables the JIT compiler. Does nothing on Android. \n\n### enable\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic fun enable(): Unit\n```\n\nEnables the JIT compiler. Does nothing on Android."]]