Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: runtime/vm/object_test.cc

Issue 383523005: Specify descriptor kind to iterate on. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/globals.h" 5 #include "platform/globals.h"
6 6
7 #include "vm/assembler.h" 7 #include "vm/assembler.h"
8 #include "vm/bigint_operations.h" 8 #include "vm/bigint_operations.h"
9 #include "vm/class_finalizer.h" 9 #include "vm/class_finalizer.h"
10 #include "vm/dart_api_impl.h" 10 #include "vm/dart_api_impl.h"
(...skipping 2727 matching lines...) Expand 10 before | Expand all | Expand 10 after
2738 2738
2739 extern void GenerateIncrement(Assembler* assembler); 2739 extern void GenerateIncrement(Assembler* assembler);
2740 Assembler _assembler_; 2740 Assembler _assembler_;
2741 GenerateIncrement(&_assembler_); 2741 GenerateIncrement(&_assembler_);
2742 Code& code = Code::Handle(Code::FinalizeCode( 2742 Code& code = Code::Handle(Code::FinalizeCode(
2743 *CreateFunction("Test_Code"), &_assembler_)); 2743 *CreateFunction("Test_Code"), &_assembler_));
2744 code.set_pc_descriptors(descriptors); 2744 code.set_pc_descriptors(descriptors);
2745 2745
2746 // Verify the PcDescriptor entries by accessing them. 2746 // Verify the PcDescriptor entries by accessing them.
2747 const PcDescriptors& pc_descs = PcDescriptors::Handle(code.pc_descriptors()); 2747 const PcDescriptors& pc_descs = PcDescriptors::Handle(code.pc_descriptors());
2748 PcDescriptors::Iterator iter(pc_descs); 2748 PcDescriptors::Iterator iter(pc_descs, RawPcDescriptors::kAnyKind);
2749 const RawPcDescriptors::PcDescriptorRec& rec0 = iter.Next(); 2749 const RawPcDescriptors::PcDescriptorRec& rec0 = iter.Next();
2750 const RawPcDescriptors::PcDescriptorRec& rec1 = iter.Next(); 2750 const RawPcDescriptors::PcDescriptorRec& rec1 = iter.Next();
2751 const RawPcDescriptors::PcDescriptorRec& rec2 = iter.Next(); 2751 const RawPcDescriptors::PcDescriptorRec& rec2 = iter.Next();
2752 const RawPcDescriptors::PcDescriptorRec& rec3 = iter.Next(); 2752 const RawPcDescriptors::PcDescriptorRec& rec3 = iter.Next();
2753 const RawPcDescriptors::PcDescriptorRec& rec4 = iter.Next(); 2753 const RawPcDescriptors::PcDescriptorRec& rec4 = iter.Next();
2754 const RawPcDescriptors::PcDescriptorRec& rec5 = iter.Next(); 2754 const RawPcDescriptors::PcDescriptorRec& rec5 = iter.Next();
2755 ASSERT(!iter.HasNext()); 2755 ASSERT(!iter.HasNext());
2756 2756
2757 EXPECT_EQ(1, rec0.try_index); 2757 EXPECT_EQ(1, rec0.try_index);
2758 EXPECT_EQ(static_cast<uword>(10), rec0.pc); 2758 EXPECT_EQ(static_cast<uword>(10), rec0.pc);
(...skipping 1389 matching lines...) Expand 10 before | Expand all | Expand 10 after
4148 EXPECT_VALID(h_result); 4148 EXPECT_VALID(h_result);
4149 Integer& result = Integer::Handle(); 4149 Integer& result = Integer::Handle();
4150 result ^= Api::UnwrapHandle(h_result); 4150 result ^= Api::UnwrapHandle(h_result);
4151 String& foo = String::Handle(String::New("foo")); 4151 String& foo = String::Handle(String::New("foo"));
4152 Integer& expected = Integer::Handle(); 4152 Integer& expected = Integer::Handle();
4153 expected ^= foo.HashCode(); 4153 expected ^= foo.HashCode();
4154 EXPECT(result.IsIdenticalTo(expected)); 4154 EXPECT(result.IsIdenticalTo(expected));
4155 } 4155 }
4156 4156
4157 } // namespace dart 4157 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698