Esempio n. 1
0
func newFunction(typ *types.Signature, name string) *Function {
	var parameters []*Parameter

	for _, parType := range typ.Parameters() {
		parameters = append(parameters, newParameter(parType, ""))
	}

	return &Function{
		typ:         typ,
		NameHandler: NameHandler{name: name},
		parameters:  parameters,
	}
}
Esempio n. 2
0
func (v Target) winLoadCallArguments(a *allocator, vals []ssa.Value, sig *types.Signature) {
	numVals := len(vals)

	v.wop("andq $-16, #rsp")

	if numVals > 4 && numVals%2 != 0 {
		v.wop("pushq $0")
	}

	totalMem := winTotalMemSizeBits(sig.Parameters())
	if totalMem > 0 {
		v.wop("subq $%d, #rsp", totalMem/8)
	}
	v.wop("movq #rsp, #r11")

	for i, arg := range vals {
		v.winLoadCallArgument(a, arg, i)
	}

	v.wop("subq $32, #rsp")
}