Home | History | Annotate | Download | only in optimizing

Lines Matching refs:Instruction

58     // be deleted when the first throwing instruction with the vreg undefined
62 // the first throwing instruction.
89 // Make sure there was at least one throwing instruction which initialized
179 // Vreg was undefined at a previously encountered throwing instruction
187 // This is the first instruction throwing into `catch_block` where
200 void HInstructionBuilder::AppendInstruction(HInstruction* instruction) {
201 current_block_->AddInstruction(instruction);
202 InitializeInstruction(instruction);
205 void HInstructionBuilder::InsertInstructionAtTop(HInstruction* instruction) {
207 current_block_->AddInstruction(instruction);
209 current_block_->InsertInstructionBefore(instruction, current_block_->GetFirstInstruction());
211 InitializeInstruction(instruction);
214 void HInstructionBuilder::InitializeInstruction(HInstruction* instruction) {
215 if (instruction->NeedsEnvironment()) {
220 instruction->GetDexPc(),
221 instruction);
223 instruction->SetRawEnvironment(environment);
275 // at start of java statement) rather than before every dex instruction.
317 // The previous instruction ended this block.
342 // instruction of the current block is not a branching instruction.
364 // Instruction-specific tweaks.
365 const Instruction* const begin = Instruction::At(code_item_.insns_);
366 const Instruction* const end = begin->RelativeAt(code_item_.insns_size_in_code_units_);
367 for (const Instruction* inst = begin; inst < end; inst = inst->Next()) {
369 case Instruction::MOVE_EXCEPTION: {
374 const Instruction* next = inst->Next();
428 // We are storing a pair. Invalidate the instruction in the high vreg.
483 void HInstructionBuilder::If_22t(const Instruction& instruction, uint32_t dex_pc) {
484 HInstruction* first = LoadLocal(instruction.VRegA(), Primitive::kPrimInt);
485 HInstruction* second = LoadLocal(instruction.VRegB(), Primitive::kPrimInt);
493 void HInstructionBuilder::If_21t(const Instruction& instruction, uint32_t dex_pc) {
494 HInstruction* value = LoadLocal(instruction.VRegA(), Primitive::kPrimInt);
502 void HInstructionBuilder::Unop_12x(const Instruction& instruction,
505 HInstruction* first = LoadLocal(instruction.VRegB(), type);
507 UpdateLocal(instruction.VRegA(), current_block_->GetLastInstruction());
510 void HInstructionBuilder::Conversion_12x(const Instruction& instruction,
514 HInstruction* first = LoadLocal(instruction.VRegB(), input_type);
516 UpdateLocal(instruction.VRegA(), current_block_->GetLastInstruction());
520 void HInstructionBuilder::Binop_23x(const Instruction& instruction,
523 HInstruction* first = LoadLocal(instruction.VRegB(), type);
524 HInstruction* second = LoadLocal(instruction.VRegC(), type);
526 UpdateLocal(instruction.VRegA(), current_block_->GetLastInstruction());
530 void HInstructionBuilder::Binop_23x_shift(const Instruction& instruction,
533 HInstruction* first = LoadLocal(instruction.VRegB(), type);
534 HInstruction* second = LoadLocal(instruction.VRegC(), Primitive::kPrimInt);
536 UpdateLocal(instruction.VRegA(), current_block_->GetLastInstruction());
539 void HInstructionBuilder::Binop_23x_cmp(const Instruction& instruction,
543 HInstruction* first = LoadLocal(instruction.VRegB(), type);
544 HInstruction* second = LoadLocal(instruction.VRegC(), type);
546 UpdateLocal(instruction.VRegA(), current_block_->GetLastInstruction());
550 void HInstructionBuilder::Binop_12x_shift(const Instruction& instruction,
553 HInstruction* first = LoadLocal(instruction.VRegA(), type);
554 HInstruction* second = LoadLocal(instruction.VRegB(), Primitive::kPrimInt);
556 UpdateLocal(instruction.VRegA(), current_block_->GetLastInstruction());
560 void HInstructionBuilder::Binop_12x(const Instruction& instruction,
563 HInstruction* first = LoadLocal(instruction.VRegA(), type);
564 HInstruction* second = LoadLocal(instruction.VRegB(), type);
566 UpdateLocal(instruction.VRegA(), current_block_->GetLastInstruction());
570 void HInstructionBuilder::Binop_22s(const Instruction& instruction, bool reverse, uint32_t dex_pc) {
571 HInstruction* first = LoadLocal(instruction.VRegB(), Primitive::kPrimInt);
572 HInstruction* second = graph_->GetIntConstant(instruction.VRegC_22s(), dex_pc);
577 UpdateLocal(instruction.VRegA(), current_block_->GetLastInstruction());
581 void HInstructionBuilder::Binop_22b(const Instruction& instruction, bool reverse, uint32_t dex_pc) {
582 HInstruction* first = LoadLocal(instruction.VRegB(), Primitive::kPrimInt);
583 HInstruction* second = graph_->GetIntConstant(instruction.VRegC_22b(), dex_pc);
588 UpdateLocal(instruction.VRegA(), current_block_->GetLastInstruction());
603 // dex_pc after `instruction` at `dex_pc`.
604 static bool IsFallthroughInstruction(const Instruction& instruction,
607 uint32_t next_dex_pc = dex_pc + instruction.SizeInCodeUnits();
611 void HInstructionBuilder::BuildSwitch(const Instruction& instruction, uint32_t dex_pc) {
612 HInstruction* value = LoadLocal(instruction.VRegA(), Primitive::kPrimInt);
613 DexSwitchTable table(instruction, dex_pc);
617 DCHECK(IsFallthroughInstruction(instruction, dex_pc, current_block_));
638 void HInstructionBuilder::BuildReturn(const Instruction& instruction,
649 HInstruction* value = LoadLocal(instruction.VRegA(), type);
655 static InvokeType GetInvokeTypeFromOpCode(Instruction::Code opcode) {
657 case Instruction::INVOKE_STATIC:
658 case Instruction::INVOKE_STATIC_RANGE:
660 case Instruction::INVOKE_DIRECT:
661 case Instruction::INVOKE_DIRECT_RANGE:
663 case Instruction::INVOKE_VIRTUAL:
664 case Instruction::INVOKE_VIRTUAL_QUICK:
665 case Instruction::INVOKE_VIRTUAL_RANGE:
666 case Instruction::INVOKE_VIRTUAL_RANGE_QUICK:
668 case Instruction::INVOKE_INTERFACE:
669 case Instruction::INVOKE_INTERFACE_RANGE:
671 case Instruction::INVOKE_SUPER_RANGE:
672 case Instruction::INVOKE_SUPER:
783 bool HInstructionBuilder::BuildInvoke(const Instruction& instruction,
790 InvokeType invoke_type = GetInvokeTypeFromOpCode(instruction.Opcode());
864 // we resolved to the method referenced by the instruction.
917 bool HInstructionBuilder::BuildInvokePolymorphic(const Instruction& instruction ATTRIBUTE_UNUSED,
1044 // dex registers given. If the instruction was seen as dead by the verifier,
1072 << " because of wrong number of arguments in invoke instruction";
1190 bool HInstructionBuilder::BuildInstanceFieldAccess(const Instruction& instruction,
1193 uint32_t source_or_dest_reg = instruction.VRegA_22c();
1194 uint32_t obj_reg = instruction.VRegB_22c();
1196 if (instruction.IsQuickened()) {
1202 field_index = instruction.VRegC_22c();
1304 void HInstructionBuilder::BuildUnresolvedStaticFieldAccess(const Instruction& instruction,
1308 uint32_t source_or_dest_reg = instruction.VRegA_21c();
1309 uint16_t field_index = instruction.VRegB_21c();
1370 bool HInstructionBuilder::BuildStaticFieldAccess(const Instruction& instruction,
1373 uint32_t source_or_dest_reg = instruction.VRegA_21c();
1374 uint16_t field_index = instruction.VRegB_21c();
1382 BuildUnresolvedStaticFieldAccess(instruction, dex_pc, is_put, field_type);
1399 BuildUnresolvedStaticFieldAccess(instruction, dex_pc, is_put, field_type);
1475 void HInstructionBuilder::BuildArrayAccess(const Instruction& instruction,
1479 uint8_t source_or_dest_reg = instruction.VRegA_23x();
1480 uint8_t array_reg = instruction.VRegB_23x();
1481 uint8_t index_reg = instruction.VRegC_23x();
1549 void HInstructionBuilder::BuildFillArrayData(const Instruction& instruction, uint32_t dex_pc) {
1550 HInstruction* array = LoadNullCheckedLocal(instruction.VRegA_31t(), dex_pc);
1552 int32_t payload_offset = instruction.VRegB_31t() + dex_pc;
1553 const Instruction::ArrayDataPayload* payload =
1554 reinterpret_cast<const Instruction::ArrayDataPayload*>(code_item_.insns_ + payload_offset);
1566 // Implementation of this DEX instruction seems to be that the bounds check is
1698 // Append the instruction first, as setting the load kind affects the inputs.
1704 void HInstructionBuilder::BuildTypeCheck(const Instruction& instruction,
1714 if (instruction.Opcode() == Instruction::INSTANCE_OF) {
1718 DCHECK_EQ(instruction.Opcode(), Instruction::CHECK_CAST);
1767 bool HInstructionBuilder::ProcessDexInstruction(const Instruction& instruction, uint32_t dex_pc) {
1768 switch (instruction.Opcode()) {
1769 case Instruction::CONST_4: {
1770 int32_t register_index = instruction.VRegA();
1771 HIntConstant* constant = graph_->GetIntConstant(instruction.VRegB_11n(), dex_pc);
1776 case Instruction::CONST_16: {
1777 int32_t register_index = instruction.VRegA();
1778 HIntConstant* constant = graph_->GetIntConstant(instruction.VRegB_21s(), dex_pc);
1783 case Instruction::CONST: {
1784 int32_t register_index = instruction.VRegA();
1785 HIntConstant* constant = graph_->GetIntConstant(instruction.VRegB_31i(), dex_pc);
1790 case Instruction::CONST_HIGH16: {
1791 int32_t register_index = instruction.VRegA();
1792 HIntConstant* constant = graph_->GetIntConstant(instruction.VRegB_21h() << 16, dex_pc);
1797 case Instruction::CONST_WIDE_16: {
1798 int32_t register_index = instruction.VRegA();
1800 int64_t value = instruction.VRegB_21s();
1808 case Instruction::CONST_WIDE_32: {
1809 int32_t register_index = instruction.VRegA();
1811 int64_t value = instruction.VRegB_31i();
1819 case Instruction::CONST_WIDE: {
1820 int32_t register_index = instruction.VRegA();
1821 HLongConstant* constant = graph_->GetLongConstant(instruction.VRegB_51l(), dex_pc);
1826 case Instruction::CONST_WIDE_HIGH16: {
1827 int32_t register_index = instruction.VRegA();
1828 int64_t value = static_cast<int64_t>(instruction.VRegB_21h()) << 48;
1835 case Instruction::MOVE:
1836 case Instruction::MOVE_FROM16:
1837 case Instruction::MOVE_16: {
1838 HInstruction* value = LoadLocal(instruction.VRegB(), Primitive::kPrimInt);
1839 UpdateLocal(instruction.VRegA(), value);
1844 case Instruction::MOVE_WIDE:
1845 case Instruction::MOVE_WIDE_FROM16:
1846 case Instruction::MOVE_WIDE_16: {
1847 HInstruction* value = LoadLocal(instruction.VRegB(), Primitive::kPrimLong);
1848 UpdateLocal(instruction.VRegA(), value);
1852 case Instruction::MOVE_OBJECT:
1853 case Instruction::MOVE_OBJECT_16:
1854 case Instruction::MOVE_OBJECT_FROM16: {
1860 uint32_t reg_number = instruction.VRegB();
1869 UpdateLocal(instruction.VRegA(), value);
1873 case Instruction::RETURN_VOID_NO_BARRIER:
1874 case Instruction::RETURN_VOID: {
1875 BuildReturn(instruction, Primitive::kPrimVoid, dex_pc);
1880 case Instruction::IF_##cond: If_22t<comparison>(instruction, dex_pc); break; \
1881 case Instruction::IF_##cond##Z: If_21t<comparison>(instruction, dex_pc); break
1890 case Instruction::GOTO:
1891 case Instruction::GOTO_16:
1892 case Instruction::GOTO_32: {
1898 case Instruction::RETURN: {
1899 BuildReturn(instruction, return_type_, dex_pc);
1903 case Instruction::RETURN_OBJECT: {
1904 BuildReturn(instruction, return_type_, dex_pc);
1908 case Instruction::RETURN_WIDE: {
1909 BuildReturn(instruction, return_type_, dex_pc);
1913 case Instruction::INVOKE_DIRECT:
1914 case Instruction::INVOKE_INTERFACE:
1915 case Instruction::INVOKE_STATIC:
1916 case Instruction::INVOKE_SUPER:
1917 case Instruction::INVOKE_VIRTUAL:
1918 case Instruction::INVOKE_VIRTUAL_QUICK: {
1920 if (instruction.Opcode() == Instruction::INVOKE_VIRTUAL_QUICK) {
1926 method_idx = instruction.VRegB_35c();
1928 uint32_t number_of_vreg_arguments = instruction.VRegA_35c();
1930 instruction.GetVarArgs(args);
1931 if (!BuildInvoke(instruction, dex_pc, method_idx,
1938 case Instruction::INVOKE_DIRECT_RANGE:
1939 case Instruction::INVOKE_INTERFACE_RANGE:
1940 case Instruction::INVOKE_STATIC_RANGE:
1941 case Instruction::INVOKE_SUPER_RANGE:
1942 case Instruction::INVOKE_VIRTUAL_RANGE:
1943 case Instruction::INVOKE_VIRTUAL_RANGE_QUICK: {
1945 if (instruction.Opcode() == Instruction::INVOKE_VIRTUAL_RANGE_QUICK) {
1951 method_idx = instruction.VRegB_3rc();
1953 uint32_t number_of_vreg_arguments = instruction.VRegA_3rc();
1954 uint32_t register_index = instruction.VRegC();
1955 if (!BuildInvoke(instruction, dex_pc, method_idx,
1962 case Instruction::INVOKE_POLYMORPHIC: {
1963 uint16_t method_idx = instruction.VRegB_45cc();
1964 uint16_t proto_idx = instruction.VRegH_45cc();
1965 uint32_t number_of_vreg_arguments = instruction.VRegA_45cc();
1967 instruction.GetVarArgs(args);
1968 return BuildInvokePolymorphic(instruction,
1978 case Instruction::INVOKE_POLYMORPHIC_RANGE: {
1979 uint16_t method_idx = instruction.VRegB_4rcc();
1980 uint16_t proto_idx = instruction.VRegH_4rcc();
1981 uint32_t number_of_vreg_arguments = instruction.VRegA_4rcc();
1982 uint32_t register_index = instruction.VRegC_4rcc();
1983 return BuildInvokePolymorphic(instruction,
1993 case Instruction::NEG_INT: {
1994 Unop_12x<HNeg>(instruction, Primitive::kPrimInt, dex_pc);
1998 case Instruction::NEG_LONG: {
1999 Unop_12x<HNeg>(instruction, Primitive::kPrimLong, dex_pc);
2003 case Instruction::NEG_FLOAT: {
2004 Unop_12x<HNeg>(instruction, Primitive::kPrimFloat, dex_pc);
2008 case Instruction::NEG_DOUBLE: {
2009 Unop_12x<HNeg>(instruction, Primitive::kPrimDouble, dex_pc);
2013 case Instruction::NOT_INT: {
2014 Unop_12x<HNot>(instruction, Primitive::kPrimInt, dex_pc);
2018 case Instruction::NOT_LONG: {
2019 Unop_12x<HNot>(instruction, Primitive::kPrimLong, dex_pc);
2023 case Instruction::INT_TO_LONG: {
2024 Conversion_12x(instruction, Primitive::kPrimInt, Primitive::kPrimLong, dex_pc);
2028 case Instruction::INT_TO_FLOAT: {
2029 Conversion_12x(instruction, Primitive::kPrimInt, Primitive::kPrimFloat, dex_pc);
2033 case Instruction::INT_TO_DOUBLE: {
2034 Conversion_12x(instruction, Primitive::kPrimInt, Primitive::kPrimDouble, dex_pc);
2038 case Instruction::LONG_TO_INT: {
2039 Conversion_12x(instruction, Primitive::kPrimLong, Primitive::kPrimInt, dex_pc);
2043 case Instruction::LONG_TO_FLOAT: {
2044 Conversion_12x(instruction, Primitive::kPrimLong, Primitive::kPrimFloat, dex_pc);
2048 case Instruction::LONG_TO_DOUBLE: {
2049 Conversion_12x(instruction, Primitive::kPrimLong, Primitive::kPrimDouble, dex_pc);
2053 case Instruction::FLOAT_TO_INT: {
2054 Conversion_12x(instruction, Primitive::kPrimFloat, Primitive::kPrimInt, dex_pc);
2058 case Instruction::FLOAT_TO_LONG: {
2059 Conversion_12x(instruction, Primitive::kPrimFloat, Primitive::kPrimLong, dex_pc);
2063 case Instruction::FLOAT_TO_DOUBLE: {
2064 Conversion_12x(instruction, Primitive::kPrimFloat, Primitive::kPrimDouble, dex_pc);
2068 case Instruction::DOUBLE_TO_INT: {
2069 Conversion_12x(instruction, Primitive::kPrimDouble, Primitive::kPrimInt, dex_pc);
2073 case Instruction::DOUBLE_TO_LONG: {
2074 Conversion_12x(instruction, Primitive::kPrimDouble, Primitive::kPrimLong, dex_pc);
2078 case Instruction::DOUBLE_TO_FLOAT: {
2079 Conversion_12x(instruction, Primitive::kPrimDouble, Primitive::kPrimFloat, dex_pc);
2083 case Instruction::INT_TO_BYTE: {
2084 Conversion_12x(instruction, Primitive::kPrimInt, Primitive::kPrimByte, dex_pc);
2088 case Instruction::INT_TO_SHORT: {
2089 Conversion_12x(instruction, Primitive::kPrimInt, Primitive::kPrimShort, dex_pc);
2093 case Instruction::INT_TO_CHAR: {
2094 Conversion_12x(instruction, Primitive::kPrimInt, Primitive::kPrimChar, dex_pc);
2098 case Instruction::ADD_INT: {
2099 Binop_23x<HAdd>(instruction, Primitive::kPrimInt, dex_pc);
2103 case Instruction::ADD_LONG: {
2104 Binop_23x<HAdd>(instruction, Primitive::kPrimLong, dex_pc);
2108 case Instruction::ADD_DOUBLE: {
2109 Binop_23x<HAdd>(instruction, Primitive::kPrimDouble, dex_pc);
2113 case Instruction::ADD_FLOAT: {
2114 Binop_23x<HAdd>(instruction, Primitive::kPrimFloat, dex_pc);
2118 case Instruction::SUB_INT: {
2119 Binop_23x<HSub>(instruction, Primitive::kPrimInt, dex_pc);
2123 case Instruction::SUB_LONG: {
2124 Binop_23x<HSub>(instruction, Primitive::kPrimLong, dex_pc);
2128 case Instruction::SUB_FLOAT: {
2129 Binop_23x<HSub>(instruction, Primitive::kPrimFloat, dex_pc);
2133 case Instruction::SUB_DOUBLE: {
2134 Binop_23x<HSub>(instruction, Primitive::kPrimDouble, dex_pc);
2138 case Instruction::ADD_INT_2ADDR: {
2139 Binop_12x<HAdd>(instruction, Primitive::kPrimInt, dex_pc);
2143 case Instruction::MUL_INT: {
2144 Binop_23x<HMul>(instruction, Primitive::kPrimInt, dex_pc);
2148 case Instruction::MUL_LONG: {
2149 Binop_23x<HMul>(instruction, Primitive::kPrimLong, dex_pc);
2153 case Instruction::MUL_FLOAT: {
2154 Binop_23x<HMul>(instruction, Primitive::kPrimFloat, dex_pc);
2158 case Instruction::MUL_DOUBLE: {
2159 Binop_23x<HMul>(instruction, Primitive::kPrimDouble, dex_pc);
2163 case Instruction::DIV_INT: {
2164 BuildCheckedDivRem(instruction.VRegA(), instruction.VRegB(), instruction.VRegC(),
2169 case Instruction::DIV_LONG: {
2170 BuildCheckedDivRem(instruction.VRegA(), instruction.VRegB(), instruction.VRegC(),
2175 case Instruction::DIV_FLOAT: {
2176 Binop_23x<HDiv>(instruction, Primitive::kPrimFloat, dex_pc);
2180 case Instruction::DIV_DOUBLE: {
2181 Binop_23x<HDiv>(instruction, Primitive::kPrimDouble, dex_pc);
2185 case Instruction::REM_INT: {
2186 BuildCheckedDivRem(instruction.VRegA(), instruction.VRegB(), instruction.VRegC(),
2191 case Instruction::REM_LONG: {
2192 BuildCheckedDivRem(instruction.VRegA(), instruction.VRegB(), instruction.VRegC(),
2197 case Instruction::REM_FLOAT: {
2198 Binop_23x<HRem>(instruction, Primitive::kPrimFloat, dex_pc);
2202 case Instruction::REM_DOUBLE: {
2203 Binop_23x<HRem>(instruction, Primitive::kPrimDouble, dex_pc);
2207 case Instruction::AND_INT: {
2208 Binop_23x<HAnd>(instruction, Primitive::kPrimInt, dex_pc);
2212 case Instruction::AND_LONG: {
2213 Binop_23x<HAnd>(instruction, Primitive::kPrimLong, dex_pc);
2217 case Instruction::SHL_INT: {
2218 Binop_23x_shift<HShl>(instruction, Primitive::kPrimInt, dex_pc);
2222 case Instruction::SHL_LONG: {
2223 Binop_23x_shift<HShl>(instruction, Primitive::kPrimLong, dex_pc);
2227 case Instruction::SHR_INT: {
2228 Binop_23x_shift<HShr>(instruction, Primitive::kPrimInt, dex_pc);
2232 case Instruction::SHR_LONG: {
2233 Binop_23x_shift<HShr>(instruction, Primitive::kPrimLong, dex_pc);
2237 case Instruction::USHR_INT: {
2238 Binop_23x_shift<HUShr>(instruction, Primitive::kPrimInt, dex_pc);
2242 case Instruction::USHR_LONG: {
2243 Binop_23x_shift<HUShr>(instruction, Primitive::kPrimLong, dex_pc);
2247 case Instruction::OR_INT: {
2248 Binop_23x<HOr>(instruction, Primitive::kPrimInt, dex_pc);
2252 case Instruction::OR_LONG: {
2253 Binop_23x<HOr>(instruction, Primitive::kPrimLong, dex_pc);
2257 case Instruction::XOR_INT: {
2258 Binop_23x<HXor>(instruction, Primitive::kPrimInt, dex_pc);
2262 case Instruction::XOR_LONG: {
2263 Binop_23x<HXor>(instruction, Primitive::kPrimLong, dex_pc);
2267 case Instruction::ADD_LONG_2ADDR: {
2268 Binop_12x<HAdd>(instruction, Primitive::kPrimLong, dex_pc);
2272 case Instruction::ADD_DOUBLE_2ADDR: {
2273 Binop_12x<HAdd>(instruction, Primitive::kPrimDouble, dex_pc);
2277 case Instruction::ADD_FLOAT_2ADDR: {
2278 Binop_12x<HAdd>(instruction, Primitive::kPrimFloat, dex_pc);
2282 case Instruction::SUB_INT_2ADDR: {
2283 Binop_12x<HSub>(instruction, Primitive::kPrimInt, dex_pc);
2287 case Instruction::SUB_LONG_2ADDR: {
2288 Binop_12x<HSub>(instruction, Primitive::kPrimLong, dex_pc);
2292 case Instruction::SUB_FLOAT_2ADDR: {
2293 Binop_12x<HSub>(instruction, Primitive::kPrimFloat, dex_pc);
2297 case Instruction::SUB_DOUBLE_2ADDR: {
2298 Binop_12x<HSub>(instruction, Primitive::kPrimDouble, dex_pc);
2302 case Instruction::MUL_INT_2ADDR: {
2303 Binop_12x<HMul>(instruction, Primitive::kPrimInt, dex_pc);
2307 case Instruction::MUL_LONG_2ADDR: {
2308 Binop_12x<HMul>(instruction, Primitive::kPrimLong, dex_pc);
2312 case Instruction::MUL_FLOAT_2ADDR: {
2313 Binop_12x<HMul>(instruction, Primitive::kPrimFloat, dex_pc);
2317 case Instruction::MUL_DOUBLE_2ADDR: {
2318 Binop_12x<HMul>(instruction, Primitive::kPrimDouble, dex_pc);
2322 case Instruction::DIV_INT_2ADDR: {
2323 BuildCheckedDivRem(instruction.VRegA(), instruction.VRegA(), instruction.VRegB(),
2328 case Instruction::DIV_LONG_2ADDR: {
2329 BuildCheckedDivRem(instruction.VRegA(), instruction.VRegA(), instruction.VRegB(),
2334 case Instruction::REM_INT_2ADDR: {
2335 BuildCheckedDivRem(instruction.VRegA(), instruction.VRegA(), instruction.VRegB(),
2340 case Instruction::REM_LONG_2ADDR: {
2341 BuildCheckedDivRem(instruction.VRegA(), instruction.VRegA(), instruction.VRegB(),
2346 case Instruction::REM_FLOAT_2ADDR: {
2347 Binop_12x<HRem>(instruction, Primitive::kPrimFloat, dex_pc);
2351 case Instruction::REM_DOUBLE_2ADDR: {
2352 Binop_12x<HRem>(instruction, Primitive::kPrimDouble, dex_pc);
2356 case Instruction::SHL_INT_2ADDR: {
2357 Binop_12x_shift<HShl>(instruction, Primitive::kPrimInt, dex_pc);
2361 case Instruction::SHL_LONG_2ADDR: {
2362 Binop_12x_shift<HShl>(instruction, Primitive::kPrimLong, dex_pc);
2366 case Instruction::SHR_INT_2ADDR: {
2367 Binop_12x_shift<HShr>(instruction, Primitive::kPrimInt, dex_pc);
2371 case Instruction::SHR_LONG_2ADDR: {
2372 Binop_12x_shift<HShr>(instruction, Primitive::kPrimLong, dex_pc);
2376 case Instruction::USHR_INT_2ADDR: {
2377 Binop_12x_shift<HUShr>(instruction, Primitive::kPrimInt, dex_pc);
2381 case Instruction::USHR_LONG_2ADDR: {
2382 Binop_12x_shift<HUShr>(instruction, Primitive::kPrimLong, dex_pc);
2386 case Instruction::DIV_FLOAT_2ADDR: {
2387 Binop_12x<HDiv>(instruction, Primitive::kPrimFloat, dex_pc);
2391 case Instruction::DIV_DOUBLE_2ADDR: {
2392 Binop_12x<HDiv>(instruction, Primitive::kPrimDouble, dex_pc);
2396 case Instruction::AND_INT_2ADDR: {
2397 Binop_12x<HAnd>(instruction, Primitive::kPrimInt, dex_pc);
2401 case Instruction::AND_LONG_2ADDR: {
2402 Binop_12x<HAnd>(instruction, Primitive::kPrimLong, dex_pc);
2406 case Instruction::OR_INT_2ADDR: {
2407 Binop_12x<HOr>(instruction, Primitive::kPrimInt, dex_pc);
2411 case Instruction::OR_LONG_2ADDR: {
2412 Binop_12x<HOr>(instruction, Primitive::kPrimLong, dex_pc);
2416 case Instruction::XOR_INT_2ADDR: {
2417 Binop_12x<HXor>(instruction, Primitive::kPrimInt, dex_pc);
2421 case Instruction::XOR_LONG_2ADDR: {
2422 Binop_12x<HXor>(instruction, Primitive::kPrimLong, dex_pc);
2426 case Instruction::ADD_INT_LIT16: {
2427 Binop_22s<HAdd>(instruction, false, dex_pc);
2431 case Instruction::AND_INT_LIT16: {
2432 Binop_22s<HAnd>(instruction, false, dex_pc);
2436 case Instruction::OR_INT_LIT16: {
2437 Binop_22s<HOr>(instruction, false, dex_pc);
2441 case Instruction::XOR_INT_LIT16: {
2442 Binop_22s<HXor>(instruction, false, dex_pc);
2446 case Instruction::RSUB_INT: {
2447 Binop_22s<HSub>(instruction, true, dex_pc);
2451 case Instruction::MUL_INT_LIT16: {
2452 Binop_22s<HMul>(instruction, false, dex_pc);
2456 case Instruction::ADD_INT_LIT8: {
2457 Binop_22b<HAdd>(instruction, false, dex_pc);
2461 case Instruction::AND_INT_LIT8: {
2462 Binop_22b<HAnd>(instruction, false, dex_pc);
2466 case Instruction::OR_INT_LIT8: {
2467 Binop_22b<HOr>(instruction, false, dex_pc);
2471 case Instruction::XOR_INT_LIT8: {
2472 Binop_22b<HXor>(instruction, false, dex_pc);
2476 case Instruction::RSUB_INT_LIT8: {
2477 Binop_22b<HSub>(instruction, true, dex_pc);
2481 case Instruction::MUL_INT_LIT8: {
2482 Binop_22b<HMul>(instruction, false, dex_pc);
2486 case Instruction::DIV_INT_LIT16:
2487 case Instruction::DIV_INT_LIT8: {
2488 BuildCheckedDivRem(instruction.VRegA(), instruction.VRegB(), instruction.VRegC(),
2493 case Instruction::REM_INT_LIT16:
2494 case Instruction::REM_INT_LIT8: {
2495 BuildCheckedDivRem(instruction.VRegA(), instruction.VRegB(), instruction.VRegC(),
2500 case Instruction::SHL_INT_LIT8: {
2501 Binop_22b<HShl>(instruction, false, dex_pc);
2505 case Instruction::SHR_INT_LIT8: {
2506 Binop_22b<HShr>(instruction, false, dex_pc);
2510 case Instruction::USHR_INT_LIT8: {
2511 Binop_22b<HUShr>(instruction, false, dex_pc);
2515 case Instruction::NEW_INSTANCE: {
2516 if (!BuildNewInstance(dex::TypeIndex(instruction.VRegB_21c()), dex_pc)) {
2519 UpdateLocal(instruction.VRegA(), current_block_->GetLastInstruction());
2523 case Instruction::NEW_ARRAY: {
2524 dex::TypeIndex type_index(instruction.VRegC_22c());
2525 HInstruction* length = LoadLocal(instruction.VRegB_22c(), Primitive::kPrimInt);
2528 UpdateLocal(instruction.VRegA_22c(), current_block_->GetLastInstruction());
2532 case Instruction::FILLED_NEW_ARRAY: {
2533 uint32_t number_of_vreg_arguments = instruction.VRegA_35c();
2534 dex::TypeIndex type_index(instruction.VRegB_35c());
2536 instruction.GetVarArgs(args);
2541 case Instruction::FILLED_NEW_ARRAY_RANGE: {
2542 uint32_t number_of_vreg_arguments = instruction.VRegA_3rc();
2543 dex::TypeIndex type_index(instruction.VRegB_3rc());
2544 uint32_t register_index = instruction.VRegC_3rc();
2550 case Instruction::FILL_ARRAY_DATA: {
2551 BuildFillArrayData(instruction, dex_pc);
2555 case Instruction::MOVE_RESULT:
2556 case Instruction::MOVE_RESULT_WIDE:
2557 case Instruction::MOVE_RESULT_OBJECT: {
2559 UpdateLocal(instruction.VRegA(), latest_result_);
2564 case Instruction::CMP_LONG: {
2565 Binop_23x_cmp(instruction, Primitive::kPrimLong, ComparisonBias::kNoBias, dex_pc);
2569 case Instruction::CMPG_FLOAT: {
2570 Binop_23x_cmp(instruction, Primitive::kPrimFloat, ComparisonBias::kGtBias, dex_pc);
2574 case Instruction::CMPG_DOUBLE: {
2575 Binop_23x_cmp(instruction, Primitive::kPrimDouble, ComparisonBias::kGtBias, dex_pc);
2579 case Instruction::CMPL_FLOAT: {
2580 Binop_23x_cmp(instruction, Primitive::kPrimFloat, ComparisonBias::kLtBias, dex_pc);
2584 case Instruction::CMPL_DOUBLE: {
2585 Binop_23x_cmp(instruction, Primitive::kPrimDouble, ComparisonBias::kLtBias, dex_pc);
2589 case Instruction::NOP:
2592 case Instruction::IGET:
2593 case Instruction::IGET_QUICK:
2594 case Instruction::IGET_WIDE:
2595 case Instruction::IGET_WIDE_QUICK:
2596 case Instruction::IGET_OBJECT:
2597 case Instruction::IGET_OBJECT_QUICK:
2598 case Instruction::IGET_BOOLEAN:
2599 case Instruction::IGET_BOOLEAN_QUICK:
2600 case Instruction::IGET_BYTE:
2601 case Instruction::IGET_BYTE_QUICK:
2602 case Instruction::IGET_CHAR:
2603 case Instruction::IGET_CHAR_QUICK:
2604 case Instruction::IGET_SHORT:
2605 case Instruction::IGET_SHORT_QUICK: {
2606 if (!BuildInstanceFieldAccess(instruction, dex_pc, false)) {
2612 case Instruction::IPUT:
2613 case Instruction::IPUT_QUICK:
2614 case Instruction::IPUT_WIDE:
2615 case Instruction::IPUT_WIDE_QUICK:
2616 case Instruction::IPUT_OBJECT:
2617 case Instruction::IPUT_OBJECT_QUICK:
2618 case Instruction::IPUT_BOOLEAN:
2619 case Instruction::IPUT_BOOLEAN_QUICK:
2620 case Instruction::IPUT_BYTE:
2621 case Instruction::IPUT_BYTE_QUICK:
2622 case Instruction::IPUT_CHAR:
2623 case Instruction::IPUT_CHAR_QUICK:
2624 case Instruction::IPUT_SHORT:
2625 case Instruction::IPUT_SHORT_QUICK: {
2626 if (!BuildInstanceFieldAccess(instruction, dex_pc, true)) {
2632 case Instruction::SGET:
2633 case Instruction::SGET_WIDE:
2634 case Instruction::SGET_OBJECT:
2635 case Instruction::SGET_BOOLEAN:
2636 case Instruction::SGET_BYTE:
2637 case Instruction::SGET_CHAR:
2638 case Instruction::SGET_SHORT: {
2639 if (!BuildStaticFieldAccess(instruction, dex_pc, false)) {
2645 case Instruction::SPUT:
2646 case Instruction::SPUT_WIDE:
2647 case Instruction::SPUT_OBJECT:
2648 case Instruction::SPUT_BOOLEAN:
2649 case Instruction::SPUT_BYTE:
2650 case Instruction::SPUT_CHAR:
2651 case Instruction::SPUT_SHORT: {
2652 if (!BuildStaticFieldAccess(instruction, dex_pc, true)) {
2659 case Instruction::AGET##kind: { \
2660 BuildArrayAccess(instruction, dex_pc, false, anticipated_type); \
2663 case Instruction::APUT##kind: { \
2664 BuildArrayAccess(instruction, dex_pc, true, anticipated_type); \
2676 case Instruction::ARRAY_LENGTH: {
2677 HInstruction* object = LoadNullCheckedLocal(instruction.VRegB_12x(), dex_pc);
2679 UpdateLocal(instruction.VRegA_12x(), current_block_->GetLastInstruction());
2683 case Instruction::CONST_STRING: {
2684 dex::StringIndex string_index(instruction.VRegB_21c());
2687 UpdateLocal(instruction.VRegA_21c(), current_block_->GetLastInstruction());
2691 case Instruction::CONST_STRING_JUMBO: {
2692 dex::StringIndex string_index(instruction.VRegB_31c());
2695 UpdateLocal(instruction.VRegA_31c(), current_block_->GetLastInstruction());
2699 case Instruction::CONST_CLASS: {
2700 dex::TypeIndex type_index(instruction.VRegB_21c());
2702 UpdateLocal(instruction.VRegA_21c(), current_block_->GetLastInstruction());
2706 case Instruction::MOVE_EXCEPTION: {
2708 UpdateLocal(instruction.VRegA_11x(), current_block_->GetLastInstruction());
2713 case Instruction::THROW: {
2714 HInstruction* exception = LoadLocal(instruction.VRegA_11x(), Primitive::kPrimNot);
2722 case Instruction::INSTANCE_OF: {
2723 uint8_t destination = instruction.VRegA_22c();
2724 uint8_t reference = instruction.VRegB_22c();
2725 dex::TypeIndex type_index(instruction.VRegC_22c());
2726 BuildTypeCheck(instruction, destination, reference, type_index, dex_pc);
2730 case Instruction::CHECK_CAST: {
2731 uint8_t reference = instruction.VRegA_21c();
2732 dex::TypeIndex type_index(instruction.VRegB_21c());
2733 BuildTypeCheck(instruction, -1, reference, type_index, dex_pc);
2737 case Instruction::MONITOR_ENTER: {
2739 LoadLocal(instruction.VRegA_11x(), Primitive::kPrimNot),
2745 case Instruction::MONITOR_EXIT: {
2747 LoadLocal(instruction.VRegA_11x(), Primitive::kPrimNot),
2753 case Instruction::SPARSE_SWITCH:
2754 case Instruction::PACKED_SWITCH: {
2755 BuildSwitch(instruction, dex_pc);
2762 << " because of unhandled instruction "
2763 << instruction.Name();