blob: 8f9421d933c27a4c0a0b6ebdb8a056220ffe0ece [file] [log] [blame]
// Copyright (c) 2018, the R8 project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
package com.android.tools.r8.ir.optimize;
import com.android.tools.r8.graph.AppView;
import com.android.tools.r8.graph.DexEncodedMethod;
import com.android.tools.r8.shaking.AppInfoWithLiveness;
public class ArgumentRemovalUtils {
// Returns true if this method is pinned from the perspective of optimizations that attempt to
// remove method arguments.
public static boolean isPinned(DexEncodedMethod method, AppView<AppInfoWithLiveness> appView) {
return appView.appInfo().isPinned(method.getReference())
|| appView.appInfo().isBootstrapMethod(method.getReference())
|| appView.appInfo().isFailedResolutionTarget(method.getReference())
|| appView.appInfo().isMethodTargetedByInvokeDynamic(method.getReference())
|| method.accessFlags.isNative();
}
}