aboutsummaryrefslogtreecommitdiff
path: root/libgo/runtime/proc.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2015-01-16 14:58:53 -0800
committerIan Lance Taylor <ian@gcc.gnu.org>2015-01-16 22:58:53 +0000
commit38bf819a5f995ae4621496df2324d68b9e24900f (patch)
treec90d2bfba44756e26640c50ad1389375693ef832 /libgo/runtime/proc.c
parent21cb351825d45c42e9e5148715a2fd2051cf4ed1 (diff)
downloadgcc-38bf819a5f995ae4621496df2324d68b9e24900f.zip
gcc-38bf819a5f995ae4621496df2324d68b9e24900f.tar.gz
gcc-38bf819a5f995ae4621496df2324d68b9e24900f.tar.bz2
compiler, reflect, runtime: Use static chain for closures.
Change from using __go_set_closure to passing the closure value in the static chain field. Uses new backend support for setting the closure chain in a call from C via __builtin_call_with_static_chain. Uses new support in libffi for Go closures. The old architecture specific support for reflect.MakeFunc is removed, replaced by the libffi support. All work done by Richard Henderson. * go-gcc.cc (Gcc_backend::call_expression): Add chain_expr argument. (Gcc_backend::static_chain_variable): New method. From-SVN: r219776
Diffstat (limited to 'libgo/runtime/proc.c')
-rw-r--r--libgo/runtime/proc.c20
1 files changed, 0 insertions, 20 deletions
diff --git a/libgo/runtime/proc.c b/libgo/runtime/proc.c
index 20fbc0a..c4f27fb 100644
--- a/libgo/runtime/proc.c
+++ b/libgo/runtime/proc.c
@@ -3310,26 +3310,6 @@ runtime_proc_scan(struct Workbuf** wbufp, void (*enqueue1)(struct Workbuf**, Obj
enqueue1(wbufp, (Obj){(byte*)&runtime_sched, sizeof runtime_sched, 0});
}
-// When a function calls a closure, it passes the closure value to
-// __go_set_closure immediately before the function call. When a
-// function uses a closure, it calls __go_get_closure immediately on
-// function entry. This is a hack, but it will work on any system.
-// It would be better to use the static chain register when there is
-// one. It is also worth considering expanding these functions
-// directly in the compiler.
-
-void
-__go_set_closure(void* v)
-{
- g->closure = v;
-}
-
-void *
-__go_get_closure(void)
-{
- return g->closure;
-}
-
// Return whether we are waiting for a GC. This gc toolchain uses
// preemption instead.
bool