Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
22853098
Commit
22853098
authored
Jul 21, 2011
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gc: select functions are no longer special
R=ken2 CC=golang-dev
https://golang.org/cl/4794049
parent
6b2ec065
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
35 deletions
+12
-35
src/cmd/gc/go.h
src/cmd/gc/go.h
+0
-1
src/cmd/gc/subr.c
src/cmd/gc/subr.c
+0
-23
src/cmd/gc/walk.c
src/cmd/gc/walk.c
+0
-11
src/pkg/runtime/chan.c
src/pkg/runtime/chan.c
+12
-0
No files found.
src/cmd/gc/go.h
View file @
22853098
...
@@ -1106,7 +1106,6 @@ int isinter(Type *t);
...
@@ -1106,7 +1106,6 @@ int isinter(Type *t);
int
isnil
(
Node
*
n
);
int
isnil
(
Node
*
n
);
int
isnilinter
(
Type
*
t
);
int
isnilinter
(
Type
*
t
);
int
isptrto
(
Type
*
t
,
int
et
);
int
isptrto
(
Type
*
t
,
int
et
);
int
isselect
(
Node
*
n
);
int
isslice
(
Type
*
t
);
int
isslice
(
Type
*
t
);
int
istype
(
Type
*
t
,
int
et
);
int
istype
(
Type
*
t
,
int
et
);
void
linehist
(
char
*
file
,
int32
off
,
int
relative
);
void
linehist
(
char
*
file
,
int32
off
,
int
relative
);
...
...
src/cmd/gc/subr.c
View file @
22853098
...
@@ -1719,29 +1719,6 @@ isblank(Node *n)
...
@@ -1719,29 +1719,6 @@ isblank(Node *n)
return
p
[
0
]
==
'_'
&&
p
[
1
]
==
'\0'
;
return
p
[
0
]
==
'_'
&&
p
[
1
]
==
'\0'
;
}
}
int
isselect
(
Node
*
n
)
{
Sym
*
s
;
if
(
n
==
N
)
return
0
;
n
=
n
->
left
;
s
=
pkglookup
(
"selectsend"
,
runtimepkg
);
if
(
s
==
n
->
sym
)
return
1
;
s
=
pkglookup
(
"selectrecv"
,
runtimepkg
);
if
(
s
==
n
->
sym
)
return
1
;
s
=
pkglookup
(
"selectrecv2"
,
runtimepkg
);
if
(
s
==
n
->
sym
)
return
1
;
s
=
pkglookup
(
"selectdefault"
,
runtimepkg
);
if
(
s
==
n
->
sym
)
return
1
;
return
0
;
}
int
int
isinter
(
Type
*
t
)
isinter
(
Type
*
t
)
{
{
...
...
src/cmd/gc/walk.c
View file @
22853098
...
@@ -501,17 +501,6 @@ walkexpr(Node **np, NodeList **init)
...
@@ -501,17 +501,6 @@ walkexpr(Node **np, NodeList **init)
ll
=
ascompatte
(
n
->
op
,
n
->
isddd
,
getinarg
(
t
),
n
->
list
,
0
,
init
);
ll
=
ascompatte
(
n
->
op
,
n
->
isddd
,
getinarg
(
t
),
n
->
list
,
0
,
init
);
n
->
list
=
reorder1
(
ll
);
n
->
list
=
reorder1
(
ll
);
if
(
isselect
(
n
))
{
// special prob with selectsend and selectrecv:
// if chan is nil, they don't know big the channel
// element is and therefore don't know how to find
// the output bool, so we clear it before the call.
Node
*
b
;
b
=
nodbool
(
0
);
typecheck
(
&
b
,
Erv
);
lr
=
ascompatte
(
n
->
op
,
0
,
getoutarg
(
t
),
list1
(
b
),
0
,
init
);
n
->
list
=
concat
(
n
->
list
,
lr
);
}
goto
ret
;
goto
ret
;
case
OCALLMETH
:
case
OCALLMETH
:
...
...
src/pkg/runtime/chan.c
View file @
22853098
...
@@ -632,6 +632,9 @@ static void selectsend(Select *sel, Hchan *c, void *pc, void *elem, int32 so);
...
@@ -632,6 +632,9 @@ static void selectsend(Select *sel, Hchan *c, void *pc, void *elem, int32 so);
void
void
runtime
·
selectsend
(
Select
*
sel
,
Hchan
*
c
,
void
*
elem
,
bool
selected
)
runtime
·
selectsend
(
Select
*
sel
,
Hchan
*
c
,
void
*
elem
,
bool
selected
)
{
{
selected
=
false
;
FLUSH
(
&
selected
);
// nil cases do not compete
// nil cases do not compete
if
(
c
==
nil
)
if
(
c
==
nil
)
return
;
return
;
...
@@ -670,6 +673,9 @@ static void selectrecv(Select *sel, Hchan *c, void *pc, void *elem, bool*, int32
...
@@ -670,6 +673,9 @@ static void selectrecv(Select *sel, Hchan *c, void *pc, void *elem, bool*, int32
void
void
runtime
·
selectrecv
(
Select
*
sel
,
Hchan
*
c
,
void
*
elem
,
bool
selected
)
runtime
·
selectrecv
(
Select
*
sel
,
Hchan
*
c
,
void
*
elem
,
bool
selected
)
{
{
selected
=
false
;
FLUSH
(
&
selected
);
// nil cases do not compete
// nil cases do not compete
if
(
c
==
nil
)
if
(
c
==
nil
)
return
;
return
;
...
@@ -682,6 +688,9 @@ runtime·selectrecv(Select *sel, Hchan *c, void *elem, bool selected)
...
@@ -682,6 +688,9 @@ runtime·selectrecv(Select *sel, Hchan *c, void *elem, bool selected)
void
void
runtime
·
selectrecv2
(
Select
*
sel
,
Hchan
*
c
,
void
*
elem
,
bool
*
received
,
bool
selected
)
runtime
·
selectrecv2
(
Select
*
sel
,
Hchan
*
c
,
void
*
elem
,
bool
*
received
,
bool
selected
)
{
{
selected
=
false
;
FLUSH
(
&
selected
);
// nil cases do not compete
// nil cases do not compete
if
(
c
==
nil
)
if
(
c
==
nil
)
return
;
return
;
...
@@ -721,6 +730,9 @@ static void selectdefault(Select*, void*, int32);
...
@@ -721,6 +730,9 @@ static void selectdefault(Select*, void*, int32);
void
void
runtime
·
selectdefault
(
Select
*
sel
,
bool
selected
)
runtime
·
selectdefault
(
Select
*
sel
,
bool
selected
)
{
{
selected
=
false
;
FLUSH
(
&
selected
);
selectdefault
(
sel
,
runtime
·
getcallerpc
(
&
sel
),
(
byte
*
)
&
selected
-
(
byte
*
)
&
sel
);
selectdefault
(
sel
,
runtime
·
getcallerpc
(
&
sel
),
(
byte
*
)
&
selected
-
(
byte
*
)
&
sel
);
}
}
...
...
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