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

Issue 1519873003: Add trap (an UDF instruction) to the ARM integrated Assembler. (Closed)

Created:
5 years ago by Karl
Modified:
5 years ago
Reviewers:
Jim Stichnoth, sehr, John
CC:
native-client-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Add trap (an UDF instruction) to the ARM integrated Assembler. Uses the same UDF instruction as used for function alignment. BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4334 R=stichnot@chromium.org Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=7de2435074e6f1c29089034e0ae537a9b1f01897

Patch Set 1 #

Total comments: 8

Patch Set 2 : Fix issues from last patch. #

Total comments: 2

Patch Set 3 : Clean up modeling of trap instruction. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+25 lines, -9 lines) Patch
M src/IceAssemblerARM32.h View 1 2 3 chunks +4 lines, -9 lines 0 comments Download
M src/IceAssemblerARM32.cpp View 1 2 1 chunk +21 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (3 generated)
Karl
5 years ago (2015-12-11 22:13:40 UTC) #3
Jim Stichnoth
https://codereview.chromium.org/1519873003/diff/1/src/IceAssemblerARM32.cpp File src/IceAssemblerARM32.cpp (right): https://codereview.chromium.org/1519873003/diff/1/src/IceAssemblerARM32.cpp#newcode1721 src/IceAssemblerARM32.cpp:1721: const uint8_t AssemblerARM32::TrapInst[4] = {0xE7, 0xFE, 0xDE, 0xF0}; I ...
5 years ago (2015-12-11 23:31:08 UTC) #4
Karl
https://codereview.chromium.org/1519873003/diff/1/src/IceAssemblerARM32.cpp File src/IceAssemblerARM32.cpp (right): https://codereview.chromium.org/1519873003/diff/1/src/IceAssemblerARM32.cpp#newcode1721 src/IceAssemblerARM32.cpp:1721: const uint8_t AssemblerARM32::TrapInst[4] = {0xE7, 0xFE, 0xDE, 0xF0}; On ...
5 years ago (2015-12-17 16:23:09 UTC) #5
Jim Stichnoth
lgtm https://codereview.chromium.org/1519873003/diff/20001/src/IceAssemblerARM32.cpp File src/IceAssemblerARM32.cpp (right): https://codereview.chromium.org/1519873003/diff/20001/src/IceAssemblerARM32.cpp#newcode1886 src/IceAssemblerARM32.cpp:1886: for (size_t i = llvm::array_lengthof(TrapInst); i > 0; ...
5 years ago (2015-12-17 16:41:00 UTC) #6
Karl
Committed patchset #3 (id:40001) manually as 7de2435074e6f1c29089034e0ae537a9b1f01897 (presubmit successful).
5 years ago (2015-12-17 16:55:14 UTC) #8
Karl
5 years ago (2015-12-17 16:55:28 UTC) #9
Message was sent while issue was closed.
https://codereview.chromium.org/1519873003/diff/20001/src/IceAssemblerARM32.cpp
File src/IceAssemblerARM32.cpp (right):

https://codereview.chromium.org/1519873003/diff/20001/src/IceAssemblerARM32.c...
src/IceAssemblerARM32.cpp:1886: for (size_t i = llvm::array_lengthof(TrapInst);
i > 0; --i) {
On 2015/12/17 16:41:00, stichnot wrote:
> Actually, one more (optional) idea that adds a lot more clarity, I think
(though
> at the cost of minor efficiency):
> 
>   auto Bytes = getNonExecBundlePadding();
>   for (const uint8_t &Byte : reverse_range(Bytes)) {
>     Buffer.emit<uint8_t>(Byte);
>   }
> 
> To address the efficiency issue, here's another version that could probably
use
> a bit more cleanup:
> 
> namespace {
> const uint8_t TrapBytesRaw[] = {0xE7, 0xFE, 0xDE, 0xF0};
> const auto TrapBytes =
>   llvm::ArrayRef<uint8_t>(TrapBytesRaw, llvm::array_lengthof(TrapBytesRaw));
> } // end of anonymous namespace
> 
> llvm::ArrayRef<uint8_t> AssemblerARM32::getNonExecBundlePadding() const {
>   return TrapBytes;
> }
> 
> void AssemblerARM32::trap() {
>   AssemblerBuffer::EnsureCapacity ensured(&Buffer);
>   for (const uint8_t &Byte : reverse_range(TrapBytes)) {
>     Buffer.emit<uint8_t>(Byte);
>   }
> }

Done.

Powered by Google App Engine
This is Rietveld 408576698