summaryrefslogtreecommitdiff
path: root/6/asm.h
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-09-27 22:52:17 -0700
committerOri Bernstein <ori@eigenstate.org>2015-09-27 22:52:17 -0700
commitc8c4b88ecadf05438561c05f97500e35843218c4 (patch)
tree950afbb15a71d129fdf5bab862ebe8d17eaeac59 /6/asm.h
parentac306beff772b0a894ca95e0e0d0fe3029c7f8e4 (diff)
downloadmc-c8c4b88ecadf05438561c05f97500e35843218c4.tar.gz
Don't index directly off of %rax.
We use it for function returns. We also use it for environment of called closures. This means we clobbered it. Oops.
Diffstat (limited to '6/asm.h')
-rw-r--r--6/asm.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/6/asm.h b/6/asm.h
index 811b2b5..dde50a6 100644
--- a/6/asm.h
+++ b/6/asm.h
@@ -130,7 +130,6 @@ struct Insn {
struct Func {
char *name; /* function name */
- int isexport; /* is this exported from the asm? */
Type *type; /* type of function */
Node **args; /* argument list */
@@ -140,7 +139,9 @@ struct Func {
size_t stksz; /* stack size */
Node *ret; /* return value */
- Cfg *cfg; /* flow graph */
+ Cfg *cfg; /* flow graph */
+ char isexport; /* is this exported from the asm? */
+ char hasenv; /* do we have an environment? */
};
struct Asmbb {
@@ -173,6 +174,8 @@ struct Isel {
Htab *envoff; /* decl id => int envoff */
Htab *globls; /* decl id => char *globlname */
+ Loc *envp;
+
/* increased when we spill */
Loc *stksz;
Loc *calleesave[Nreg];