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

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

Issue 2160343003: Use the Code's pointer offsets to find object references when disassembling IA32. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: . Created 4 years, 5 months 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
« no previous file with comments | « runtime/vm/disassembler_arm.cc ('k') | runtime/vm/disassembler_dbc.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 #include "vm/instructions.h"
10 11
11 namespace dart { 12 namespace dart {
12 13
13 #ifndef PRODUCT 14 #ifndef PRODUCT
14 15
15 class ARM64Decoder : public ValueObject { 16 class ARM64Decoder : public ValueObject {
16 public: 17 public:
17 ARM64Decoder(char* buffer, size_t buffer_size) 18 ARM64Decoder(char* buffer, size_t buffer_size)
18 : buffer_(buffer), 19 : buffer_(buffer),
19 buffer_size_(buffer_size), 20 buffer_size_(buffer_size),
(...skipping 1461 matching lines...) Expand 10 before | Expand all | Expand 10 after
1481 } else if (instr->IsDPSimd2Op()) { 1482 } else if (instr->IsDPSimd2Op()) {
1482 DecodeDPSimd2(instr); 1483 DecodeDPSimd2(instr);
1483 } else { 1484 } else {
1484 Unknown(instr); 1485 Unknown(instr);
1485 } 1486 }
1486 } 1487 }
1487 1488
1488 1489
1489 void Disassembler::DecodeInstruction(char* hex_buffer, intptr_t hex_size, 1490 void Disassembler::DecodeInstruction(char* hex_buffer, intptr_t hex_size,
1490 char* human_buffer, intptr_t human_size, 1491 char* human_buffer, intptr_t human_size,
1491 int* out_instr_size, uword pc) { 1492 int* out_instr_size, const Code& code,
1493 Object** object, uword pc) {
1492 ARM64Decoder decoder(human_buffer, human_size); 1494 ARM64Decoder decoder(human_buffer, human_size);
1493 decoder.InstructionDecode(pc); 1495 decoder.InstructionDecode(pc);
1494 int32_t instruction_bits = Instr::At(pc)->InstructionBits(); 1496 int32_t instruction_bits = Instr::At(pc)->InstructionBits();
1495 OS::SNPrint(hex_buffer, hex_size, "%08x", instruction_bits); 1497 OS::SNPrint(hex_buffer, hex_size, "%08x", instruction_bits);
1496 if (out_instr_size) { 1498 if (out_instr_size) {
1497 *out_instr_size = Instr::kInstrSize; 1499 *out_instr_size = Instr::kInstrSize;
1498 } 1500 }
1501
1502 *object = NULL;
1503 if (!code.IsNull()) {
1504 *object = &Object::Handle();
1505 if (!DecodeLoadObjectFromPoolOrThread(pc, code, *object)) {
1506 *object = NULL;
1507 }
1508 }
1499 } 1509 }
1500 1510
1501 #endif // !PRODUCT 1511 #endif // !PRODUCT
1502 1512
1503 } // namespace dart 1513 } // namespace dart
1504 1514
1505 #endif // defined TARGET_ARCH_ARM 1515 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/disassembler_arm.cc ('k') | runtime/vm/disassembler_dbc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698