diff options
author | Russ Cox <rsc@golang.org> | 2008-11-23 17:08:55 -0800 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2008-11-23 17:08:55 -0800 |
commit | dd4aebb84ab8ee8dd11b12a7802a02373fabac6c (patch) | |
tree | 7844c561a0e97cefebaae40c6fc9e60acd59628f /src/runtime/runtime.h | |
parent | 90aa232ac15839303847e28b1bc0747b5e9cc114 (diff) | |
download | golang-dd4aebb84ab8ee8dd11b12a7802a02373fabac6c.tar.gz |
delete stack mark strings
in favor of using in-memory copy of symbol table.
$ ls -l pretty pretty.big
-rwxr-xr-x 1 rsc eng 439516 Nov 21 16:43 pretty
-rwxr-xr-x 1 rsc eng 580984 Nov 21 16:20 pretty.big
$
R=r
DELTA=446 (238 added, 178 deleted, 30 changed)
OCL=19851
CL=19884
Diffstat (limited to 'src/runtime/runtime.h')
-rw-r--r-- | src/runtime/runtime.h | 50 |
1 files changed, 34 insertions, 16 deletions
diff --git a/src/runtime/runtime.h b/src/runtime/runtime.h index 842ac8ed2..7ec9c7d9b 100644 --- a/src/runtime/runtime.h +++ b/src/runtime/runtime.h @@ -19,32 +19,35 @@ typedef uint64 uintptr; /* * get rid of C types + * the / / / forces a syntax error immediately, + * which will show "last name: XXunsigned". */ -#define unsigned XXunsigned -#define signed XXsigned -#define char XXchar -#define short XXshort -#define int XXint -#define long XXlong -#define float XXfloat -#define double XXdouble +#define unsigned XXunsigned / / / +#define signed XXsigned / / / +#define char XXchar / / / +#define short XXshort / / / +#define int XXint / / / +#define long XXlong / / / +#define float XXfloat / / / +#define double XXdouble / / / /* * defined types */ typedef uint8 bool; typedef uint8 byte; -typedef struct String *string; +typedef struct Alg Alg; typedef struct Array Array; -typedef struct Gobuf Gobuf; +typedef struct Func Func; typedef struct G G; -typedef struct M M; -typedef struct Stktop Stktop; -typedef struct Alg Alg; +typedef struct Gobuf Gobuf; typedef struct Lock Lock; -typedef union Note Note; +typedef struct M M; typedef struct Mem Mem; -typedef struct Usema Usema; +typedef union Note Note; +typedef struct Stktop Stktop; +typedef struct String *string; +typedef struct Usema Usema; /* * per cpu declaration @@ -179,6 +182,18 @@ struct SigTab int8 *name; }; +// (will be) shared with go; edit ../cmd/6g/sys.go too. +// should move out of sys.go eventually. +// also eventually, the loaded symbol table should +// be closer to this form. +struct Func +{ + string name; + string type; + uint64 entry; + int64 frame; +}; + /* * defined macros * you need super-goru privilege @@ -202,7 +217,7 @@ extern int32 maxround; * common functions and data */ int32 strcmp(byte*, byte*); -int32 findnull(int8*); +int32 findnull(byte*); void dump(byte*, int32); int32 runetochar(byte*, int32); int32 chartorune(uint32*, byte*); @@ -220,10 +235,12 @@ void* getu(void); void throw(int8*); uint32 rnd(uint32, uint32); void prints(int8*); +byte* mchr(byte*, byte, byte*); void mcpy(byte*, byte*, uint32); void mmov(byte*, byte*, uint32); void* mal(uint32); uint32 cmpstring(string, string); +string gostring(byte*); void initsig(void); int32 gotraceback(void); void traceback(uint8 *pc, uint8 *sp, G* gp); @@ -243,6 +260,7 @@ void sigaltstack(void*, void*); void signalstack(byte*, int32); G* malg(int32); void minit(void); +Func* findfunc(uint64); /* * mutual exclusion locks. in the uncontended case, |