| OLD | NEW |
| 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 "vm/disassembler.h" | 5 #include "vm/disassembler.h" |
| 6 | 6 |
| 7 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. | 7 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
| 8 #if defined(TARGET_ARCH_IA32) | 8 #if defined(TARGET_ARCH_IA32) |
| 9 #include "platform/utils.h" | 9 #include "platform/utils.h" |
| 10 #include "vm/allocation.h" | 10 #include "vm/allocation.h" |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 } | 465 } |
| 466 | 466 |
| 467 | 467 |
| 468 void X86Decoder::PrintAddress(uword addr) { | 468 void X86Decoder::PrintAddress(uword addr) { |
| 469 NoGCScope no_gc; | 469 NoGCScope no_gc; |
| 470 char addr_buffer[32]; | 470 char addr_buffer[32]; |
| 471 OS::SNPrint(addr_buffer, sizeof(addr_buffer), "%#" Px "", addr); | 471 OS::SNPrint(addr_buffer, sizeof(addr_buffer), "%#" Px "", addr); |
| 472 Print(addr_buffer); | 472 Print(addr_buffer); |
| 473 // Try to print as heap object or stub name | 473 // Try to print as heap object or stub name |
| 474 if (((addr & kSmiTagMask) == kHeapObjectTag) && | 474 if (((addr & kSmiTagMask) == kHeapObjectTag) && |
| 475 reinterpret_cast<RawObject*>(addr)->IsOldObject() && |
| 475 !Isolate::Current()->heap()->CodeContains(addr) && | 476 !Isolate::Current()->heap()->CodeContains(addr) && |
| 476 Isolate::Current()->heap()->Contains(addr - kHeapObjectTag)) { | 477 Disassembler::CanFindOldObject(addr)) { |
| 477 const Object& obj = Object::Handle(reinterpret_cast<RawObject*>(addr)); | 478 const Object& obj = Object::Handle(reinterpret_cast<RawObject*>(addr)); |
| 478 if (obj.IsArray()) { | 479 if (obj.IsArray()) { |
| 479 const Array& arr = Array::Cast(obj); | 480 const Array& arr = Array::Cast(obj); |
| 480 intptr_t len = arr.Length(); | 481 intptr_t len = arr.Length(); |
| 481 if (len > 5) len = 5; // Print a max of 5 elements. | 482 if (len > 5) len = 5; // Print a max of 5 elements. |
| 482 Print(" Array["); | 483 Print(" Array["); |
| 483 int i = 0; | 484 int i = 0; |
| 484 Object& element = Object::Handle(); | 485 Object& element = Object::Handle(); |
| 485 while (i < len) { | 486 while (i < len) { |
| 486 element = arr.At(i); | 487 element = arr.At(i); |
| (...skipping 1335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1822 pc); | 1823 pc); |
| 1823 pc += instruction_length; | 1824 pc += instruction_length; |
| 1824 } | 1825 } |
| 1825 | 1826 |
| 1826 return; | 1827 return; |
| 1827 } | 1828 } |
| 1828 | 1829 |
| 1829 } // namespace dart | 1830 } // namespace dart |
| 1830 | 1831 |
| 1831 #endif // defined TARGET_ARCH_IA32 | 1832 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |