blob: dba75d472db89fc1163f9613f42349e2812baef1 [file] [log] [blame]
// Copyright (c) 2023, 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.library.primitive;
import com.android.tools.r8.graph.AppView;
import com.android.tools.r8.graph.DexMethod;
import com.android.tools.r8.graph.DexType;
import com.android.tools.r8.ir.analysis.value.AbstractValue;
public class IntegerMethodOptimizer extends PrimitiveMethodOptimizer {
IntegerMethodOptimizer(AppView<?> appView) {
super(appView);
}
@Override
DexMethod getBoxMethod() {
return dexItemFactory.integerMembers.valueOf;
}
@Override
DexMethod getUnboxMethod() {
return dexItemFactory.integerMembers.intValue;
}
@Override
boolean isMatchingSingleBoxedPrimitive(AbstractValue abstractValue) {
return abstractValue.isSingleBoxedInteger();
}
@Override
public DexType getType() {
return dexItemFactory.boxedIntType;
}
}