Improved assembler performance
This commit is contained in:
@ -8,8 +8,9 @@ import (
|
||||
)
|
||||
|
||||
func (c *compiler) call(x asm.Instruction) {
|
||||
switch data := x.Data.(type) {
|
||||
case *asm.Label:
|
||||
switch x.Type {
|
||||
case asm.TypeLabel:
|
||||
data := c.assembler.Param.Label[x.Index]
|
||||
c.code = x86.Call(c.code, 0x00_00_00_00)
|
||||
size := 4
|
||||
|
||||
@ -32,10 +33,12 @@ func (c *compiler) call(x asm.Instruction) {
|
||||
|
||||
c.codePointers = append(c.codePointers, pointer)
|
||||
|
||||
case *asm.Register:
|
||||
case asm.TypeRegister:
|
||||
data := c.assembler.Param.Register[x.Index]
|
||||
c.code = x86.CallRegister(c.code, data.Register)
|
||||
|
||||
case *asm.Memory:
|
||||
case asm.TypeMemory:
|
||||
data := c.assembler.Param.Memory[x.Index]
|
||||
c.code = x86.CallAtMemory(c.code, data.Base, data.Offset)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user