summaryrefslogtreecommitdiff
path: root/compiler/utils/assembler.h
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2016-08-31 13:17:44 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2016-08-31 13:17:44 +0000
commit081e7a16c4fcbdb014441a236e12f58eb89ff99a (patch)
treef945770e21ebaf4a133118d6617459407fb35f49 /compiler/utils/assembler.h
parentd707979dd4b03207a798870e2e0658b1f1522bd3 (diff)
parent57eb0f58419e0e6773f69cf6e0c78e5fed0464cd (diff)
Merge "MIPS32: Fill branch delay slots"
Diffstat (limited to 'compiler/utils/assembler.h')
-rw-r--r--compiler/utils/assembler.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/utils/assembler.h b/compiler/utils/assembler.h
index 8981776314..b616057e79 100644
--- a/compiler/utils/assembler.h
+++ b/compiler/utils/assembler.h
@@ -362,6 +362,16 @@ class Assembler : public DeletableArenaObject<kArenaAllocAssembler> {
// Size of generated code
virtual size_t CodeSize() const { return buffer_.Size(); }
virtual const uint8_t* CodeBufferBaseAddress() const { return buffer_.contents(); }
+ // CodePosition() is a non-const method similar to CodeSize(), which is used to
+ // record positions within the code buffer for the purpose of signal handling
+ // (stack overflow checks and implicit null checks may trigger signals and the
+ // signal handlers expect them right before the recorded positions).
+ // On most architectures CodePosition() should be equivalent to CodeSize(), but
+ // the MIPS assembler needs to be aware of this recording, so it doesn't put
+ // the instructions that can trigger signals into branch delay slots. Handling
+ // signals from instructions in delay slots is a bit problematic and should be
+ // avoided.
+ virtual size_t CodePosition() { return CodeSize(); }
// Copy instructions out of assembly buffer into the given region of memory
virtual void FinalizeInstructions(const MemoryRegion& region) {