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
827dcb86
Commit
827dcb86
authored
Oct 10, 2008
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add sys.BUG_intereq to compare interfaces for equality
R=r OCL=16929 CL=16929
parent
e7c8e788
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
0 deletions
+20
-0
src/cmd/gc/sys.go
src/cmd/gc/sys.go
+1
-0
src/cmd/gc/sysimport.c
src/cmd/gc/sysimport.c
+1
-0
src/runtime/rt0_amd64.s
src/runtime/rt0_amd64.s
+18
-0
No files found.
src/cmd/gc/sys.go
View file @
827dcb86
...
...
@@ -80,3 +80,4 @@ export func stringtorune(string, int32) (int32, int32); // convert bytes to rune
export
func
exit
(
int32
);
export
func
BUG_intereq
(
a
,
b
interface
{})
bool
;
// should not be necessary
src/cmd/gc/sysimport.c
View file @
827dcb86
...
...
@@ -68,5 +68,6 @@ char *sysimport =
"export func sys.bytestorune (? *sys.uint8, ? sys.int32, ? sys.int32) (? sys.int32, ? sys.int32)
\n
"
"export func sys.stringtorune (? sys.string, ? sys.int32) (? sys.int32, ? sys.int32)
\n
"
"export func sys.exit (? sys.int32)
\n
"
"export func sys.BUG_intereq (a interface { }, b interface { }) (? sys.bool)
\n
"
"
\n
"
"$$
\n
"
;
src/runtime/rt0_amd64.s
View file @
827dcb86
...
...
@@ -133,3 +133,21 @@ TEXT cas(SB), 7, $0
MOVL
$
1
,
AX
RET
//
func
BUG_intereq
(
a
,
b
interface
{})
bool
{
//
return
a
==
b
//
}
//
TODO
:
delete
once
6
g
can
compile
a
==
b
on
interfaces
.
TEXT
sys
·
BUG_intereq
(
SB
),7,$0
//
First
interface
at
8
(
SP
)
and
16
(
SP
)
//
Second
interface
at
24
(
SP
)
and
32
(
SP
)
//
Answer
at
40
(
SP
)
MOVQ
8
(
SP
),
AX
CMPQ
AX
,
24
(
SP
)
JNE
6
(
PC
)
MOVQ
16
(
SP
),
AX
CMPQ
AX
,
32
(
SP
)
JNE
3
(
PC
)
MOVQ
$
1
,
40
(
SP
)
RET
MOVQ
$
0
,
40
(
SP
)
RET
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