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

Unified Diff: src/IceAssemblerARM32.cpp

Issue 1511653002: Fix problems with sandboxing and the ARM integrated assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: src/IceAssemblerARM32.cpp
diff --git a/src/IceAssemblerARM32.cpp b/src/IceAssemblerARM32.cpp
index d06ee7b6ddb4d41458101a6bea5e4c0f3d9363a6..421a3dee051cd264ea4193e7670043ed8233d5da 100644
--- a/src/IceAssemblerARM32.cpp
+++ b/src/IceAssemblerARM32.cpp
@@ -460,6 +460,14 @@ size_t BlRelocatableFixup::emit(GlobalContext *Ctx,
return InstARM32::InstSize;
}
+void AssemblerARM32::padWithNop(intptr_t Padding) {
+ constexpr intptr_t InstWidth = sizeof(IValueT);
+ assert(Padding % InstWidth == 0 &&
+ "Padding not mulitple of instruction size");
Jim Stichnoth 2015/12/08 19:54:58 multiple
Karl 2015/12/08 20:49:36 Done.
+ for (intptr_t i = 0; i < Padding; i += InstWidth)
+ nop();
+}
+
BlRelocatableFixup *
AssemblerARM32::createBlFixup(const ConstantRelocatable *BlTarget) {
BlRelocatableFixup *F =
@@ -651,7 +659,7 @@ void AssemblerARM32::emitBranch(Label *L, CondARM32::Cond Cond, bool Link) {
const IOffsetT Position = Buffer.size();
// Use the offset field of the branch instruction for linking the sites.
emitType05(Cond, L->getEncodedPosition(), Link, BranchName);
- if (!needsTextFixup())
+ if (!needsTextFixup() && !getPreliminary())
Jim Stichnoth 2015/12/08 20:52:27 This is clearly a problem that affects all assembl
Karl 2015/12/08 21:38:11 Moved check inside linkTo() and nearLinkTo(). Code
L->linkTo(Position);
}
@@ -1272,6 +1280,17 @@ void AssemblerARM32::mvn(const Operand *OpRd, const Operand *OpSrc,
MvnName);
}
+void AssemblerARM32::nop(CondARM32::Cond Cond) {
+ // NOP - Section A8.8.119, encoding A1:
+ // nop<c>
+ //
+ // cccc0011001000001111000000000000 where cccc=Cond.
+ AssemblerBuffer::EnsureCapacity ensured(&Buffer);
+ const IValueT Encoding = (encodeCondition(Cond) << kConditionShift) |
+ (B25 | B24 | B21 | B15 | B14 | B13 | B12);
+ emitInst(Encoding);
+}
+
void AssemblerARM32::sbc(const Operand *OpRd, const Operand *OpRn,
const Operand *OpSrc1, bool SetFlags,
CondARM32::Cond Cond) {
@@ -1365,7 +1384,6 @@ void AssemblerARM32::str(const Operand *OpRt, const Operand *OpAddress,
// iiiiiiiiiiii=imm12, u=1 if +.
constexpr bool IsByte = false;
return emitMemOp(Cond, IsLoad, IsByte, Rt, OpAddress, TInfo, StrName);
John 2015/12/08 19:45:04 Optional: I know the language allows to return a v
Jim Stichnoth 2015/12/08 19:54:58 This pattern of returning a void expression was su
Karl 2015/12/08 19:58:35 I mainly started doing this because it was much ea
Karl 2015/12/08 20:49:36 Removing returns of this form.
- return setNeedsTextFixup();
}
}
}

Powered by Google App Engine
This is Rietveld 408576698