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

Side by Side Diff: runtime/vm/disassembler_arm64.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_arm.cc ('k') | runtime/vm/disassembler_ia32.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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_ARM64. 7 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64.
8 #if defined(TARGET_ARCH_ARM64) 8 #if defined(TARGET_ARCH_ARM64)
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 10
(...skipping 1417 matching lines...) Expand 10 before | Expand all | Expand 10 after
1428 int* out_instr_size, uword pc) { 1428 int* out_instr_size, uword pc) {
1429 ARM64Decoder decoder(human_buffer, human_size); 1429 ARM64Decoder decoder(human_buffer, human_size);
1430 decoder.InstructionDecode(pc); 1430 decoder.InstructionDecode(pc);
1431 int32_t instruction_bits = Instr::At(pc)->InstructionBits(); 1431 int32_t instruction_bits = Instr::At(pc)->InstructionBits();
1432 OS::SNPrint(hex_buffer, hex_size, "%08x", instruction_bits); 1432 OS::SNPrint(hex_buffer, hex_size, "%08x", instruction_bits);
1433 if (out_instr_size) { 1433 if (out_instr_size) {
1434 *out_instr_size = Instr::kInstrSize; 1434 *out_instr_size = Instr::kInstrSize;
1435 } 1435 }
1436 } 1436 }
1437 1437
1438
1439 void Disassembler::Disassemble(uword start,
1440 uword end,
1441 DisassemblyFormatter* formatter,
1442 const Code::Comments& comments) {
1443 ASSERT(formatter != NULL);
1444 char hex_buffer[kHexadecimalBufferSize]; // Instruction in hexadecimal form.
1445 char human_buffer[kUserReadableBufferSize]; // Human-readable instruction.
1446 uword pc = start;
1447 intptr_t comment_finger = 0;
1448 while (pc < end) {
1449 const intptr_t offset = pc - start;
1450 while (comment_finger < comments.Length() &&
1451 comments.PCOffsetAt(comment_finger) <= offset) {
1452 formatter->Print(
1453 " ;; %s\n",
1454 String::Handle(comments.CommentAt(comment_finger)).ToCString());
1455 comment_finger++;
1456 }
1457 int instruction_length;
1458 DecodeInstruction(hex_buffer, sizeof(hex_buffer),
1459 human_buffer, sizeof(human_buffer),
1460 &instruction_length, pc);
1461
1462 formatter->ConsumeInstruction(hex_buffer,
1463 sizeof(hex_buffer),
1464 human_buffer,
1465 sizeof(human_buffer),
1466 pc);
1467 pc += instruction_length;
1468 }
1469 }
1470
1471 } // namespace dart 1438 } // namespace dart
1472 1439
1473 #endif // defined TARGET_ARCH_ARM 1440 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/disassembler_arm.cc ('k') | runtime/vm/disassembler_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698