|
14 | 14 | * limitations under the License.
|
15 | 15 | */
|
16 | 16 |
|
17 |
| -package org.jetbrains.kotlin.codegen.inline; |
| 17 | +package org.jetbrains.kotlin.codegen.inline |
18 | 18 |
|
19 |
| -import org.jetbrains.annotations.NotNull; |
20 |
| -import org.jetbrains.annotations.Nullable; |
21 |
| -import org.jetbrains.kotlin.codegen.StackValue; |
22 |
| -import org.jetbrains.org.objectweb.asm.tree.FieldInsnNode; |
| 19 | +import org.jetbrains.kotlin.codegen.StackValue |
| 20 | +import org.jetbrains.org.objectweb.asm.tree.FieldInsnNode |
23 | 21 |
|
24 |
| -import java.util.Collection; |
| 22 | +class InlinedLambdaRemapper( |
| 23 | + lambdaInternalName: String, |
| 24 | + parent: FieldRemapper, |
| 25 | + methodParams: Parameters |
| 26 | +) : FieldRemapper(lambdaInternalName, parent, methodParams) { |
25 | 27 |
|
26 |
| -public class InlinedLambdaRemapper extends FieldRemapper { |
27 |
| - public InlinedLambdaRemapper( |
28 |
| - @NotNull String lambdaInternalName, |
29 |
| - @NotNull FieldRemapper parent, |
30 |
| - @NotNull Parameters methodParams |
31 |
| - ) { |
32 |
| - super(lambdaInternalName, parent, methodParams); |
| 28 | + public override fun canProcess(fieldOwner: String, fieldName: String, isFolding: Boolean): Boolean { |
| 29 | + return isFolding && super.canProcess(fieldOwner, fieldName, true) |
33 | 30 | }
|
34 | 31 |
|
35 |
| - @Override |
36 |
| - public boolean canProcess(@NotNull String fieldOwner, @NotNull String fieldName, boolean isFolding) { |
37 |
| - return isFolding && super.canProcess(fieldOwner, fieldName, true); |
| 32 | + public override fun findField(fieldInsnNode: FieldInsnNode, captured: Collection<CapturedParamInfo>): CapturedParamInfo? { |
| 33 | + return parent.findField(fieldInsnNode, captured) |
38 | 34 | }
|
39 | 35 |
|
40 |
| - @Override |
41 |
| - @Nullable |
42 |
| - public CapturedParamInfo findField(@NotNull FieldInsnNode fieldInsnNode, @NotNull Collection<CapturedParamInfo> captured) { |
43 |
| - return parent.findField(fieldInsnNode, captured); |
| 36 | + override fun isInsideInliningLambda(): Boolean { |
| 37 | + return true |
44 | 38 | }
|
45 | 39 |
|
46 |
| - @Override |
47 |
| - public boolean isInsideInliningLambda() { |
48 |
| - return true; |
49 |
| - } |
50 |
| - |
51 |
| - @Nullable |
52 |
| - @Override |
53 |
| - public StackValue getFieldForInline(@NotNull FieldInsnNode node, @Nullable StackValue prefix) { |
54 |
| - if (parent.isRoot()) { |
55 |
| - return super.getFieldForInline(node, prefix); |
| 40 | + override fun getFieldForInline(node: FieldInsnNode, prefix: StackValue?): StackValue? { |
| 41 | + if (parent.isRoot) { |
| 42 | + return super.getFieldForInline(node, prefix) |
56 | 43 | }
|
57 |
| - return parent.getFieldForInline(node, prefix); |
| 44 | + return parent.getFieldForInline(node, prefix) |
58 | 45 | }
|
59 | 46 | }
|
0 commit comments