Chromium Code Reviews| Index: src/IceAssemblerARM32.h |
| diff --git a/src/IceAssemblerARM32.h b/src/IceAssemblerARM32.h |
| index 0dbff60651726a193515416843a116c8acc6a353..ff1e6ee553600c09be7ea865d985534565f97c9a 100644 |
| --- a/src/IceAssemblerARM32.h |
| +++ b/src/IceAssemblerARM32.h |
| @@ -114,12 +114,10 @@ public: |
| void alignFunction() override { |
| const SizeT Align = 1 << getBundleAlignLog2Bytes(); |
| SizeT BytesNeeded = Utils::OffsetToAlignment(Buffer.getPosition(), Align); |
| - constexpr IValueT UndefinedInst = 0xe7fedef0; // udf #60896 |
| constexpr SizeT InstSize = sizeof(IValueT); |
| assert(BytesNeeded % InstARM32::InstSize == 0); |
| while (BytesNeeded > 0) { |
| - AssemblerBuffer::EnsureCapacity ensured(&Buffer); |
| - emitInst(UndefinedInst); |
| + trap(); |
| BytesNeeded -= InstSize; |
| } |
| } |
| @@ -129,10 +127,7 @@ public: |
| const char *getAlignDirective() const override { return ".p2alignl"; } |
| llvm::ArrayRef<uint8_t> getNonExecBundlePadding() const override { |
| - // Use a particular UDF encoding -- TRAPNaCl in LLVM: 0xE7FEDEF0 |
| - // http://llvm.org/viewvc/llvm-project?view=revision&revision=173943 |
| - static const uint8_t Padding[] = {0xE7, 0xFE, 0xDE, 0xF0}; |
| - return llvm::ArrayRef<uint8_t>(Padding, 4); |
| + return llvm::ArrayRef<uint8_t>(TrapInst, 4); |
|
Jim Stichnoth
2015/12/11 23:31:08
Can you move the implementation into the .cpp file
Karl
2015/12/17 16:23:09
Done.
|
| } |
| void padWithNop(intptr_t Padding) override; |
| @@ -287,6 +282,8 @@ public: |
| // Implements sxtb/sxth depending on type of OpSrc0. |
| void sxt(const Operand *OpRd, const Operand *OpSrc0, CondARM32::Cond Cond); |
| + void trap(); |
| + |
| void tst(const Operand *OpRn, const Operand *OpSrc1, CondARM32::Cond Cond); |
| void udiv(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1, |
| @@ -313,6 +310,8 @@ private: |
| // Number of bytes emitted by InstARM32::emit() methods, when run inside |
| // InstARM32::emitUsingTextFixup(). |
| size_t EmitTextSize = 0; |
| + // Trap instruction (defined in textual byte order). |
|
Jim Stichnoth
2015/12/11 23:31:08
"textual"? Maybe "little-endian" instead?
Karl
2015/12/17 16:23:09
Done.
|
| + static const uint8_t TrapInst[]; |
| // Load/store multiple addressing mode. |
| enum BlockAddressMode { |