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_X64) | 8 #if defined(TARGET_ARCH_X64) |
9 #include "platform/utils.h" | 9 #include "platform/utils.h" |
10 #include "vm/allocation.h" | 10 #include "vm/allocation.h" |
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 return chars; | 800 return chars; |
801 } | 801 } |
802 | 802 |
803 | 803 |
804 void DisassemblerX64::AppendAddressToBuffer(uint8_t* addr_byte_ptr) { | 804 void DisassemblerX64::AppendAddressToBuffer(uint8_t* addr_byte_ptr) { |
805 NoGCScope no_gc; | 805 NoGCScope no_gc; |
806 uword addr = reinterpret_cast<uword>(addr_byte_ptr); | 806 uword addr = reinterpret_cast<uword>(addr_byte_ptr); |
807 AppendToBuffer("%#" Px "", addr); | 807 AppendToBuffer("%#" Px "", addr); |
808 // Try to print as heap object or stub name | 808 // Try to print as heap object or stub name |
809 if (((addr & kSmiTagMask) == kHeapObjectTag) && | 809 if (((addr & kSmiTagMask) == kHeapObjectTag) && |
| 810 reinterpret_cast<RawObject*>(addr)->IsOldObject() && |
810 !Isolate::Current()->heap()->CodeContains(addr) && | 811 !Isolate::Current()->heap()->CodeContains(addr) && |
811 Isolate::Current()->heap()->Contains(addr - kHeapObjectTag)) { | 812 Disassembler::CanFindOldObject(addr)) { |
812 const Object& obj = Object::Handle(reinterpret_cast<RawObject*>(addr)); | 813 const Object& obj = Object::Handle(reinterpret_cast<RawObject*>(addr)); |
813 if (obj.IsArray()) { | 814 if (obj.IsArray()) { |
814 const Array& arr = Array::Cast(obj); | 815 const Array& arr = Array::Cast(obj); |
815 intptr_t len = arr.Length(); | 816 intptr_t len = arr.Length(); |
816 if (len > 5) len = 5; // Print a max of 5 elements. | 817 if (len > 5) len = 5; // Print a max of 5 elements. |
817 AppendToBuffer(" Array["); | 818 AppendToBuffer(" Array["); |
818 int i = 0; | 819 int i = 0; |
819 Object& element = Object::Handle(); | 820 Object& element = Object::Handle(); |
820 while (i < len) { | 821 while (i < len) { |
821 element = arr.At(i); | 822 element = arr.At(i); |
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1938 pc); | 1939 pc); |
1939 pc += instruction_length; | 1940 pc += instruction_length; |
1940 } | 1941 } |
1941 | 1942 |
1942 return; | 1943 return; |
1943 } | 1944 } |
1944 | 1945 |
1945 } // namespace dart | 1946 } // namespace dart |
1946 | 1947 |
1947 #endif // defined TARGET_ARCH_X64 | 1948 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |