akirilov-arm labeled issue #2824:
The old backends used the
CodeSink
to emit instruction bytes and relocations as they were being generated. The machinst backends store everything in aMachBuffer
before finally emitting the compiled code one byte at a time to theCodeSink
. Unlike a plainmemcpy
this 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
CodeSink
interface is removed in favor of giving the embedder direct access to theMachBufferFinalized
or theCodeSink
interface will get aput_bytes
function that allows copying all bytes at the same time in combination with explicit offsets for thereloc_external
,trap
andadd_call_site
methods.
cfallin closed issue #2824:
The old backends used the
CodeSink
to emit instruction bytes and relocations as they were being generated. The machinst backends store everything in aMachBuffer
before finally emitting the compiled code one byte at a time to theCodeSink
. Unlike a plainmemcpy
this 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
CodeSink
interface is removed in favor of giving the embedder direct access to theMachBufferFinalized
or theCodeSink
interface will get aput_bytes
function that allows copying all bytes at the same time in combination with explicit offsets for thereloc_external
,trap
andadd_call_site
methods.
Last updated: Nov 22 2024 at 17:03 UTC