1 // Copyright (c) 2016, the R8 project authors. Please see the AUTHORS file 2 // for details. All rights reserved. Use of this source code is governed by a 3 // BSD-style license that can be found in the LICENSE file. 4 package com.android.tools.r8.code; 5 6 import com.android.tools.r8.graph.DexField; 7 import com.android.tools.r8.graph.OffsetToObjectMapping; 8 import com.android.tools.r8.graph.UseRegistry; 9 import com.android.tools.r8.ir.code.MemberType; 10 import com.android.tools.r8.ir.conversion.IRBuilder; 11 12 public class Sget extends Format21c { 13 14 public static final int OPCODE = 0x60; 15 public static final String NAME = "Sget"; 16 public static final String SMALI_NAME = "sget"; 17 Sget(int high, BytecodeStream stream, OffsetToObjectMapping mapping)18 Sget(int high, BytecodeStream stream, OffsetToObjectMapping mapping) { 19 super(high, stream, mapping.getFieldMap()); 20 } 21 Sget(int AA, DexField BBBB)22 public Sget(int AA, DexField BBBB) { 23 super(AA, BBBB); 24 } 25 getName()26 public String getName() { 27 return NAME; 28 } 29 getSmaliName()30 public String getSmaliName() { 31 return SMALI_NAME; 32 } 33 getOpcode()34 public int getOpcode() { 35 return OPCODE; 36 } 37 38 @Override registerUse(UseRegistry registry)39 public void registerUse(UseRegistry registry) { 40 registry.registerStaticFieldRead(getField()); 41 } 42 43 @Override getField()44 public DexField getField() { 45 return (DexField) BBBB; 46 } 47 48 @Override buildIR(IRBuilder builder)49 public void buildIR(IRBuilder builder) { 50 builder.addStaticGet(MemberType.SINGLE, AA, getField()); 51 } 52 53 @Override canThrow()54 public boolean canThrow() { 55 return true; 56 } 57 } 58