akirilov-arm labeled issue #2824:
The old backends used the
CodeSinkto emit instruction bytes and relocations as they were being generated. The machinst backends store everything in aMachBufferbefore finally emitting the compiled code one byte at a time to theCodeSink. Unlike a plainmemcpythis is not easily vectorizable. In addition there are a lot of branches to check if the current instruction has a relocation, can trap or is a call site.I propose that either the
CodeSinkinterface is removed in favor of giving the embedder direct access to theMachBufferFinalizedor theCodeSinkinterface will get aput_bytesfunction that allows copying all bytes at the same time in combination with explicit offsets for thereloc_external,trapandadd_call_sitemethods.
cfallin closed issue #2824:
The old backends used the
CodeSinkto emit instruction bytes and relocations as they were being generated. The machinst backends store everything in aMachBufferbefore finally emitting the compiled code one byte at a time to theCodeSink. Unlike a plainmemcpythis is not easily vectorizable. In addition there are a lot of branches to check if the current instruction has a relocation, can trap or is a call site.I propose that either the
CodeSinkinterface is removed in favor of giving the embedder direct access to theMachBufferFinalizedor theCodeSinkinterface will get aput_bytesfunction that allows copying all bytes at the same time in combination with explicit offsets for thereloc_external,trapandadd_call_sitemethods.
Last updated: Dec 13 2025 at 19:03 UTC