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

Unified Diff: src/IceTargetLoweringX8632Traits.h

Issue 1428443002: Enhance address mode recovery (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fixed relocation being attached to the wrong location. Created 5 years, 2 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
Index: src/IceTargetLoweringX8632Traits.h
diff --git a/src/IceTargetLoweringX8632Traits.h b/src/IceTargetLoweringX8632Traits.h
index 918a5852b9d514585cd248930b78628026c6ff8e..ba339bcf991da717e5f515324d9517ee3e4f8aec 100644
--- a/src/IceTargetLoweringX8632Traits.h
+++ b/src/IceTargetLoweringX8632Traits.h
@@ -182,7 +182,7 @@ template <> struct MachineTraits<TargetX8632> {
return *this;
}
- Address(GPRRegister base, int32_t disp) {
+ Address(GPRRegister base, int32_t disp, AssemblerFixup *fixup = nullptr) {
Jim Stichnoth 2015/10/27 05:52:34 Maybe we can make fixup a required parameter, rath
sehr 2015/10/27 21:48:00 Done.
if (disp == 0 && base != RegX8632::Encoded_Reg_ebp) {
SetModRM(0, base);
if (base == RegX8632::Encoded_Reg_esp)
@@ -192,23 +192,29 @@ template <> struct MachineTraits<TargetX8632> {
if (base == RegX8632::Encoded_Reg_esp)
SetSIB(TIMES_1, RegX8632::Encoded_Reg_esp, base);
SetDisp8(disp);
+ // TODO(sehr): determine if there are 8-bit relocations.
Jim Stichnoth 2015/10/27 13:57:10 Here and in the TODO below, if there is a fixup, I
Jim Stichnoth 2015/10/27 13:57:10 One separate note on these fixups. It seems that
sehr 2015/10/27 21:48:00 Agreed, and that fixed my other bug. Thanks!
sehr 2015/10/27 21:48:00 Added flag/assertions in IceFixups.h
} else {
SetModRM(2, base);
if (base == RegX8632::Encoded_Reg_esp)
SetSIB(TIMES_1, RegX8632::Encoded_Reg_esp, base);
SetDisp32(disp);
+ if (fixup)
+ SetFixup(fixup);
}
}
- Address(GPRRegister index, ScaleFactor scale, int32_t disp) {
+ Address(GPRRegister index, ScaleFactor scale, int32_t disp,
+ AssemblerFixup *fixup = nullptr) {
assert(index != RegX8632::Encoded_Reg_esp); // Illegal addressing mode.
SetModRM(0, RegX8632::Encoded_Reg_esp);
SetSIB(scale, index, RegX8632::Encoded_Reg_ebp);
SetDisp32(disp);
+ if (fixup)
+ SetFixup(fixup);
}
Address(GPRRegister base, GPRRegister index, ScaleFactor scale,
- int32_t disp) {
+ int32_t disp, AssemblerFixup *fixup = nullptr) {
assert(index != RegX8632::Encoded_Reg_esp); // Illegal addressing mode.
if (disp == 0 && base != RegX8632::Encoded_Reg_ebp) {
SetModRM(0, RegX8632::Encoded_Reg_esp);
@@ -217,10 +223,13 @@ template <> struct MachineTraits<TargetX8632> {
SetModRM(1, RegX8632::Encoded_Reg_esp);
SetSIB(scale, index, base);
SetDisp8(disp);
+ // TODO(sehr): determine if there are 8-bit relocations.
} else {
SetModRM(2, RegX8632::Encoded_Reg_esp);
SetSIB(scale, index, base);
SetDisp32(disp);
+ if (fixup)
+ SetFixup(fixup);
}
}

Powered by Google App Engine
This is Rietveld 408576698