Refactor ASM generation code #105

Merged
CommanderTvis merged 11 commits from adv-expr-refactor-agc into adv-expr 2020-06-16 10:30:06 +03:00
2 changed files with 2 additions and 2 deletions
Showing only changes of commit a8fa385497 - Show all commits

View File

@ -98,7 +98,7 @@ internal class AsmBinaryOperation<T>(
internal class AsmVariableExpression<T>(private val name: String, private val default: T? = null) :
AsmNode<T>() {
override fun compile(gen: AsmGenerator<T>): Unit = gen.loadFromVariables(name, default)
override fun compile(gen: AsmGenerator<T>): Unit = gen.loadVariable(name, default)
}
internal class AsmConstantExpression<T>(private val value: T) :

View File

@ -228,7 +228,7 @@ internal class AsmGenerator<T> @PublishedApi internal constructor(
loadConstant(value, c)
}
internal fun loadFromVariables(name: String, defaultValue: T? = null): Unit = invokeMethodVisitor.run {
internal fun loadVariable(name: String, defaultValue: T? = null): Unit = invokeMethodVisitor.run {
visitLoadObjectVar(invokeArgumentsVar)
if (defaultValue != null) {