Improved assembler performance

This commit is contained in:
2025-03-11 06:31:21 +01:00
parent d2ad8c8310
commit e7a06f5b26
37 changed files with 412 additions and 166 deletions

View File

@ -7,7 +7,7 @@ import (
)
// Finalize generates the final machine code.
func Finalize(a asm.Assembler, dlls dll.List) ([]byte, []byte) {
func Finalize(a *asm.Assembler, dlls dll.List) ([]byte, []byte) {
data, dataLabels := a.Data.Finalize()
if config.TargetOS == config.Windows && len(data) == 0 {
@ -15,6 +15,7 @@ func Finalize(a asm.Assembler, dlls dll.List) ([]byte, []byte) {
}
c := compiler{
assembler: a,
code: make([]byte, 0, len(a.Instructions)*8),
codeLabels: make(map[string]Address, 32),
codePointers: make([]*pointer, 0, len(a.Instructions)*8),