| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 "vm/assert.h" | 5 #include "vm/assert.h" |
| 6 #include "vm/assembler.h" | 6 #include "vm/assembler.h" |
| 7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
| 8 #include "vm/isolate.h" | 8 #include "vm/isolate.h" |
| 9 #include "vm/object.h" | 9 #include "vm/object.h" |
| 10 #include "vm/object_store.h" | 10 #include "vm/object_store.h" |
| (...skipping 2170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2181 extern void GenerateIncrement(Assembler* assembler); | 2181 extern void GenerateIncrement(Assembler* assembler); |
| 2182 Assembler _assembler_; | 2182 Assembler _assembler_; |
| 2183 GenerateIncrement(&_assembler_); | 2183 GenerateIncrement(&_assembler_); |
| 2184 Code& code = Code::Handle(Code::FinalizeCode("Test_Code", &_assembler_)); | 2184 Code& code = Code::Handle(Code::FinalizeCode("Test_Code", &_assembler_)); |
| 2185 code.set_pc_descriptors(descriptors); | 2185 code.set_pc_descriptors(descriptors); |
| 2186 | 2186 |
| 2187 // Verify the PcDescriptor entries by accessing them. | 2187 // Verify the PcDescriptor entries by accessing them. |
| 2188 const PcDescriptors& pc_descs = PcDescriptors::Handle(code.pc_descriptors()); | 2188 const PcDescriptors& pc_descs = PcDescriptors::Handle(code.pc_descriptors()); |
| 2189 EXPECT_EQ(kNumEntries, pc_descs.Length()); | 2189 EXPECT_EQ(kNumEntries, pc_descs.Length()); |
| 2190 EXPECT_EQ(1, pc_descs.TryIndex(0)); | 2190 EXPECT_EQ(1, pc_descs.TryIndex(0)); |
| 2191 EXPECT_EQ(10, pc_descs.PC(0)); | 2191 EXPECT_EQ(static_cast<uword>(10), pc_descs.PC(0)); |
| 2192 EXPECT_EQ(1, pc_descs.NodeId(0)); | 2192 EXPECT_EQ(1, pc_descs.NodeId(0)); |
| 2193 EXPECT_EQ(20, pc_descs.TokenIndex(0)); | 2193 EXPECT_EQ(20, pc_descs.TokenIndex(0)); |
| 2194 EXPECT_EQ(3, pc_descs.TryIndex(5)); | 2194 EXPECT_EQ(3, pc_descs.TryIndex(5)); |
| 2195 EXPECT_EQ(80, pc_descs.PC(5)); | 2195 EXPECT_EQ(static_cast<uword>(80), pc_descs.PC(5)); |
| 2196 EXPECT_EQ(150, pc_descs.TokenIndex(5)); | 2196 EXPECT_EQ(150, pc_descs.TokenIndex(5)); |
| 2197 EXPECT_EQ(PcDescriptors::kOther, pc_descs.DescriptorKind(0)); | 2197 EXPECT_EQ(PcDescriptors::kOther, pc_descs.DescriptorKind(0)); |
| 2198 EXPECT_EQ(PcDescriptors::kDeopt, pc_descs.DescriptorKind(1)); | 2198 EXPECT_EQ(PcDescriptors::kDeopt, pc_descs.DescriptorKind(1)); |
| 2199 } | 2199 } |
| 2200 | 2200 |
| 2201 | 2201 |
| 2202 static RawClass* CreateTestClass(const char* name) { | 2202 static RawClass* CreateTestClass(const char* name) { |
| 2203 const String& class_name = String::Handle(String::NewSymbol(name)); | 2203 const String& class_name = String::Handle(String::NewSymbol(name)); |
| 2204 const Class& cls = Class::Handle(Class::New(class_name, Script::Handle())); | 2204 const Class& cls = Class::Handle(Class::New(class_name, Script::Handle())); |
| 2205 return cls.raw(); | 2205 return cls.raw(); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 2233 cls = iterator.GetNextClass(); | 2233 cls = iterator.GetNextClass(); |
| 2234 ASSERT((cls.raw() == ae66.raw()) || (cls.raw() == re44.raw())); | 2234 ASSERT((cls.raw() == ae66.raw()) || (cls.raw() == re44.raw())); |
| 2235 count++; | 2235 count++; |
| 2236 } | 2236 } |
| 2237 ASSERT(count == 2); | 2237 ASSERT(count == 2); |
| 2238 } | 2238 } |
| 2239 | 2239 |
| 2240 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). | 2240 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). |
| 2241 | 2241 |
| 2242 } // namespace dart | 2242 } // namespace dart |
| OLD | NEW |