From a5b09a67034e57a6e10231dd4bd92f4cb50b824c Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Thu, 17 Nov 2016 15:21:22 -0800 Subject: ART: Add dex::TypeIndex Add abstraction for uint16_t type index. Test: m test-art-host Change-Id: I47708741c7c579cbbe59ab723c1e31c5fe71f83a --- runtime/dex_instruction.cc | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'runtime/dex_instruction.cc') diff --git a/runtime/dex_instruction.cc b/runtime/dex_instruction.cc index c766b54c0a..751bd51dab 100644 --- a/runtime/dex_instruction.cc +++ b/runtime/dex_instruction.cc @@ -208,9 +208,9 @@ std::string Instruction::DumpString(const DexFile* file) const { case CONST_CLASS: case NEW_INSTANCE: if (file != nullptr) { - uint32_t type_idx = VRegB_21c(); - os << opcode << " v" << static_cast(VRegA_21c()) << ", " << file->PrettyType(type_idx) - << " // type@" << type_idx; + dex::TypeIndex type_idx(VRegB_21c()); + os << opcode << " v" << static_cast(VRegA_21c()) << ", " + << file->PrettyType(type_idx) << " // type@" << type_idx; break; } FALLTHROUGH_INTENDED; @@ -302,17 +302,19 @@ std::string Instruction::DumpString(const DexFile* file) const { FALLTHROUGH_INTENDED; case INSTANCE_OF: if (file != nullptr) { - uint32_t type_idx = VRegC_22c(); - os << opcode << " v" << static_cast(VRegA_22c()) << ", v" << static_cast(VRegB_22c()) << ", " - << file->PrettyType(type_idx) << " // type@" << type_idx; + dex::TypeIndex type_idx(VRegC_22c()); + os << opcode << " v" << static_cast(VRegA_22c()) << ", v" + << static_cast(VRegB_22c()) << ", " << file->PrettyType(type_idx) + << " // type@" << type_idx.index_; break; } FALLTHROUGH_INTENDED; case NEW_ARRAY: if (file != nullptr) { - uint32_t type_idx = VRegC_22c(); - os << opcode << " v" << static_cast(VRegA_22c()) << ", v" << static_cast(VRegB_22c()) << ", " - << file->PrettyType(type_idx) << " // type@" << type_idx; + dex::TypeIndex type_idx(VRegC_22c()); + os << opcode << " v" << static_cast(VRegA_22c()) << ", v" + << static_cast(VRegB_22c()) << ", " << file->PrettyType(type_idx) + << " // type@" << type_idx.index_; break; } FALLTHROUGH_INTENDED; -- cgit v1.2.3-59-g8ed1b