tiancaiamao / shen-go

A Go implementation of the Shen programming language
Other
55 stars 4 forks source link

*: optimize the primitive call performance (step 1) #21

Closed tiancaiamao closed 3 years ago

tiancaiamao commented 3 years ago

For the generated code, this is inefficient:

PrimXXX := e.Global(sym)
Call(prim, arg1, arg2 ...)

We can assume the primitives would not change, and directly use:

PrimXXX(arg1, arg2 ...)