--- /dev/null
+// Copyright 2014 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//+build !gccgo
+
+#include "textflag.h"
+
+TEXT ·ImplementedInAsm(SB),NOSPLIT,$0-0
+ RET
--- /dev/null
+//+build gccgo
+
+package dep
+
+func ImplementedInAsm() {}
--- /dev/null
+//+build !gccgo
+
+package dep
+
+func ImplementedInAsm()
package main
-import "dep"
+import (
+ "dep"
+ "runtime"
+)
func main() {
+ defer dep.ImplementedInAsm()
+ runtime.GC()
dep.V = dep.F() + 1
}
xfunc.Func.Nname.Name.Funcdepth = func_.Func.Depth
xfunc.Func.Depth = func_.Func.Depth
xfunc.Func.Endlineno = func_.Func.Endlineno
+ makefuncsym(xfunc.Func.Nname.Sym)
xfunc.Nbody = func_.Nbody
xfunc.Func.Dcl = concat(func_.Func.Dcl, xfunc.Func.Dcl)
Fatal("funchdr: dclcontext")
}
+ if importpkg == nil && n.Func.Nname != nil {
+ makefuncsym(n.Func.Nname.Sym)
+ }
+
dclcontext = PAUTO
markdcl()
Funcdepth++
}
s1 := Pkglookup(s.Name+"·f", s.Pkg)
- if s1.Def == nil {
- s1.Def = newfuncname(s1)
- s1.Def.Func.Shortname = newname(s)
- funcsyms = list(funcsyms, s1.Def)
- }
s.Fsym = s1
-
return s1
}
+
+func makefuncsym(s *Sym) {
+ if isblanksym(s) {
+ return
+ }
+ if compiling_runtime != 0 && s.Name == "getg" {
+ // runtime.getg() is not a real function and so does
+ // not get a funcsym.
+ return
+ }
+ s1 := funcsym(s)
+ s1.Def = newfuncname(s1)
+ s1.Def.Func.Shortname = newname(s)
+ funcsyms = list(funcsyms, s1.Def)
+}
// Implemented in package runtime.
func readGCStats(*[]time.Duration)
-func enableGC(bool) bool
func freeOSMemory()
// in asm_*.s
// not called directly; definitions here supply type information for traceback.
-func call16(fn, arg unsafe.Pointer, n, retoffset uint32)
func call32(fn, arg unsafe.Pointer, n, retoffset uint32)
func call64(fn, arg unsafe.Pointer, n, retoffset uint32)
func call128(fn, arg unsafe.Pointer, n, retoffset uint32)
--- /dev/null
+// Copyright 2015 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build 386 arm amd64p32
+
+package runtime
+
+import "unsafe"
+
+// Declarations for runtime services implemented in C or assembly that
+// are only present on 32 bit systems.
+
+func call16(fn, arg unsafe.Pointer, n, retoffset uint32)