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

Unified Diff: runtime/vm/disassembler_dbc.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/disassembler_arm64.cc ('k') | runtime/vm/disassembler_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/disassembler_dbc.cc
diff --git a/runtime/vm/disassembler_dbc.cc b/runtime/vm/disassembler_dbc.cc
index 5c8b3a0038ac22f3bcc725068ebfe6e702caa9fe..a2095a0d80a5c02ea5eb3bf06414d0b77dfe6c73 100644
--- a/runtime/vm/disassembler_dbc.cc
+++ b/runtime/vm/disassembler_dbc.cc
@@ -10,6 +10,7 @@
#include "platform/assert.h"
#include "vm/constants_dbc.h"
#include "vm/cpu.h"
+#include "vm/instructions.h"
namespace dart {
@@ -214,6 +215,8 @@ void Disassembler::DecodeInstruction(char* hex_buffer,
char* human_buffer,
intptr_t human_size,
int* out_instr_size,
+ const Code& code,
+ Object** object,
uword pc) {
const uint32_t instr = *reinterpret_cast<uint32_t*>(pc);
const uint8_t opcode = instr & 0xFF;
@@ -229,6 +232,14 @@ void Disassembler::DecodeInstruction(char* hex_buffer,
if (out_instr_size) {
*out_instr_size = sizeof(uint32_t);
}
+
+ *object = NULL;
+ if (!code.IsNull()) {
+ *object = &Object::Handle();
+ if (!DecodeLoadObjectFromPoolOrThread(pc, code, *object)) {
+ *object = NULL;
+ }
+ }
}
« no previous file with comments | « runtime/vm/disassembler_arm64.cc ('k') | runtime/vm/disassembler_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698