summaryrefslogtreecommitdiff
path: root/compiler/utils/assembler.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2023-06-16 12:18:27 +0100
committer Nicolas Geoffray <ngeoffray@google.com> 2023-06-21 07:59:13 +0000
commit70bba9c9f5fbba03c62a4542411e1d938375f14e (patch)
tree0b4ef702e671db908321639d39912636603166bc /compiler/utils/assembler.cc
parent5bf0f68407d3467a3fbfa9ab9ae0c8fabead615b (diff)
Remove CodeAllocator and the extra copy of generated code.
The code used to copy the final generated code twice: from assembler to CodeAllocator, and then to CodeAllocator to SwapAllocator/JitMemory. The assemblers never depended on the exact location of the generated code, so just drop that feature. Test: test.py Change-Id: I8dc82e4926097092b9aac336a5a5d40f79dc62ca
Diffstat (limited to 'compiler/utils/assembler.cc')
-rw-r--r--compiler/utils/assembler.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/compiler/utils/assembler.cc b/compiler/utils/assembler.cc
index b82f0dc4b4..1c04a3d20b 100644
--- a/compiler/utils/assembler.cc
+++ b/compiler/utils/assembler.cc
@@ -57,18 +57,21 @@ void AssemblerBuffer::ProcessFixups(const MemoryRegion& region) {
fixup->Process(region, fixup->position());
fixup = fixup->previous();
}
+#ifndef NDEBUG
+ fixups_processed_ = true;
+#endif
+}
+
+
+void AssemblerBuffer::ProcessFixups() {
+ MemoryRegion from(reinterpret_cast<void*>(contents()), Size());
+ ProcessFixups(from);
}
-void AssemblerBuffer::FinalizeInstructions(const MemoryRegion& instructions) {
- // Copy the instructions from the buffer.
+void AssemblerBuffer::CopyInstructions(const MemoryRegion& instructions) {
MemoryRegion from(reinterpret_cast<void*>(contents()), Size());
instructions.CopyFrom(0, from);
- // Process fixups in the instructions.
- ProcessFixups(instructions);
-#ifndef NDEBUG
- fixups_processed_ = true;
-#endif
}