diff options
Diffstat (limited to 'compiler/utils/assembler.h')
-rw-r--r-- | compiler/utils/assembler.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/compiler/utils/assembler.h b/compiler/utils/assembler.h index 63747bee58..f3fa711dbb 100644 --- a/compiler/utils/assembler.h +++ b/compiler/utils/assembler.h @@ -163,9 +163,8 @@ class AssemblerBuffer { uint8_t* contents() const { return contents_; } - // Copy the assembled instructions into the specified memory block - // and apply all fixups. - void FinalizeInstructions(const MemoryRegion& region); + // Copy the assembled instructions into the specified memory block. + void CopyInstructions(const MemoryRegion& region); // To emit an instruction to the assembler buffer, the EnsureCapacity helper // must be used to guarantee that the underlying data area is big enough to @@ -246,6 +245,8 @@ class AssemblerBuffer { // The provided `min_capacity` must be higher than current `Capacity()`. void ExtendCapacity(size_t min_capacity); + void ProcessFixups(); + private: // The limit is set to kMinimumGap bytes before the end of the data area. // This leaves enough space for the longest possible instruction and allows @@ -357,7 +358,10 @@ class DebugFrameOpCodeWriterForAssembler final class Assembler : public DeletableArenaObject<kArenaAllocAssembler> { public: // Finalize the code; emit slow paths, fixup branches, add literal pool, etc. - virtual void FinalizeCode() { buffer_.EmitSlowPaths(this); } + virtual void FinalizeCode() { + buffer_.EmitSlowPaths(this); + buffer_.ProcessFixups(); + } // Size of generated code virtual size_t CodeSize() const { return buffer_.Size(); } @@ -375,8 +379,8 @@ class Assembler : public DeletableArenaObject<kArenaAllocAssembler> { virtual size_t CodePosition() { return CodeSize(); } // Copy instructions out of assembly buffer into the given region of memory - virtual void FinalizeInstructions(const MemoryRegion& region) { - buffer_.FinalizeInstructions(region); + virtual void CopyInstructions(const MemoryRegion& region) { + buffer_.CopyInstructions(region); } // TODO: Implement with disassembler. |