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
f47346c5
Commit
f47346c5
authored
May 15, 2012
by
Jan Ziak
Committed by
Russ Cox
May 15, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
8l,5l: 2% faster
R=golang-dev, for.go.yong CC=golang-dev
https://golang.org/cl/6197080
parent
fcc1f2ac
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
19 deletions
+19
-19
obj.c
src/cmd/5l/obj.c
+10
-10
obj.c
src/cmd/8l/obj.c
+9
-9
No files found.
src/cmd/5l/obj.c
View file @
f47346c5
...
@@ -296,16 +296,16 @@ zaddr(Biobuf *f, Adr *a, Sym *h[])
...
@@ -296,16 +296,16 @@ zaddr(Biobuf *f, Adr *a, Sym *h[])
Sym
*
s
;
Sym
*
s
;
Auto
*
u
;
Auto
*
u
;
a
->
type
=
B
getc
(
f
);
a
->
type
=
B
GETC
(
f
);
a
->
reg
=
B
getc
(
f
);
a
->
reg
=
B
GETC
(
f
);
c
=
B
getc
(
f
);
c
=
B
GETC
(
f
);
if
(
c
<
0
||
c
>
NSYM
){
if
(
c
<
0
||
c
>
NSYM
){
print
(
"sym out of range: %d
\n
"
,
c
);
print
(
"sym out of range: %d
\n
"
,
c
);
Bputc
(
f
,
ALAST
+
1
);
Bputc
(
f
,
ALAST
+
1
);
return
;
return
;
}
}
a
->
sym
=
h
[
c
];
a
->
sym
=
h
[
c
];
a
->
name
=
B
getc
(
f
);
a
->
name
=
B
GETC
(
f
);
if
((
schar
)
a
->
reg
<
0
||
a
->
reg
>
NREG
)
{
if
((
schar
)
a
->
reg
<
0
||
a
->
reg
>
NREG
)
{
print
(
"register out of range %d
\n
"
,
a
->
reg
);
print
(
"register out of range %d
\n
"
,
a
->
reg
);
...
@@ -338,7 +338,7 @@ zaddr(Biobuf *f, Adr *a, Sym *h[])
...
@@ -338,7 +338,7 @@ zaddr(Biobuf *f, Adr *a, Sym *h[])
break
;
break
;
case
D_REGREG
:
case
D_REGREG
:
a
->
offset
=
B
getc
(
f
);
a
->
offset
=
B
GETC
(
f
);
break
;
break
;
case
D_CONST2
:
case
D_CONST2
:
...
@@ -422,7 +422,7 @@ newloop:
...
@@ -422,7 +422,7 @@ newloop:
loop:
loop:
if
(
f
->
state
==
Bracteof
||
Boffset
(
f
)
>=
eof
)
if
(
f
->
state
==
Bracteof
||
Boffset
(
f
)
>=
eof
)
goto
eof
;
goto
eof
;
o
=
B
getc
(
f
);
o
=
B
GETC
(
f
);
if
(
o
==
Beof
)
if
(
o
==
Beof
)
goto
eof
;
goto
eof
;
...
@@ -435,8 +435,8 @@ loop:
...
@@ -435,8 +435,8 @@ loop:
sig
=
0
;
sig
=
0
;
if
(
o
==
ASIGNAME
)
if
(
o
==
ASIGNAME
)
sig
=
Bget4
(
f
);
sig
=
Bget4
(
f
);
v
=
B
getc
(
f
);
/* type */
v
=
B
GETC
(
f
);
/* type */
o
=
B
getc
(
f
);
/* sym */
o
=
B
GETC
(
f
);
/* sym */
r
=
0
;
r
=
0
;
if
(
v
==
D_STATIC
)
if
(
v
==
D_STATIC
)
r
=
version
;
r
=
version
;
...
@@ -486,8 +486,8 @@ loop:
...
@@ -486,8 +486,8 @@ loop:
p
=
mal
(
sizeof
(
Prog
));
p
=
mal
(
sizeof
(
Prog
));
p
->
as
=
o
;
p
->
as
=
o
;
p
->
scond
=
B
getc
(
f
);
p
->
scond
=
B
GETC
(
f
);
p
->
reg
=
B
getc
(
f
);
p
->
reg
=
B
GETC
(
f
);
p
->
line
=
Bget4
(
f
);
p
->
line
=
Bget4
(
f
);
zaddr
(
f
,
&
p
->
from
,
h
);
zaddr
(
f
,
&
p
->
from
,
h
);
...
...
src/cmd/8l/obj.c
View file @
f47346c5
...
@@ -333,7 +333,7 @@ zsym(char *pn, Biobuf *f, Sym *h[])
...
@@ -333,7 +333,7 @@ zsym(char *pn, Biobuf *f, Sym *h[])
{
{
int
o
;
int
o
;
o
=
B
getc
(
f
);
o
=
B
GETC
(
f
);
if
(
o
<
0
||
o
>=
NSYM
||
h
[
o
]
==
nil
)
if
(
o
<
0
||
o
>=
NSYM
||
h
[
o
]
==
nil
)
mangle
(
pn
);
mangle
(
pn
);
return
h
[
o
];
return
h
[
o
];
...
@@ -347,12 +347,12 @@ zaddr(char *pn, Biobuf *f, Adr *a, Sym *h[])
...
@@ -347,12 +347,12 @@ zaddr(char *pn, Biobuf *f, Adr *a, Sym *h[])
Sym
*
s
;
Sym
*
s
;
Auto
*
u
;
Auto
*
u
;
t
=
B
getc
(
f
);
t
=
B
GETC
(
f
);
a
->
index
=
D_NONE
;
a
->
index
=
D_NONE
;
a
->
scale
=
0
;
a
->
scale
=
0
;
if
(
t
&
T_INDEX
)
{
if
(
t
&
T_INDEX
)
{
a
->
index
=
B
getc
(
f
);
a
->
index
=
B
GETC
(
f
);
a
->
scale
=
B
getc
(
f
);
a
->
scale
=
B
GETC
(
f
);
}
}
a
->
type
=
D_NONE
;
a
->
type
=
D_NONE
;
a
->
offset
=
0
;
a
->
offset
=
0
;
...
@@ -376,7 +376,7 @@ zaddr(char *pn, Biobuf *f, Adr *a, Sym *h[])
...
@@ -376,7 +376,7 @@ zaddr(char *pn, Biobuf *f, Adr *a, Sym *h[])
a
->
type
=
D_SCONST
;
a
->
type
=
D_SCONST
;
}
}
if
(
t
&
T_TYPE
)
if
(
t
&
T_TYPE
)
a
->
type
=
B
getc
(
f
);
a
->
type
=
B
GETC
(
f
);
adrgotype
=
S
;
adrgotype
=
S
;
if
(
t
&
T_GOTYPE
)
if
(
t
&
T_GOTYPE
)
adrgotype
=
zsym
(
pn
,
f
,
h
);
adrgotype
=
zsym
(
pn
,
f
,
h
);
...
@@ -452,10 +452,10 @@ newloop:
...
@@ -452,10 +452,10 @@ newloop:
loop:
loop:
if
(
f
->
state
==
Bracteof
||
Boffset
(
f
)
>=
eof
)
if
(
f
->
state
==
Bracteof
||
Boffset
(
f
)
>=
eof
)
goto
eof
;
goto
eof
;
o
=
B
getc
(
f
);
o
=
B
GETC
(
f
);
if
(
o
==
Beof
)
if
(
o
==
Beof
)
goto
eof
;
goto
eof
;
o
|=
B
getc
(
f
)
<<
8
;
o
|=
B
GETC
(
f
)
<<
8
;
if
(
o
<=
AXXX
||
o
>=
ALAST
)
{
if
(
o
<=
AXXX
||
o
>=
ALAST
)
{
if
(
o
<
0
)
if
(
o
<
0
)
goto
eof
;
goto
eof
;
...
@@ -468,8 +468,8 @@ loop:
...
@@ -468,8 +468,8 @@ loop:
sig
=
0
;
sig
=
0
;
if
(
o
==
ASIGNAME
)
if
(
o
==
ASIGNAME
)
sig
=
Bget4
(
f
);
sig
=
Bget4
(
f
);
v
=
B
getc
(
f
);
/* type */
v
=
B
GETC
(
f
);
/* type */
o
=
B
getc
(
f
);
/* sym */
o
=
B
GETC
(
f
);
/* sym */
r
=
0
;
r
=
0
;
if
(
v
==
D_STATIC
)
if
(
v
==
D_STATIC
)
r
=
version
;
r
=
version
;
...
...
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