@@ -22,14 +22,17 @@ var makefuncdatasym_nsym int
22
22
func makefuncdatasym (nameprefix string , funcdatakind int64 ) * Sym {
23
23
sym := lookupN (nameprefix , makefuncdatasym_nsym )
24
24
makefuncdatasym_nsym ++
25
- pnod := newname (sym )
26
- pnod .Class = PEXTERN
27
- p := Gins (obj .AFUNCDATA , nil , pnod )
25
+ p := Prog (obj .AFUNCDATA )
28
26
Addrconst (& p .From , funcdatakind )
27
+ p .To .Type = obj .TYPE_MEM
28
+ p .To .Name = obj .NAME_EXTERN
29
+ p .To .Sym = Linksym (sym )
29
30
return sym
30
31
}
31
32
32
- // gvardef inserts a VARDEF for n into the instruction stream.
33
+ // TODO(mdempsky): Update to reference OpVar{Def,Kill,Live} instead
34
+ // and move to plive.go.
35
+
33
36
// VARDEF is an annotation for the liveness analysis, marking a place
34
37
// where a complete initialization (definition) of a variable begins.
35
38
// Since the liveness analysis can see initialization of single-word
@@ -85,55 +88,6 @@ func makefuncdatasym(nameprefix string, funcdatakind int64) *Sym {
85
88
// that its argument is certainly dead, for use when the liveness analysis
86
89
// would not otherwise be able to deduce that fact.
87
90
88
- func gvardefx (n * Node , as obj.As ) {
89
- if n == nil {
90
- Fatalf ("gvardef nil" )
91
- }
92
- if n .Op != ONAME {
93
- Fatalf ("gvardef %#v; %v" , n .Op , n )
94
- return
95
- }
96
-
97
- switch n .Class {
98
- case PAUTO , PPARAM , PPARAMOUT :
99
- if ! n .Used () {
100
- Prog (obj .ANOP )
101
- return
102
- }
103
-
104
- if as == obj .AVARLIVE {
105
- Gins (as , n , nil )
106
- } else {
107
- Gins (as , nil , n )
108
- }
109
- }
110
- }
111
-
112
- func Gvardef (n * Node ) {
113
- gvardefx (n , obj .AVARDEF )
114
- }
115
-
116
- func Gvarkill (n * Node ) {
117
- gvardefx (n , obj .AVARKILL )
118
- }
119
-
120
- func Gvarlive (n * Node ) {
121
- gvardefx (n , obj .AVARLIVE )
122
- }
123
-
124
- func removevardef (firstp * obj.Prog ) {
125
- for p := firstp ; p != nil ; p = p .Link {
126
- for p .Link != nil && (p .Link .As == obj .AVARDEF || p .Link .As == obj .AVARKILL || p .Link .As == obj .AVARLIVE ) {
127
- p .Link = p .Link .Link
128
- }
129
- if p .To .Type == obj .TYPE_BRANCH {
130
- for p .To .Val .(* obj.Prog ) != nil && (p .To .Val .(* obj.Prog ).As == obj .AVARDEF || p .To .Val .(* obj.Prog ).As == obj .AVARKILL || p .To .Val .(* obj.Prog ).As == obj .AVARLIVE ) {
131
- p .To .Val = p .To .Val .(* obj.Prog ).Link
132
- }
133
- }
134
- }
135
- }
136
-
137
91
func emitptrargsmap () {
138
92
if Curfn .Func .Nname .Sym .Name == "_" {
139
93
return
@@ -407,10 +361,7 @@ func compile(fn *Node) {
407
361
}
408
362
}
409
363
410
- gcargs := makefuncdatasym ("gcargs·" , obj .FUNCDATA_ArgsPointerMaps )
411
- gclocals := makefuncdatasym ("gclocals·" , obj .FUNCDATA_LocalsPointerMaps )
412
-
413
- genssa (ssafn , ptxt , gcargs , gclocals )
364
+ genssa (ssafn , ptxt )
414
365
415
366
obj .Flushplist (Ctxt , plist ) // convert from Prog list to machine code
416
367
ptxt = nil // nil to prevent misuse; Prog may have been freed by Flushplist
0 commit comments