From deaeea275256bed2ba737b46e6f63e701d193196 Mon Sep 17 00:00:00 2001 From: Graham Date: Tue, 2 Jun 2020 18:25:34 +0100 Subject: [PATCH] Rename inlineConstantArgs to propagateConstantArgs I think constant propagation describes this more accurately than 'inlining'. Signed-off-by: Graham --- .../openrs2/deob/transform/ConstantArgTransformer.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/deob/src/main/java/dev/openrs2/deob/transform/ConstantArgTransformer.kt b/deob/src/main/java/dev/openrs2/deob/transform/ConstantArgTransformer.kt index 7ed3844b..d890d104 100644 --- a/deob/src/main/java/dev/openrs2/deob/transform/ConstantArgTransformer.kt +++ b/deob/src/main/java/dev/openrs2/deob/transform/ConstantArgTransformer.kt @@ -58,7 +58,7 @@ class ConstantArgTransformer @Inject constructor(private val profile: Profile) : private lateinit var inheritedMethodSets: DisjointSet private lateinit var entryPoints: MemberFilter private var branchesSimplified = 0 - private var constantsInlined = 0 + private var constantsPropagated = 0 override fun preTransform(classPath: ClassPath) { pendingMethods.clear() @@ -67,7 +67,7 @@ class ConstantArgTransformer @Inject constructor(private val profile: Profile) : inheritedMethodSets = classPath.createInheritedMethodSets() entryPoints = UnionMemberFilter(profile.entryPoints, ReflectedConstructorFilter.create(classPath)) branchesSimplified = 0 - constantsInlined = 0 + constantsPropagated = 0 queueEntryPoints(classPath) @@ -246,7 +246,7 @@ class ConstantArgTransformer @Inject constructor(private val profile: Profile) : return simplified } - private fun inlineConstantArgs( + private fun propagateConstantArgs( classPath: ClassPath, clazz: ClassNode, method: MethodNode, @@ -310,12 +310,12 @@ class ConstantArgTransformer @Inject constructor(private val profile: Profile) : override fun transformCode(classPath: ClassPath, library: Library, clazz: ClassNode, method: MethodNode): Boolean { val args = getArgs(MemberRef(clazz, method)) branchesSimplified += simplifyBranches(clazz, method, args) - constantsInlined += inlineConstantArgs(classPath, clazz, method, args) + constantsPropagated += propagateConstantArgs(classPath, clazz, method, args) return false } override fun postTransform(classPath: ClassPath) { - logger.info { "Simplified $branchesSimplified branches and inlined $constantsInlined constants" } + logger.info { "Simplified $branchesSimplified branches and propagated $constantsPropagated constants" } } private companion object {