Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1304)

Side by Side Diff: runtime/vm/disassembler_ia32.cc

Issue 817823002: Add inlining ranges/intervals to code objects so that we can map a pc to the inlined stack. The map… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/disassembler_arm64.cc ('k') | runtime/vm/disassembler_mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1827 matching lines...) Expand 10 before | Expand all | Expand 10 after
1838 OS::SNPrint(&hex_buffer[hex_index], remaining_size, "%02x", pc_ptr[i]); 1838 OS::SNPrint(&hex_buffer[hex_index], remaining_size, "%02x", pc_ptr[i]);
1839 hex_index += 2; 1839 hex_index += 2;
1840 remaining_size -= 2; 1840 remaining_size -= 2;
1841 } 1841 }
1842 hex_buffer[hex_index] = '\0'; 1842 hex_buffer[hex_index] = '\0';
1843 if (out_instr_len) { 1843 if (out_instr_len) {
1844 *out_instr_len = instruction_length; 1844 *out_instr_len = instruction_length;
1845 } 1845 }
1846 } 1846 }
1847 1847
1848
1849 void Disassembler::Disassemble(uword start,
1850 uword end,
1851 DisassemblyFormatter* formatter,
1852 const Code::Comments& comments) {
1853 ASSERT(formatter != NULL);
1854 char hex_buffer[kHexadecimalBufferSize]; // Instruction in hexadecimal form.
1855 char human_buffer[kUserReadableBufferSize]; // Human-readable instruction.
1856 uword pc = start;
1857 intptr_t comment_finger = 0;
1858 while (pc < end) {
1859 const intptr_t offset = pc - start;
1860 while (comment_finger < comments.Length() &&
1861 comments.PCOffsetAt(comment_finger) <= offset) {
1862 formatter->Print(
1863 " ;; %s\n",
1864 String::Handle(comments.CommentAt(comment_finger)).ToCString());
1865 comment_finger++;
1866 }
1867 int instruction_length;
1868 DecodeInstruction(hex_buffer,
1869 sizeof(hex_buffer),
1870 human_buffer,
1871 sizeof(human_buffer),
1872 &instruction_length, pc);
1873 formatter->ConsumeInstruction(hex_buffer,
1874 sizeof(hex_buffer),
1875 human_buffer,
1876 sizeof(human_buffer),
1877 pc);
1878 pc += instruction_length;
1879 }
1880
1881 return;
1882 }
1883
1884 } // namespace dart 1848 } // namespace dart
1885 1849
1886 #endif // defined TARGET_ARCH_IA32 1850 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/disassembler_arm64.cc ('k') | runtime/vm/disassembler_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698