Index: runtime/vm/object_test.cc |
=================================================================== |
--- runtime/vm/object_test.cc (revision 38030) |
+++ runtime/vm/object_test.cc (working copy) |
@@ -2729,12 +2729,12 @@ |
// Add PcDescriptors to the code. |
PcDescriptors& descriptors = PcDescriptors::Handle(); |
descriptors ^= PcDescriptors::New(kNumEntries); |
- descriptors.AddDescriptor(0, 10, PcDescriptors::kOther, 1, 20, 1); |
- descriptors.AddDescriptor(1, 20, PcDescriptors::kDeopt, 2, 30, 0); |
- descriptors.AddDescriptor(2, 30, PcDescriptors::kOther, 3, 40, 1); |
- descriptors.AddDescriptor(3, 10, PcDescriptors::kOther, 4, 40, 2); |
- descriptors.AddDescriptor(4, 10, PcDescriptors::kOther, 5, 80, 3); |
- descriptors.AddDescriptor(5, 80, PcDescriptors::kOther, 6, 150, 3); |
+ descriptors.AddDescriptor(0, 10, RawPcDescriptors::kOther, 1, 20, 1); |
+ descriptors.AddDescriptor(1, 20, RawPcDescriptors::kDeopt, 2, 30, 0); |
+ descriptors.AddDescriptor(2, 30, RawPcDescriptors::kOther, 3, 40, 1); |
+ descriptors.AddDescriptor(3, 10, RawPcDescriptors::kOther, 4, 40, 2); |
+ descriptors.AddDescriptor(4, 10, RawPcDescriptors::kOther, 5, 80, 3); |
+ descriptors.AddDescriptor(5, 80, RawPcDescriptors::kOther, 6, 150, 3); |
extern void GenerateIncrement(Assembler* assembler); |
Assembler _assembler_; |
@@ -2745,16 +2745,30 @@ |
// Verify the PcDescriptor entries by accessing them. |
const PcDescriptors& pc_descs = PcDescriptors::Handle(code.pc_descriptors()); |
- EXPECT_EQ(kNumEntries, pc_descs.Length()); |
- EXPECT_EQ(1, pc_descs.TryIndex(0)); |
- EXPECT_EQ(static_cast<uword>(10), pc_descs.PC(0)); |
- EXPECT_EQ(1, pc_descs.DeoptId(0)); |
- EXPECT_EQ(20, pc_descs.TokenPos(0)); |
- EXPECT_EQ(3, pc_descs.TryIndex(5)); |
- EXPECT_EQ(static_cast<uword>(80), pc_descs.PC(5)); |
- EXPECT_EQ(150, pc_descs.TokenPos(5)); |
- EXPECT_EQ(PcDescriptors::kOther, pc_descs.DescriptorKind(0)); |
- EXPECT_EQ(PcDescriptors::kDeopt, pc_descs.DescriptorKind(1)); |
+ PcDescriptors::Iterator iter(pc_descs); |
+ const RawPcDescriptors::PcDescriptorRec& rec0 = iter.Next(); |
+ const RawPcDescriptors::PcDescriptorRec& rec1 = iter.Next(); |
+ const RawPcDescriptors::PcDescriptorRec& rec2 = iter.Next(); |
+ const RawPcDescriptors::PcDescriptorRec& rec3 = iter.Next(); |
+ const RawPcDescriptors::PcDescriptorRec& rec4 = iter.Next(); |
+ const RawPcDescriptors::PcDescriptorRec& rec5 = iter.Next(); |
+ ASSERT(!iter.HasNext()); |
+ |
+ EXPECT_EQ(1, rec0.try_index); |
+ EXPECT_EQ(static_cast<uword>(10), rec0.pc); |
+ EXPECT_EQ(1, rec0.deopt_id); |
+ EXPECT_EQ(20, rec0.token_pos); |
+ |
+ EXPECT_EQ(3, rec5.try_index); |
+ EXPECT_EQ(static_cast<uword>(80), rec5.pc); |
+ EXPECT_EQ(150, rec5.token_pos); |
+ EXPECT_EQ(RawPcDescriptors::kOther, rec0.kind()); |
+ EXPECT_EQ(RawPcDescriptors::kDeopt, rec1.kind()); |
+ |
+ EXPECT_EQ(30, rec1.token_pos); |
+ EXPECT_EQ(40, rec2.token_pos); |
+ EXPECT_EQ(40, rec3.token_pos); |
+ EXPECT_EQ(80, rec4.token_pos); |
} |