| 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/disassembler.h" | 5 #include "vm/disassembler.h" |
| 6 | 6 |
| 7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
| 8 #include "vm/deopt_instructions.h" | 8 #include "vm/deopt_instructions.h" |
| 9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
| 10 #include "vm/il_printer.h" | 10 #include "vm/il_printer.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 optimized ? "optimized " : "", | 169 optimized ? "optimized " : "", |
| 170 function_fullname); | 170 function_fullname); |
| 171 code.Disassemble(); | 171 code.Disassemble(); |
| 172 THR_Print("}\n"); | 172 THR_Print("}\n"); |
| 173 | 173 |
| 174 #if defined(TARGET_ARCH_IA32) | 174 #if defined(TARGET_ARCH_IA32) |
| 175 THR_Print("Pointer offsets for function: {\n"); | 175 THR_Print("Pointer offsets for function: {\n"); |
| 176 // Pointer offsets are stored in descending order. | 176 // Pointer offsets are stored in descending order. |
| 177 Object& obj = Object::Handle(); | 177 Object& obj = Object::Handle(); |
| 178 for (intptr_t i = code.pointer_offsets_length() - 1; i >= 0; i--) { | 178 for (intptr_t i = code.pointer_offsets_length() - 1; i >= 0; i--) { |
| 179 const uword addr = code.GetPointerOffsetAt(i) + code.EntryPoint(); | 179 const uword addr = code.GetPointerOffsetAt(i) + code.PayloadStart(); |
| 180 obj = *reinterpret_cast<RawObject**>(addr); | 180 obj = *reinterpret_cast<RawObject**>(addr); |
| 181 THR_Print(" %d : %#" Px " '%s'\n", | 181 THR_Print(" %d : %#" Px " '%s'\n", |
| 182 code.GetPointerOffsetAt(i), addr, obj.ToCString()); | 182 code.GetPointerOffsetAt(i), addr, obj.ToCString()); |
| 183 } | 183 } |
| 184 THR_Print("}\n"); | 184 THR_Print("}\n"); |
| 185 #else | 185 #else |
| 186 ASSERT(code.pointer_offsets_length() == 0); | 186 ASSERT(code.pointer_offsets_length() == 0); |
| 187 #endif | 187 #endif |
| 188 | 188 |
| 189 const ObjectPool& object_pool = ObjectPool::Handle(code.GetObjectPool()); | 189 const ObjectPool& object_pool = ObjectPool::Handle(code.GetObjectPool()); |
| 190 object_pool.DebugPrint(); | 190 object_pool.DebugPrint(); |
| 191 | 191 |
| 192 THR_Print("PC Descriptors for function '%s' {\n", function_fullname); | 192 THR_Print("PC Descriptors for function '%s' {\n", function_fullname); |
| 193 PcDescriptors::PrintHeaderString(); | 193 PcDescriptors::PrintHeaderString(); |
| 194 const PcDescriptors& descriptors = | 194 const PcDescriptors& descriptors = |
| 195 PcDescriptors::Handle(code.pc_descriptors()); | 195 PcDescriptors::Handle(code.pc_descriptors()); |
| 196 THR_Print("%s}\n", descriptors.ToCString()); | 196 THR_Print("%s}\n", descriptors.ToCString()); |
| 197 | 197 |
| 198 uword start = Instructions::Handle(code.instructions()).EntryPoint(); | 198 uword start = Instructions::Handle(code.instructions()).PayloadStart(); |
| 199 const Array& deopt_table = Array::Handle(code.deopt_info_array()); | 199 const Array& deopt_table = Array::Handle(code.deopt_info_array()); |
| 200 intptr_t deopt_table_length = DeoptTable::GetLength(deopt_table); | 200 intptr_t deopt_table_length = DeoptTable::GetLength(deopt_table); |
| 201 if (deopt_table_length > 0) { | 201 if (deopt_table_length > 0) { |
| 202 THR_Print("DeoptInfo: {\n"); | 202 THR_Print("DeoptInfo: {\n"); |
| 203 Smi& offset = Smi::Handle(); | 203 Smi& offset = Smi::Handle(); |
| 204 TypedData& info = TypedData::Handle(); | 204 TypedData& info = TypedData::Handle(); |
| 205 Smi& reason_and_flags = Smi::Handle(); | 205 Smi& reason_and_flags = Smi::Handle(); |
| 206 for (intptr_t i = 0; i < deopt_table_length; ++i) { | 206 for (intptr_t i = 0; i < deopt_table_length; ++i) { |
| 207 DeoptTable::GetEntry(deopt_table, i, &offset, &info, &reason_and_flags); | 207 DeoptTable::GetEntry(deopt_table, i, &offset, &info, &reason_and_flags); |
| 208 const intptr_t reason = | 208 const intptr_t reason = |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 const Function& function, bool optimized) { | 320 const Function& function, bool optimized) { |
| 321 const char* function_fullname = function.ToFullyQualifiedCString(); | 321 const char* function_fullname = function.ToFullyQualifiedCString(); |
| 322 const Code& code = Code::Handle(function.unoptimized_code()); | 322 const Code& code = Code::Handle(function.unoptimized_code()); |
| 323 DisassembleCodeHelper(function_fullname, code, optimized); | 323 DisassembleCodeHelper(function_fullname, code, optimized); |
| 324 } | 324 } |
| 325 | 325 |
| 326 | 326 |
| 327 #endif // !PRODUCT | 327 #endif // !PRODUCT |
| 328 | 328 |
| 329 } // namespace dart | 329 } // namespace dart |
| OLD | NEW |