Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
5cc32a53
Commit
5cc32a53
authored
Oct 26, 2009
by
Kai Backman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix defer. gave up on unified code for defer and go for now.
R=rsc
http://go/go-review/1014010
parent
dfeceddd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
5 deletions
+49
-5
ggen.c
src/cmd/5g/ggen.c
+49
-5
No files found.
src/cmd/5g/ggen.c
View file @
5cc32a53
...
...
@@ -123,8 +123,8 @@ ginscall(Node *f, int proc)
afunclit
(
&
p
->
to
);
break
;
// TODO(kaib): unify newproc and defer if you can figure out how not to break things
case
1
:
// call in new proc (go)
case
2
:
// defered call (defer)
regalloc
(
&
r
,
types
[
tptr
],
N
);
p
=
gins
(
AMOVW
,
N
,
&
r
);
p
->
from
.
type
=
D_OREG
;
...
...
@@ -154,10 +154,7 @@ ginscall(Node *f, int proc)
p
->
to
.
offset
=
4
;
regfree
(
&
r
);
if
(
proc
==
1
)
ginscall
(
newproc
,
0
);
else
ginscall
(
deferproc
,
0
);
ginscall
(
newproc
,
0
);
regalloc
(
&
r
,
types
[
tptr
],
N
);
p
=
gins
(
AMOVW
,
N
,
&
r
);
...
...
@@ -172,6 +169,53 @@ ginscall(Node *f, int proc)
p
->
scond
|=
C_WBIT
;
regfree
(
&
r
);
break
;
case
2
:
// defered call (defer)
regalloc
(
&
r
,
types
[
tptr
],
N
);
p
=
gins
(
AMOVW
,
N
,
&
r
);
p
->
from
.
type
=
D_OREG
;
p
->
from
.
reg
=
REGSP
;
p
=
gins
(
AMOVW
,
&
r
,
N
);
p
->
to
.
type
=
D_OREG
;
p
->
to
.
reg
=
REGSP
;
p
->
to
.
offset
=
-
8
;
p
->
scond
|=
C_WBIT
;
memset
(
&
n1
,
0
,
sizeof
n1
);
n1
.
op
=
OADDR
;
n1
.
left
=
f
;
gins
(
AMOVW
,
&
n1
,
&
r
);
p
=
gins
(
AMOVW
,
&
r
,
N
);
p
->
to
.
type
=
D_OREG
;
p
->
to
.
reg
=
REGSP
;
p
->
to
.
offset
=
8
;
nodconst
(
&
con
,
types
[
TINT32
],
argsize
(
f
->
type
));
gins
(
AMOVW
,
&
con
,
&
r
);
p
=
gins
(
AMOVW
,
&
r
,
N
);
p
->
to
.
type
=
D_OREG
;
p
->
to
.
reg
=
REGSP
;
p
->
to
.
offset
=
4
;
regfree
(
&
r
);
ginscall
(
deferproc
,
0
);
regalloc
(
&
r
,
types
[
tptr
],
N
);
p
=
gins
(
AMOVW
,
N
,
&
r
);
p
->
from
.
type
=
D_OREG
;
p
->
from
.
reg
=
REGSP
;
p
->
from
.
offset
=
0
;
p
=
gins
(
AMOVW
,
&
r
,
N
);
p
->
to
.
type
=
D_OREG
;
p
->
to
.
reg
=
REGSP
;
p
->
to
.
offset
=
8
;
p
->
scond
|=
C_WBIT
;
regfree
(
&
r
);
break
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment