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
f860bc0f
Commit
f860bc0f
authored
Oct 24, 2009
by
Kai Backman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed len/cap for chan. disable gc for now.
go/test: passes 93% (323/345) R=rsc
http://go/go-review/1015006
parent
fb39a4d6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
1 deletion
+36
-1
all-arm.bash
src/all-arm.bash
+4
-0
cgen.c
src/cmd/5g/cgen.c
+26
-1
arm-pass.txt
test/arm-pass.txt
+6
-0
No files found.
src/all-arm.bash
View file @
f860bc0f
...
...
@@ -17,6 +17,10 @@ xcd() {
builtin cd
$1
}
# temporarily turn GC off
# TODO(kaib): reenable GC once everything else works
export
GOGC
=
off
(
xcd ../test
./run-arm
)
||
exit
$?
src/cmd/5g/cgen.c
View file @
f860bc0f
...
...
@@ -271,7 +271,7 @@ cgen(Node *n, Node *res)
break
;
case
OLEN
:
if
(
istype
(
nl
->
type
,
TMAP
))
{
if
(
istype
(
nl
->
type
,
TMAP
)
||
istype
(
nl
->
type
,
TCHAN
)
)
{
// map has len in the first 32-bit word.
// a zero pointer means zero length
regalloc
(
&
n1
,
types
[
tptr
],
res
);
...
...
@@ -313,6 +313,31 @@ cgen(Node *n, Node *res)
break
;
case
OCAP
:
if
(
istype
(
nl
->
type
,
TCHAN
))
{
// chan has cap in the second 32-bit word.
// a zero pointer means zero length
regalloc
(
&
n1
,
types
[
tptr
],
res
);
cgen
(
nl
,
&
n1
);
nodconst
(
&
n2
,
types
[
tptr
],
0
);
regalloc
(
&
n3
,
n2
.
type
,
N
);
gmove
(
&
n2
,
&
n3
);
gcmp
(
optoas
(
OCMP
,
types
[
tptr
]),
&
n1
,
&
n3
);
regfree
(
&
n3
);
p1
=
gbranch
(
optoas
(
OEQ
,
types
[
tptr
]),
T
);
n2
=
n1
;
n2
.
op
=
OINDREG
;
n2
.
xoffset
=
4
;
n2
.
type
=
types
[
TINT32
];
gmove
(
&
n2
,
&
n1
);
patch
(
p1
,
pc
);
gmove
(
&
n1
,
res
);
regfree
(
&
n1
);
break
;
}
if
(
isslice
(
nl
->
type
))
{
regalloc
(
&
n1
,
types
[
tptr
],
res
);
agen
(
nl
,
&
n1
);
...
...
test/arm-pass.txt
View file @
f860bc0f
235.go
64bit.go
args.go
assign.go
...
...
@@ -7,8 +8,11 @@ blank1.go
chan/fifo.go
chan/goroutines.go
chan/perm.go
chan/powser1.go
chan/powser2.go
chan/select.go
chan/sieve.go
chancap.go
char_lit.go
closedchan.go
closure.go
...
...
@@ -256,6 +260,7 @@ interface/returntype.go
interface/struct.go
iota.go
ken/array.go
ken/chan.go
ken/chan1.go
ken/complit.go
ken/divconst.go
...
...
@@ -297,6 +302,7 @@ named.go
named1.go
nil.go
parentype.go
peano.go
printbig.go
range.go
rename.go
...
...
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