diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index ebea63c6..6a7c7713 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -4,6 +4,8 @@ on: push: paths-ignore: - '**.md' + branches: + - main pull_request: paths-ignore: - '**.md' @@ -25,9 +27,19 @@ jobs: with: java-version: ${{ matrix.java }} distribution: zulu + - name: Set up GraalVM + uses: graalvm/setup-graalvm@v1 + with: + java-version: '25.0.1' + distribution: 'graalvm' + github-token: ${{ secrets.GITHUB_TOKEN }} + set-java-home: 'false' + native-image-job-reports: 'true' - name: Build ktfmt_idea_plugin run: ./gradlew :idea_plugin:build --stacktrace --no-daemon - name: Build the Online Formatter run: ./gradlew :lambda:build --stacktrace --no-daemon - name: Build ktfmt run: ./gradlew :ktfmt:build --stacktrace --no-daemon + - name: Build Native Image + run: ./gradlew :ktfmt:nativeCompile --stacktrace --no-daemon && ./ktfmt/build/native/nativeCompile/ktfmt --version diff --git a/.gitignore b/.gitignore index 5099988d..f58130ea 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,7 @@ release-ktfmt-website/ .gradle **/build/ !src/**/build/ + +# Native Image profiles are large +core/src/main/native-image/profiles/*.iprof + diff --git a/build.gradle.kts b/build.gradle.kts index 0b5e58cb..edd6cfd6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -21,6 +21,7 @@ plugins { alias(libs.plugins.ktfmt) apply false alias(libs.plugins.nexusPublish) alias(libs.plugins.shadowJar) apply false + alias(libs.plugins.graalvm) apply false } version = providers.gradleProperty("ktfmt.version").get() diff --git a/core/build.gradle.kts b/core/build.gradle.kts index bbef2ba7..a43734f3 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -14,6 +14,7 @@ * limitations under the License. */ +import java.nio.file.Paths import kotlin.io.path.writeText import org.jetbrains.intellij.platform.gradle.utils.asPath @@ -22,15 +23,28 @@ plugins { id("com.gradleup.shadow") id("com.ncorti.ktfmt.gradle") id("maven-publish") + id("org.graalvm.buildtools.native") id("org.jetbrains.dokka") id("signing") + application } +val entrypoint = "com.facebook.ktfmt.cli.Main" + +application { mainClass = entrypoint } + repositories { mavenLocal() mavenCentral() } +// Configuration for building `src/native-image/java`. +val nativeImageJavacClasspath by + configurations.creating { + extendsFrom(configurations.implementation.get()) + isCanBeResolved = true + } + dependencies { api(libs.googleJavaformat) api(libs.guava) @@ -40,6 +54,12 @@ dependencies { api(libs.kotlin.compilerEmbeddable) testImplementation(libs.googleTruth) testImplementation(libs.junit) + + nativeImageJavacClasspath(libs.graalvm.nativeimage) + nativeImageClasspath(libs.jline.terminal) + nativeImageClasspath(libs.jline.terminal.jansi) + nativeImageClasspath(libs.jline.terminal.jna) + nativeImageClasspath(libs.jline.terminal.jni) } val generateSources by @@ -116,6 +136,36 @@ tasks { } } +sourceSets { + create("nativeImage") { + java { srcDir("src/main/native-image/java") } + resources { srcDir("src/main/native-image/resources") } + } +} + +val compileNativeImageClasses by + tasks.registering(JavaCompile::class) { + group = "build" + description = "Compiles Native Image helper classes" + source = sourceSets["nativeImage"].java + classpath = nativeImageJavacClasspath + destinationDirectory = layout.buildDirectory.dir("classes/native-image") + dependsOn(tasks.named("compileJava")) + } + +// Native Image artifacts jar (local only, not published) +val nativeImageJar by + tasks.registering(Jar::class) { + group = "build" + description = "Assembles Native Image jar and resources" + dependsOn(compileNativeImageClasses) + from(layout.buildDirectory.dir("classes/native-image")) + from(sourceSets["nativeImage"].resources) + archiveClassifier = "nativeimage" + } + +tasks.nativeCompile.configure { dependsOn(compileNativeImageClasses, nativeImageJar) } + kotlin { val javaVersion: String = rootProject.libs.versions.java.get() jvmToolchain(javaVersion.toInt()) @@ -136,6 +186,181 @@ ktfmt { ) } +object DefaultArchitectureTarget { + val amd64 = "x86-64-v4" + val arm64 = "armv8.4-a+crypto+sve" +} + +// Pass `-Pktfmt.native.release=true` to enable release mode for Native Image. +val nativeRelease = findProperty("ktfmt.native.release") == "true" + +// Pass `-Pktfmt.native.target=xx` to pass `-march=xx` to Native Image. +val nativeTarget = + findProperty("ktfmt.native.target") + ?: when (val hostArch = System.getProperty("os.arch")) { + "amd64", + "x86_64" -> DefaultArchitectureTarget.amd64 + "aarch64", + "arm64" -> DefaultArchitectureTarget.arm64 + else -> error("Unrecognized host architecture: '$hostArch'") + } + +// Pass `-Pktfmt.native.gc=xx` to select a garbage collector; options include `serial`, `G1`, and +// `epsilon`. +val nativeGc = findProperty("ktfmt.native.gc") ?: "G1" + +// Pass `-Pktfmt.native.gc=xx` to select a garbage collector; options include `serial`, `G1`, and +// `epsilon`. +val nativeDebug = findProperty("ktfmt.native.debug") == "true" + +// Pass `-Pktfmt.native.lto=true` to enable LTO for the Native Image binary. +val enableLto = findProperty("ktfmt.native.lto") == "true" + +// Pass `-Pktfmt.native.muslHome=xx` or set MUSL_HOME to point to the Musl sysroot when building for +// Musl Libc. +val muslSysroot = (findProperty("ktfmt.native.muslHome") ?: System.getenv("MUSL_HOME"))?.toString() + +// Pass `-Pktfmt.native.musl=true` to build a fully-static binary against Musl Libc. +val preferMusl = + (findProperty("ktfmt.native.musl") == "true").also { preferMusl -> + require(!preferMusl || muslSysroot != null) { + "When `ktfmt.native.musl` is true, -Pktfmt.native.muslHome or MUSL_HOME must be set to the Musl sysroot. " + + "See https://www.graalvm.org/latest/reference-manual/native-image/guides/build-static-executables/" + } + } + +// Pass `-Pktfmt.native.smol=true` to build a small, instead of a fast, binary. +val preferSmol = (findProperty("ktfmt.native.smol") == "true") + +// Pass `-Pktfmt.native.opt=s` to pass e.g. `-Os` to Native Image. +val nativeOpt = + when (val opt = findProperty("ktfmt.native.opt")) { + null -> + when { + preferSmol -> "s" + nativeRelease -> "3" + else -> "b" // prefer build speed + } + else -> opt + } + +// List of PGO profiles, which are held in `src/main/native-image/profiles`. +val pgoProfiles = + listOf("default.iprof") + .map { profileName -> + layout.projectDirectory.file( + Paths.get("src", "main", "native-image", "profiles", profileName).toString() + ) + } + .let { allProfiles -> listOf("--pgo=${allProfiles.joinToString(",")}") } + +// Pass `-Pktfmt.native.pgo=true` to build with PGO; pass `train` to enable instrumentation. +val pgoArgs = + when (val pgo = findProperty("ktfmt.native.pgo")) { + null -> if (nativeRelease) pgoProfiles else emptyList() + "true" -> pgoProfiles + "false" -> emptyList() + "train" -> listOf("--pgo-instrument") + else -> error("Unrecognized `ktfmt.native.pgo` argument: '$pgo'") + } + +graalvmNative { + binaries { + named("main") { + imageName = "ktfmt" + mainClass = entrypoint + classpath = + files( + nativeImageJar.get().archiveFile, + tasks.jar.get().archiveFile, + configurations["compileClasspath"], + configurations["runtimeClasspath"], + configurations["nativeImageClasspath"], + ) + + buildArgs( + buildList { + // If PGO flags are present, add them first; if not, add `-Ox`. + when (pgoArgs.isEmpty()) { + true -> add("-O$nativeOpt") + false -> addAll(pgoArgs) + } + + // Common flags for Native Image. + addAll( + buildList { + add("-march=$nativeTarget") + if (nativeDebug) { + add("-g") + add("-H:+SourceLevelDebug") + } + // -- + add("--gc=G1") + add("--future-defaults=all") + add("--link-at-build-time=com.facebook") + add("--initialize-at-build-time=com.facebook") + add("--add-opens=java.base/java.util=ALL-UNNAMED") + add("--emit=build-report") + add("--color=always") + add("--enable-sbom=cyclonedx,embed") + // -- ▼ SVM Hosted Options + add("-H:+UseCompressedReferences") + add("-H:+ReportExceptionStackTraces") + // -- ▼ SVM Runtime Options + add("-R:+InstallSegfaultHandler") + // -- ▼ Experimental Options + add("-H:+UnlockExperimentalVMOptions") + add("-H:-ReduceImplicitExceptionStackTraceInformation") + add("-H:+ReportDynamicAccess") + add("-H:-UnlockExperimentalVMOptions") + // -- ▼ VM flags + add("-J--enable-native-access=ALL-UNNAMED") + add("-J--illegal-native-access=allow") + add("-J--sun-misc-unsafe-memory-access=allow") + // -- ▼ C Compiler / Linker Flags + if (enableLto) { + add("--native-compiler-options=-flto") + add("-H:NativeLinkerOption=-flto") + } + if (preferMusl) { + add("-H:NativeLinkerOption=-L${muslSysroot}/lib") + } + } + ) + + // Mark what should be initialized at build-time, i.e. persisted to the heap image. + // See `src/main/native-image/initialize-at-build-time.txt` for a list of such classes. + addLinesFromFile("src", "main", "native-image", "initialize-at-build-time.txt") { + "--initialize-at-build-time=$it" + } + + // Still other classes must be initialized at runtime only. + // See `src/main/native-image/initialize-at-run-time.txt` for a list of such classes. + addLinesFromFile("src", "main", "native-image", "initialize-at-run-time.txt") { + "--initialize-at-run-time=$it" + } + + // Here, we prefer static linking, for startup performance and release simplicity. + // On Linux amd64, we target musl to avoid linking conflicts with older glibc. + // On macOS, pass `--static-nolibc` for the closest option available. + when (System.getProperty("os.name")) { + "Linux" -> + when (System.getProperty("os.arch")) { + "amd64" -> + when (preferMusl) { + true -> addAll(listOf("--static", "--libc=musl", "-H:+StaticLibStdCpp")) + false -> add("--static-nolibc") + } + else -> add("--static-nolibc") + } + "Mac OS X" -> add("--static-nolibc") + } + } + ) + } + } +} + group = "com.facebook" version = rootProject.version @@ -180,3 +405,17 @@ if (System.getenv("SIGN_BUILD") != null) { sign(publishing.publications["maven"]) } } + +fun MutableList.addLinesFromFile(vararg path: String, mapper: (String) -> String) { + file(Paths.get(path.first(), *path.drop(1).toTypedArray()).toString()) + .useLines { lines -> + lines + .filter { line -> + // filter empty lines + line.isNotEmpty() + } + .map(mapper) + .toList() + } + .also { addAll(it) } +} diff --git a/core/src/main/java/com/facebook/ktfmt/format/Parser.kt b/core/src/main/java/com/facebook/ktfmt/format/Parser.kt index e28e736a..3749966d 100644 --- a/core/src/main/java/com/facebook/ktfmt/format/Parser.kt +++ b/core/src/main/java/com/facebook/ktfmt/format/Parser.kt @@ -43,9 +43,7 @@ object Parser { * from [KotlinCoreEnvironment.createForProduction]: * https://github.com/JetBrains/kotlin/blob/master/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinCoreEnvironment.kt#L544 */ - val env: KotlinCoreEnvironment - - init { + val env: KotlinCoreEnvironment by lazy { // To hide annoying warning on Windows System.setProperty("idea.use.native.fs.for.win", "false") val disposable = Disposer.newDisposable() @@ -54,12 +52,11 @@ object Parser { CommonConfigurationKeys.MESSAGE_COLLECTOR_KEY, PrintingMessageCollector(System.err, PLAIN_RELATIVE_PATHS, false), ) - env = - KotlinCoreEnvironment.createForProduction( - disposable, - configuration, - EnvironmentConfigFiles.JVM_CONFIG_FILES, - ) + KotlinCoreEnvironment.createForProduction( + disposable, + configuration, + EnvironmentConfigFiles.JVM_CONFIG_FILES, + ) } fun parse(code: String): KtFile { diff --git a/core/src/main/native-image/initialize-at-build-time.txt b/core/src/main/native-image/initialize-at-build-time.txt new file mode 100644 index 00000000..5430783d --- /dev/null +++ b/core/src/main/native-image/initialize-at-build-time.txt @@ -0,0 +1,8 @@ +com.google.common.collect.SingletonImmutableList +kotlin.Function +kotlin.KotlinVersion +kotlin.SynchronizedLazyImpl +kotlin.UNINITIALIZED_VALUE +kotlin.collections.EmptyMap +kotlin.jvm.functions.Function1 +kotlin.text.Regex diff --git a/core/src/main/native-image/initialize-at-run-time.txt b/core/src/main/native-image/initialize-at-run-time.txt new file mode 100644 index 00000000..5b08f560 --- /dev/null +++ b/core/src/main/native-image/initialize-at-run-time.txt @@ -0,0 +1,7 @@ +kotlin.random.AbstractPlatformRandom +kotlin.random.Random +kotlin.random.Random$Default +kotlin.random.RandomKt +kotlin.random.XorWowRandom +kotlin.random.jdk8.PlatformThreadLocalRandom +kotlin.uuid.SecureRandomHolder diff --git a/core/src/main/native-image/java/com/facebook/ktfmt/nativeImage/KotlinCoreEnvironmentCompanion.java b/core/src/main/native-image/java/com/facebook/ktfmt/nativeImage/KotlinCoreEnvironmentCompanion.java new file mode 100644 index 00000000..448d713b --- /dev/null +++ b/core/src/main/native-image/java/com/facebook/ktfmt/nativeImage/KotlinCoreEnvironmentCompanion.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.facebook.ktfmt.nativeImage; + +import com.oracle.svm.core.annotate.Substitute; +import com.oracle.svm.core.annotate.TargetClass; +import com.oracle.svm.core.annotate.TargetElement; +import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment; +import org.jetbrains.kotlin.config.CompilerConfiguration; + +@SuppressWarnings({"unused"}) +@TargetClass(KotlinCoreEnvironment.Companion.class) +final class KotlinCoreEnvironmentCompanion { + @Substitute + @TargetElement(name = "registerApplicationExtensionPointsAndExtensionsFrom") + private void stubbedRegisterApplicationExtensionPointsAndExtensionsFrom( + CompilerConfiguration configuration, String configFilePath) { + // Nothing at this time. + } +} diff --git a/core/src/main/native-image/profiles/README.md b/core/src/main/native-image/profiles/README.md new file mode 100644 index 00000000..92a43e97 --- /dev/null +++ b/core/src/main/native-image/profiles/README.md @@ -0,0 +1,5 @@ + +### PGO Profiles + +Run `pgo_train.sh` to generate `default.iprof` in this folder. Then, it will be used when `-Pktfmt.native.pgo=true` is passed to `./gradlew :ktfmt:nativeCompile`. + diff --git a/core/src/main/native-image/resources/META-INF/native-image/com/facebook/ktfmt/proxy-config.json b/core/src/main/native-image/resources/META-INF/native-image/com/facebook/ktfmt/proxy-config.json new file mode 100644 index 00000000..db7f973a --- /dev/null +++ b/core/src/main/native-image/resources/META-INF/native-image/com/facebook/ktfmt/proxy-config.json @@ -0,0 +1,17 @@ +[ + { + "interfaces": [ + "org.jetbrains.kotlin.com.intellij.openapi.command.CommandListener" + ] + }, + { + "interfaces": [ + "org.jetbrains.kotlin.com.intellij.openapi.vfs.VirtualFileListener" + ] + }, + { + "interfaces": [ + "org.jetbrains.kotlin.com.intellij.psi.util.PsiModificationTracker$Listener" + ] + } +] diff --git a/core/src/main/native-image/resources/META-INF/native-image/com/facebook/ktfmt/reachability-metadata.json b/core/src/main/native-image/resources/META-INF/native-image/com/facebook/ktfmt/reachability-metadata.json new file mode 100644 index 00000000..4c0f3e39 --- /dev/null +++ b/core/src/main/native-image/resources/META-INF/native-image/com/facebook/ktfmt/reachability-metadata.json @@ -0,0 +1,2166 @@ +{ + "reflection": [ + { + "type": "org.jetbrains.kotlin.cli.common.CompilerSystemProperties" + }, + { + "type": { + "proxy": [ + "org.jetbrains.kotlin.com.intellij.openapi.vfs.VirtualFileListener" + ] + } + }, + { + "type": "java.util.concurrent.ForkJoinTask", + "fields": [ + { + "name": "aux" + }, + { + "name": "status" + } + ] + }, + { + "type": "java.util.concurrent.atomic.AtomicBoolean", + "fields": [ + { + "name": "value" + } + ] + }, + { + "type": "java.util.concurrent.atomic.AtomicReference", + "fields": [ + { + "name": "value" + } + ] + }, + { + "type": "kotlin.SafePublicationLazyImpl", + "fields": [ + { + "name": "_value" + } + ] + }, + { + "type": "kotlin.jvm.internal.DefaultConstructorMarker" + }, + { + "type": "kotlin.reflect.jvm.internal.ReflectionFactoryImpl", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "type": "kotlinx.coroutines.EventLoopImplBase", + "fields": [ + { + "name": "_delayed$volatile" + }, + { + "name": "_isCompleted$volatile" + }, + { + "name": "_queue$volatile" + } + ] + }, + { + "type": "kotlinx.coroutines.JobSupport", + "fields": [ + { + "name": "_parentHandle$volatile" + }, + { + "name": "_state$volatile" + } + ] + }, + { + "type": "kotlinx.coroutines.internal.DispatchedContinuation", + "fields": [ + { + "name": "_reusableCancellableContinuation$volatile" + } + ] + }, + { + "type": "kotlinx.coroutines.internal.LimitedDispatcher", + "fields": [ + { + "name": "runningWorkers$volatile" + } + ] + }, + { + "type": "kotlinx.coroutines.internal.LockFreeTaskQueue", + "fields": [ + { + "name": "_cur$volatile" + } + ] + }, + { + "type": "kotlinx.coroutines.internal.LockFreeTaskQueueCore", + "fields": [ + { + "name": "_next$volatile" + }, + { + "name": "_state$volatile" + } + ] + }, + { + "type": "kotlinx.coroutines.scheduling.CoroutineScheduler", + "fields": [ + { + "name": "_isTerminated$volatile" + }, + { + "name": "controlState$volatile" + }, + { + "name": "parkedWorkersStack$volatile" + } + ] + }, + { + "type": "org.jetbrains.kotlin.com.intellij.codeInsight.ContainerProvider" + }, + { + "type": "org.jetbrains.kotlin.com.intellij.openapi.application.impl.ModalityStateEx", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "type": "org.jetbrains.kotlin.com.intellij.openapi.extensions.impl.ExtensionPointImpl", + "fields": [ + { + "name": "keyMapperToCache" + }, + { + "name": "listeners" + } + ] + }, + { + "type": "org.jetbrains.kotlin.com.intellij.openapi.fileTypes.BinaryFileTypeDecompilers", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "type": "org.jetbrains.kotlin.com.intellij.openapi.fileTypes.LanguageFileType", + "methods": [ + { + "name": "extractCharsetFromFileContent", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.openapi.project.Project", + "org.jetbrains.kotlin.com.intellij.openapi.vfs.VirtualFile", + "java.lang.CharSequence" + ] + }, + { + "name": "extractCharsetFromFileContent", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.openapi.project.Project", + "org.jetbrains.kotlin.com.intellij.openapi.vfs.VirtualFile", + "java.lang.String" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.com.intellij.openapi.util.SimpleModificationTracker", + "fields": [ + { + "name": "myCounter" + } + ] + }, + { + "type": "org.jetbrains.kotlin.com.intellij.openapi.vfs.PersistentFSConstants", + "fields": [ + { + "name": "ourMaxIntellisenseFileSize" + } + ] + }, + { + "type": "org.jetbrains.kotlin.com.intellij.psi.LanguageSubstitutors", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "type": "org.jetbrains.kotlin.com.intellij.psi.PsiElementFinder" + }, + { + "type": "org.jetbrains.kotlin.com.intellij.psi.SingleRootFileViewProvider", + "fields": [ + { + "name": "myPsiFile" + } + ] + }, + { + "type": "org.jetbrains.kotlin.com.intellij.psi.compiled.ClassFileDecompilers", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "type": "org.jetbrains.kotlin.com.intellij.psi.compiled.ClassFileDecompilers$Decompiler" + }, + { + "type": "org.jetbrains.kotlin.com.intellij.psi.impl.source.JavaFileElementType", + "methods": [ + { + "name": "getExternalId", + "parameterTypes": [] + } + ] + }, + { + "type": "org.jetbrains.kotlin.com.intellij.psi.impl.source.tree.CompositeElement", + "fields": [ + { + "name": "myWrapper" + } + ] + }, + { + "type": "org.jetbrains.kotlin.com.intellij.psi.stubs.StubBase", + "fields": [ + { + "name": "myPsi" + } + ] + }, + { + "type": "org.jetbrains.kotlin.com.intellij.util.ConcurrentLongObjectHashMap", + "fields": [ + { + "name": "baseCount" + }, + { + "name": "cellsBusy" + }, + { + "name": "sizeCtl" + }, + { + "name": "transferIndex" + } + ] + }, + { + "type": "org.jetbrains.kotlin.com.intellij.util.ConcurrentLongObjectHashMap$CounterCell", + "fields": [ + { + "name": "value" + } + ] + }, + { + "type": "org.jetbrains.kotlin.com.intellij.util.KeyedLazyInstanceEP" + }, + { + "type": "org.jetbrains.kotlin.com.intellij.util.QueryExecutor" + }, + { + "type": "org.jetbrains.kotlin.extensions.CompilerConfigurationExtension" + }, + { + "type": "org.jetbrains.kotlin.extensions.CompilerConfigurationExtension[]" + }, + { + "type": "org.jetbrains.kotlin.idea.KotlinFileType" + }, + { + "type": "org.jetbrains.kotlin.kdoc.psi.impl.KDocLink[]" + }, + { + "type": "org.jetbrains.kotlin.kdoc.psi.impl.KDocName", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.kdoc.psi.impl.KDocName[]" + }, + { + "type": "org.jetbrains.kotlin.kdoc.psi.impl.KDocSection", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.kdoc.psi.impl.KDocSection[]" + }, + { + "type": "org.jetbrains.kotlin.kdoc.psi.impl.KDocTag", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.kdoc.psi.impl.KDocTag[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtAnnotatedExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtAnnotation", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtAnnotationEntry", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinAnnotationEntryStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtAnnotationEntry[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtAnnotationUseSiteTarget", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinAnnotationUseSiteTargetStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtAnnotationUseSiteTarget[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtAnnotation[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtArrayAccessExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtBackingField", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinBackingFieldStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtBackingField[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtBinaryExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtBinaryExpressionWithTypeRHS", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtBlockStringTemplateEntry", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinBlockStringTemplateEntryStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtBlockStringTemplateEntry[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtBreakExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtCallExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtCallableReferenceExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtCatchClause", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtClass", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinClassStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtClassBody", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtClassBody[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtClassInitializer", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtClassInitializer[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtClassLiteralExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinClassLiteralExpressionStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtClassLiteralExpression[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtClass[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtCollectionLiteralExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinCollectionLiteralExpressionStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtCollectionLiteralExpression[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtConstantExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinConstantExpressionStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtConstantExpression[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtConstructorCalleeExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtConstructorCalleeExpression[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtConstructorDelegationCall", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtConstructorDelegationReferenceExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtContainerNode", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtContainerNodeForControlStructureBody", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtContextReceiver", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinContextReceiverStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtContextReceiverList", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtContextReceiverList[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtContextReceiver[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtContinueExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtContractEffect", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinContractEffectStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtContractEffectList", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtContractEffectList[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtContractEffect[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtDeclarationModifierList", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinModifierListStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtDeclarationModifierList[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtDelegatedSuperTypeEntry", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtDelegatedSuperTypeEntry[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtDestructuringDeclaration", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtDestructuringDeclarationEntry", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtDoWhileExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtDotQualifiedExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtDotQualifiedExpression[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtDynamicType", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtDynamicType[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtEnumEntrySuperclassReferenceExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinEnumEntrySuperclassReferenceExpressionStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtEnumEntrySuperclassReferenceExpression[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtEscapeStringTemplateEntry", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderWithTextStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtEscapeStringTemplateEntry[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtFileAnnotationList", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtFileAnnotationList[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtFinallySection", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtForExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtFunctionLiteral", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtFunctionType", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinFunctionTypeStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtFunctionTypeReceiver", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtFunctionTypeReceiver[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtFunctionType[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtIfExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtImportAlias", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinImportAliasStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtImportAlias[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtImportDirective", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinImportDirectiveStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtImportDirective[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtImportList", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtImportList[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtInitializerList", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtInitializerList[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtIntersectionType", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtIntersectionType[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtIsExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtLabelReferenceExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtLabeledExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtLambdaArgument", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinValueArgumentStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtLambdaArgument[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtLiteralStringTemplateEntry", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderWithTextStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtLiteralStringTemplateEntry[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtNameReferenceExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinNameReferenceExpressionStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtNameReferenceExpression[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtNamedFunction", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinFunctionStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtNamedFunction[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtNullableType", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtNullableType[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtObjectDeclaration", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinObjectStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtObjectDeclaration[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtObjectLiteralExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtOperationReferenceExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtPackageDirective", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtPackageDirective[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtParameter", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinParameterStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtParameterList", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtParameterList[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtParameter[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtParenthesizedExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtPostfixExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtPrefixExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtPrimaryConstructor", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinConstructorStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtPrimaryConstructor[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtProperty", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinPropertyStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtPropertyAccessor", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinPropertyAccessorStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtPropertyAccessor[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtPropertyDelegate", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtProperty[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtReturnExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtSafeQualifiedExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtScript", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinScriptStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtScriptInitializer", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtScript[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtSecondaryConstructor", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinConstructorStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtSecondaryConstructor[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtSimpleNameStringTemplateEntry", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderWithTextStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtSimpleNameStringTemplateEntry[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtStringInterpolationPrefix", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinStringInterpolationPrefixStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtStringInterpolationPrefix[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtStringTemplateExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtStringTemplateExpression[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtSuperExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtSuperTypeCallEntry", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtSuperTypeCallEntry[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtSuperTypeEntry", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtSuperTypeEntry[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtSuperTypeList", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtSuperTypeList[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtThisExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtThrowExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtTryExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtTypeAlias", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinTypeAliasStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtTypeAlias[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtTypeArgumentList", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtTypeArgumentList[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtTypeConstraint", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtTypeConstraintList", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtTypeConstraintList[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtTypeConstraint[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtTypeParameter", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinTypeParameterStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtTypeParameterList", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtTypeParameterList[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtTypeParameter[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtTypeProjection", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinTypeProjectionStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtTypeProjection[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtTypeReference", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtTypeReference[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtUserType", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinUserTypeStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtUserType[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtValueArgument", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinValueArgumentStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtValueArgumentList", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtValueArgumentList[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtValueArgumentName", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + }, + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtValueArgumentName[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtValueArgument[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtWhenConditionInRange", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtWhenConditionIsPattern", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtWhenConditionWithExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtWhenCondition[]" + }, + { + "type": "org.jetbrains.kotlin.psi.KtWhenEntry", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtWhenEntryGuard", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtWhenExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.KtWhileExpression", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.jetbrains.kotlin.com.intellij.lang.ASTNode" + ] + } + ] + }, + { + "type": "org.jetbrains.kotlin.psi.stubs.elements.KtFileElementType", + "methods": [ + { + "name": "getExternalId", + "parameterTypes": [] + } + ] + }, + { + "type": "sun.misc.Unsafe", + "allDeclaredFields": true, + "methods": [ + { + "name": "arrayBaseOffset", + "parameterTypes": [ + "java.lang.Class" + ] + }, + { + "name": "arrayIndexScale", + "parameterTypes": [ + "java.lang.Class" + ] + }, + { + "name": "compareAndSwapInt", + "parameterTypes": [ + "java.lang.Object", + "long", + "int", + "int" + ] + }, + { + "name": "compareAndSwapLong", + "parameterTypes": [ + "java.lang.Object", + "long", + "long", + "long" + ] + }, + { + "name": "compareAndSwapObject", + "parameterTypes": [ + "java.lang.Object", + "long", + "java.lang.Object", + "java.lang.Object" + ] + }, + { + "name": "copyMemory", + "parameterTypes": [ + "java.lang.Object", + "long", + "java.lang.Object", + "long", + "long" + ] + }, + { + "name": "getAndAddInt", + "parameterTypes": [ + "java.lang.Object", + "long", + "int" + ] + }, + { + "name": "getObjectVolatile", + "parameterTypes": [ + "java.lang.Object", + "long" + ] + }, + { + "name": "invokeCleaner", + "parameterTypes": [ + "java.nio.ByteBuffer" + ] + }, + { + "name": "objectFieldOffset", + "parameterTypes": [ + "java.lang.reflect.Field" + ] + }, + { + "name": "putObjectVolatile", + "parameterTypes": [ + "java.lang.Object", + "long", + "java.lang.Object" + ] + } + ] + } + ], + "resources": [ + { + "glob": "org/jetbrains/kotlin/cli/common/CompilerSystemProperties.class" + } + ] +} \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d02f875c..1d06385d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,7 +6,10 @@ com-amazonaws-aws-lambda-java-events = "2.2.9" com-google-googlejavaformat-google-java-format = "1.23.0" com-google-guava-guava = "32.0.0-jre" com-google-truth-truth = "1.0" +org-graalvm = "25.0.1" +graalvmPlugin = "0.11.1" junit-junit = "4.13.1" +org-jline = "3.30.6" net-java-dev-jna-jna = "4.2.2" com-google-code-gson-gson = "2.10.1" @@ -25,7 +28,12 @@ amazon-aws-sdk-lambda = { module = "software.amazon.awssdk:lambda" } googleJavaformat = { module = "com.google.googlejavaformat:google-java-format", version.ref = "com-google-googlejavaformat-google-java-format" } googleTruth = { module = "com.google.truth:truth", version.ref = "com-google-truth-truth" } gson = { module = "com.google.code.gson:gson", version.ref = "com-google-code-gson-gson" } +graalvm-nativeimage = { module = "org.graalvm.nativeimage:svm", version.ref ="org-graalvm" } guava = { module = "com.google.guava:guava", version.ref = "com-google-guava-guava" } +jline-terminal = { module = "org.jline:jline-terminal", version.ref = "org-jline" } +jline-terminal-jansi = { module = "org.jline:jline-terminal-jansi", version.ref = "org-jline" } +jline-terminal-jna = { module = "org.jline:jline-terminal-jna", version.ref = "org-jline" } +jline-terminal-jni = { module = "org.jline:jline-terminal-jni", version.ref = "org-jline" } junit = { module = "junit:junit", version.ref = "junit-junit" } jna = { module = "net.java.dev.jna:jna", version.ref = "net-java-dev-jna-jna" } ktfmt = { module = "com.facebook:ktfmt", version.ref = "ktfmt" } @@ -35,6 +43,7 @@ kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotl [plugins] dokka = { id = "org.jetbrains.dokka", version.ref = "gradlePlugin-dokka" } +graalvm = { id = "org.graalvm.buildtools.native", version.ref = "graalvmPlugin" } intelliJPlatform = { id = "org.jetbrains.intellij.platform", version.ref = "gradlePlugin-intelliJPlatform" } kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } ktfmt = { id = "com.ncorti.ktfmt.gradle", version.ref = "gradlePlugin-ktfmt" } diff --git a/pgo_train.sh b/pgo_train.sh new file mode 100644 index 00000000..be68e4e5 --- /dev/null +++ b/pgo_train.sh @@ -0,0 +1,46 @@ +#!/bin/sh +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -e + +# clean any current native build +./gradlew :ktfmt:clean; + +# build natively with PGO training on +./gradlew :ktfmt:nativeCompile \ + -Pktfmt.native.pgo=train \ + -Pktfmt.native.target=native \ + -Pktfmt.native.lto=true; + +echo "PGO training starting" + +./core/build/native/nativeCompile/ktfmt -n $PWD + +echo "PGO training completed." + +cp -fv ./default.iprof ./core/src/main/native-image/profiles/default.iprof; + +echo "Rebuilding..." + +# clean for PGO-trained build +./gradlew :ktfmt:clean; + +# rebuild +./gradlew :ktfmt:nativeCompile \ + -Pktfmt.native.release=true \ + -Pktfmt.native.lto=true \ + -Pktfmt.native.pgo=true; + +echo "PGO-trained build complete."