| 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/globals.h" // Needed here to get TARGET_ARCH_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
| 6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 7 | 7 |
| 8 #include "vm/disassembler.h" | 8 #include "vm/disassembler.h" |
| 9 | 9 |
| 10 #include "vm/allocation.h" | 10 #include "vm/allocation.h" |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 char addr_buffer[32]; | 391 char addr_buffer[32]; |
| 392 OS::SNPrint(addr_buffer, sizeof(addr_buffer), "%p", addr); | 392 OS::SNPrint(addr_buffer, sizeof(addr_buffer), "%p", addr); |
| 393 Print(addr_buffer); | 393 Print(addr_buffer); |
| 394 // Try to print as heap object or stub name | 394 // Try to print as heap object or stub name |
| 395 if (!Isolate::Current()->heap()->CodeContains(addr) && | 395 if (!Isolate::Current()->heap()->CodeContains(addr) && |
| 396 Isolate::Current()->heap()->Contains(addr - kHeapObjectTag)) { | 396 Isolate::Current()->heap()->Contains(addr - kHeapObjectTag)) { |
| 397 Object& obj = Object::Handle(reinterpret_cast<RawObject*>(addr)); | 397 Object& obj = Object::Handle(reinterpret_cast<RawObject*>(addr)); |
| 398 if (obj.IsArray()) { | 398 if (obj.IsArray()) { |
| 399 const Array& arr = Array::CheckedHandle(obj.raw()); | 399 const Array& arr = Array::CheckedHandle(obj.raw()); |
| 400 intptr_t len = arr.Length(); | 400 intptr_t len = arr.Length(); |
| 401 if (len > 5) len = 5; // At max print first 5 elements. | 401 if (len > 5) len = 5; // Print a max of 5 elements. |
| 402 Print(" Array["); | 402 Print(" Array["); |
| 403 int i = 0; | 403 int i = 0; |
| 404 while (i < len) { | 404 while (i < len) { |
| 405 obj = arr.At(i); | 405 obj = arr.At(i); |
| 406 if (i > 0) Print(", "); | 406 if (i > 0) Print(", "); |
| 407 Print(obj.ToCString()); | 407 Print(obj.ToCString()); |
| 408 i++; | 408 i++; |
| 409 } | 409 } |
| 410 if (i < arr.Length()) Print(", ..."); | 410 if (i < arr.Length()) Print(", ..."); |
| 411 Print("]"); | 411 Print("]"); |
| (...skipping 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1521 | 1521 |
| 1522 const char* Disassembler::RegisterName(Register reg) { | 1522 const char* Disassembler::RegisterName(Register reg) { |
| 1523 ASSERT(0 <= reg); | 1523 ASSERT(0 <= reg); |
| 1524 ASSERT(reg < kMaxCPURegisters); | 1524 ASSERT(reg < kMaxCPURegisters); |
| 1525 return (cpu_regs[reg]); | 1525 return (cpu_regs[reg]); |
| 1526 } | 1526 } |
| 1527 | 1527 |
| 1528 } // namespace dart | 1528 } // namespace dart |
| 1529 | 1529 |
| 1530 #endif // defined TARGET_ARCH_IA32 | 1530 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |