My favorites | Sign in
Project Home
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 23: Support tuples properly
1 person starred this issue and may be notified of changes. Back to list
Status:  WontFix
Owner:  ejrh00@gmail.com
Closed:  Aug 23


 
Project Member Reported by ejrh00@gmail.com, Nov 17, 2011
The compiler supports tuples at the grammar and early-analysis levels.  However it doesn't know how to render them as assembly code.

And neither do I.

The main fault is that it doesn't know how to return a tuple from a function.  This shortcoming isn't always obvious, because it does know how to inline a function; in a case "(zx, zy) = complex_add(zx, zy, cx, cy)" for instance, it just copies complex_add's CFG wholesale and lines up the variables.  So complex (har har!) examples like mandelbrot.e would end up compiled as one honking great function and work fine.  (Until I broke register allocation, but that's largely a seperate issue.)

Fixing this requires that we:

1. Decide on a proper calling convention.  Currently we assume that "the" returned value is in %eax.  That's what usually happens in C.  Except now C can return things bigger than a single register.  We should look at what it does then and mirror it.

2. Fix up the function entries, exits and calls to handle registers and stacks properly.  Currently it's pretty messy.  All arguments are passed on the stack, but the calling convention may well want some passed in registers.  Sigh.  That means it should probably try to be generic and support more than one calling convention.

Aug 23, 2015
Project Member #1 ejrh00@gmail.com
(No comment was entered for this change.)
Status: WontFix

Powered by Google Project Hosting