Mill Computing, Inc. Forums The Mill Architecture Can argument frames be nested?

  • Author
    Posts
  • Findecanor
    Participant
    Post count: 34
    #3956 |

    The programming language C++ in its 2011 version (“C++11”) has “move semantics”, but leave some opportunities to the compiler for whether an object seemingly passed by value should be passed by-copy or by-move (“copy-elision”).
    One such example is when an object is returned by value from one function and subsequently used as parameter to another.

    To realise this example as pass-by-move, then the first-called function would be passed a pointer to the location of where to store the object (as return pointer or parameter) — but that location would be in the second-called function’s argument block on the stack.
    That would require the second-called function’s argument frame to be allocated before the frame passed to the first.

    Would this be possible on The Mill, using two consecutive argf instructions before two consecutive calls?
    (Does argf push a context onto the current spillet that gets pulled by the next call, or would the second argf merely replace a processor-internal context previously initialised by the first instruction?)

    I’m developing a compiler mid-end, with an intermediary representation, and I would if possbible like to both support this case of C++11 copy elision and The Mill as target.
    Thanks in advance.

You must be logged in to reply to this topic.