aboutsummaryrefslogtreecommitdiff
path: root/libgo/runtime/malloc.goc
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/malloc.goc
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/malloc.goc')
-rw-r--r--libgo/runtime/malloc.goc8
1 files changed, 0 insertions, 8 deletions
diff --git a/libgo/runtime/malloc.goc b/libgo/runtime/malloc.goc
index b05c5fa..43323e2 100644
--- a/libgo/runtime/malloc.goc
+++ b/libgo/runtime/malloc.goc
@@ -84,7 +84,6 @@ runtime_mallocgc(uintptr size, uintptr typ, uint32 flag)
MLink *v, *next;
byte *tiny;
bool incallback;
- void *closure;
if(size == 0) {
// All 0-length allocations use this pointer.
@@ -96,10 +95,6 @@ runtime_mallocgc(uintptr size, uintptr typ, uint32 flag)
m = runtime_m();
g = runtime_g();
- // We should not be called in between __go_set_closure and the
- // actual function call, but cope with it if we are.
- closure = g->closure;
-
incallback = false;
if(m->mcache == nil && g->ncgo > 0) {
// For gccgo this case can occur when a cgo or SWIG function
@@ -180,7 +175,6 @@ runtime_mallocgc(uintptr size, uintptr typ, uint32 flag)
m->locks--;
if(incallback)
runtime_entersyscall();
- g->closure = closure;
return v;
}
}
@@ -267,8 +261,6 @@ runtime_mallocgc(uintptr size, uintptr typ, uint32 flag)
if(incallback)
runtime_entersyscall();
- g->closure = closure;
-
return v;
}