[JS IR] Cache JsLocation objects and js function signatures
Memory consumption optimization
This commit is contained in:
committed by
Space
parent
ff2f16190d
commit
bf53273b84
@@ -19,12 +19,14 @@ package org.jetbrains.kotlin.js.backend.ast
|
||||
import java.io.Reader
|
||||
|
||||
data class JsLocation(
|
||||
override val file: String,
|
||||
override val startLine: Int,
|
||||
override val startChar: Int
|
||||
override val file: String,
|
||||
override val startLine: Int,
|
||||
override val startChar: Int
|
||||
) : JsLocationWithSource {
|
||||
override val identityObject: Any? = null
|
||||
override val sourceProvider: () -> Reader? = { null }
|
||||
override val identityObject: Any?
|
||||
get() = null
|
||||
override val sourceProvider: () -> Reader?
|
||||
get() = { null }
|
||||
|
||||
override fun asSimpleLocation(): JsLocation = this
|
||||
}
|
||||
@@ -40,7 +42,7 @@ interface JsLocationWithSource {
|
||||
}
|
||||
|
||||
class JsLocationWithEmbeddedSource(
|
||||
private val location: JsLocation,
|
||||
override val identityObject: Any?,
|
||||
override val sourceProvider: () -> Reader?
|
||||
) : JsLocationWithSource by location
|
||||
private val location: JsLocation,
|
||||
override val identityObject: Any?,
|
||||
override val sourceProvider: () -> Reader?
|
||||
) : JsLocationWithSource by location
|
||||
|
||||
Reference in New Issue
Block a user