about summary refs log tree commit diff
path: root/src/rt/rust_task.cpp
diff options
context:
space:
mode:
authorMarijn Haverbeke <marijnh@gmail.com>2011-07-07 13:36:12 +0200
committerMarijn Haverbeke <marijnh@gmail.com>2011-07-07 15:54:01 +0200
commit3bdbf74d4703771571fdee1733b7b3d919b5ede8 (patch)
tree429bedad163dd9793849286415597b1312bbc781 /src/rt/rust_task.cpp
parent007a736642ac88c0adf0d68e8dc6fcb22f0609c3 (diff)
downloadrust-3bdbf74d4703771571fdee1733b7b3d919b5ede8.tar.gz
rust-3bdbf74d4703771571fdee1733b7b3d919b5ede8.zip
Make moving of temporaries do the right thing, use it to optimize
This adds support for dropping cleanups for temporary values when they
are moved somewhere else. It then adds wraps most copy operations
(return, put in data structure, box, etc) in a way that will fall back
to a move when it is safe.

This saves a lot of taking/dropping, shaving over a megabyte off the
stage2/rustc binary size.

In some cases, most notably function returns, we could detect that the
returned value is a local variable, and can thus be safely moved even
though it is not a temporary. This will require putting some more
information in lvals.

I did not yet handle function arguments, since the logic for passing
them looked too convoluted to touch. I'll probably try that in the
near future, since it's bound to be a big win.
Diffstat (limited to 'src/rt/rust_task.cpp')
0 files changed, 0 insertions, 0 deletions