]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/gc, runtime: correct a misnomer regarding dead value maps
authorCarl Shapiro <cshapiro@google.com>
Mon, 9 Dec 2013 22:45:10 +0000 (14:45 -0800)
committerCarl Shapiro <cshapiro@google.com>
Mon, 9 Dec 2013 22:45:10 +0000 (14:45 -0800)
The funcdata symbol incorrectly named the dead value map the
dead pointer map.  The dead value map identifies all dead
values, including pointers and non-pointers, in a stack frame.
The purpose of this map is to allow the runtime to poison
locations of dead data to catch lost invariants.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/38670043

src/cmd/gc/pgen.c
src/cmd/gc/plive.c
src/pkg/runtime/funcdata.h

index c2942f1399ffc2faa952c0f33e27fc4ac098d255..87225a4f88d65ea3912859326b183eb0db8db033 100644 (file)
@@ -159,7 +159,7 @@ compile(Node *fn)
        // compile time.  At present, the amount of additional RSS is
        // substantial enough to affect our smallest build machines.
        if(0)
-               gcdead = makefuncdatasym("gcdead·%d", FUNCDATA_DeadPointerMaps);
+               gcdead = makefuncdatasym("gcdead·%d", FUNCDATA_DeadValueMaps);
        else
                gcdead = nil;
 
index b58eaf6ed4bc44d5ef98f9caefd76aa076ab8919..25d6e89b98bce4b14d40e2eab8b9ced08a283a8f 100644 (file)
@@ -1477,9 +1477,11 @@ liveness(Node *fn, Prog *firstp, Sym *argssym, Sym *livesym, Sym *deadsym)
        if(0) livenessprintcfg(lv);
        livenessepilogue(lv);
 
-       // Emit the map data structures
+       // Emit the live pointer map data structures
        twobitwritesymbol(lv->livepointers, livesym, nil);
        twobitwritesymbol(lv->argslivepointers, argssym, nil);
+
+       // Optionally emit a dead value map data structure for locals.
        if(deadsym != nil)
                twobitwritesymbol(lv->deadvalues, deadsym, nil);
 
index 04766b9da20e0a38c43cee0b684f12e091f16cfa..e20b6ae254ecb79e70286bb77da8243ec81bcd2e 100644 (file)
@@ -12,7 +12,7 @@
 
 #define FUNCDATA_ArgsPointerMaps 2 /* garbage collector blocks */
 #define FUNCDATA_LocalsPointerMaps 3
-#define FUNCDATA_DeadPointerMaps 4
+#define FUNCDATA_DeadValueMaps 4
 
 // To be used in assembly.
 #define ARGSIZE(n) PCDATA $PCDATA_ArgSize, $n