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

Unified Diff: runtime/vm/disassembler_ia32.cc

Issue 1176703002: Make guard_cid and nullable_cid half words. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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/assembler_x64.cc ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/disassembler_ia32.cc
diff --git a/runtime/vm/disassembler_ia32.cc b/runtime/vm/disassembler_ia32.cc
index b933302124fea19d28e32829e49cd9c6d72eb892..c3b1d562692b9c7c789d7075189af96a9d2539e6 100644
--- a/runtime/vm/disassembler_ia32.cc
+++ b/runtime/vm/disassembler_ia32.cc
@@ -347,7 +347,7 @@ class X86Decoder : public ValueObject {
int PrintRightXmmOperand(uint8_t* modrmp);
int PrintRightByteOperand(uint8_t* modrmp);
int PrintOperands(const char* mnem, OperandOrder op_order, uint8_t* data);
- int PrintImmediateOp(uint8_t* data);
+ int PrintImmediateOp(uint8_t* data, bool size_override = false);
// Handle special encodings.
int JumpShort(uint8_t* data);
@@ -711,7 +711,7 @@ int X86Decoder::PrintOperands(const char* mnem,
}
-int X86Decoder::PrintImmediateOp(uint8_t* data) {
+int X86Decoder::PrintImmediateOp(uint8_t* data, bool size_override) {
bool sign_extension_bit = (*data & 0x02) != 0;
uint8_t modrm = *(data+1);
int mod, regop, rm;
@@ -729,14 +729,21 @@ int X86Decoder::PrintImmediateOp(uint8_t* data) {
default: UNIMPLEMENTED();
}
Print(mnem);
+ if (size_override) {
+ Print("_w");
+ } else if (sign_extension_bit) {
+ Print("_b");
+ }
Print(" ");
int count = PrintRightOperand(data+1);
- if (sign_extension_bit) {
- Print(",");
+ Print(",");
+ if (size_override) {
+ PrintHex(*reinterpret_cast<int16_t*>(data + 1 + count));
+ return 1 + count + 2 /*int16_t*/;
+ } else if (sign_extension_bit) {
PrintHex(*(data + 1 + count));
- return 1 + count + 1 /*int8*/;
+ return 1 + count + 1 /*int8_t*/;
} else {
- Print(",");
PrintHex(*reinterpret_cast<int32_t*>(data + 1 + count));
return 1 + count + 4 /*int32_t*/;
}
@@ -1677,8 +1684,26 @@ int X86Decoder::InstructionDecode(uword pc) {
Print("]");
data++;
} else {
- UNIMPLEMENTED();
+ UNIMPLEMENTED();
}
+ } else if (*data == 0x3B) {
+ data++;
+ Print("cmp_w ");
+ int mod, regop, rm;
+ GetModRm(*data, &mod, &regop, &rm);
+ PrintCPURegister(regop);
+ Print(",");
+ data += PrintRightOperand(data);
+ } else if ((*data == 0x81) || (*data == 0x83)) {
+ data += PrintImmediateOp(data, true /* size_override */);
+ } else if (*data == 0xC7) {
+ data++;
+ Print("mov_w ");
+ data += PrintRightOperand(data);
+ int16_t imm = *reinterpret_cast<int16_t*>(data);
+ Print(",");
+ PrintHex(imm);
+ data += 2;
} else if (*data == 0x90) {
data++;
Print("nop");
« no previous file with comments | « runtime/vm/assembler_x64.cc ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698