diff options
author | 2017-09-23 16:11:06 -0700 | |
---|---|---|
committer | 2017-09-27 11:51:53 -0700 | |
commit | 1d2d4ff8570bb88d9d2d4633706fd7f6fb18d75e (patch) | |
tree | cbe67e8e9214828656314117121e8ce906a762ab /runtime/dex_instruction_test.cc | |
parent | e5b35ed787fbfb388d162361310bae5b0e7682a7 (diff) |
Add DexInstructionIterator and use it a few places
Motivation:
Want to start abstracting away dex specific functionality to enable
CompactDex. Adding an iterator will enable CompactDex iteration to
work differently than normal dex iteration.
Will eventually replace CodeItemIterator.
Bug: 63756964
Test: test-art-host
Change-Id: I90e67c1a994b7698aaac0523a82816b0a003fbdc
Diffstat (limited to 'runtime/dex_instruction_test.cc')
-rw-r--r-- | runtime/dex_instruction_test.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/runtime/dex_instruction_test.cc b/runtime/dex_instruction_test.cc index 3f7ac57cef..48ed027882 100644 --- a/runtime/dex_instruction_test.cc +++ b/runtime/dex_instruction_test.cc @@ -15,6 +15,7 @@ */ #include "dex_instruction-inl.h" +#include "dex_instruction_iterator.h" #include "gtest/gtest.h" namespace art { @@ -73,7 +74,7 @@ TEST(Instruction, PropertiesOf45cc) { Build45cc(4u /* num_vregs */, 16u /* method_idx */, 32u /* proto_idx */, 0xcafe /* arg_regs */, instruction); - const Instruction* ins = Instruction::At(instruction); + DexInstructionIterator ins(instruction); ASSERT_EQ(4u, ins->SizeInCodeUnits()); ASSERT_TRUE(ins->HasVRegA()); @@ -108,7 +109,7 @@ TEST(Instruction, PropertiesOf4rcc) { Build4rcc(4u /* num_vregs */, 16u /* method_idx */, 32u /* proto_idx */, 0xcafe /* arg_regs */, instruction); - const Instruction* ins = Instruction::At(instruction); + DexInstructionIterator ins(instruction); ASSERT_EQ(4u, ins->SizeInCodeUnits()); ASSERT_TRUE(ins->HasVRegA()); @@ -154,7 +155,7 @@ static std::string DumpInst35c(Instruction::Code code, std::vector<uint16_t> args) { uint16_t inst[6] = {}; Build35c(inst, code, method_idx, args); - return Instruction::At(inst)->DumpString(nullptr); + return DexInstructionIterator(inst)->DumpString(nullptr); } TEST(Instruction, DumpString) { |