Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Destination-passing style #667

Closed
pcwalton opened this issue Jul 12, 2011 · 1 comment
Closed

Destination-passing style #667

pcwalton opened this issue Jul 12, 2011 · 1 comment
Labels
I-slow Issue: Problems and improvements with respect to performance of generated code.

Comments

@pcwalton
Copy link
Contributor

We should use destination-passing style throughout trans, to implement copy constructor elision.

@ghost ghost assigned marijnh and pcwalton Jul 12, 2011
@pcwalton
Copy link
Contributor Author

Unassigning myself since I won't have time to work on this right now.

@ghost ghost assigned marijnh Aug 15, 2011
marijnh added a commit that referenced this issue Sep 23, 2011
Issue #667

Wires in a basic framework for destination-passing style, with
backwards-compatibility to the old approach, so that expression types
can be moved over to it one at a time (by moving them from trans_expr
to trans_expr_dps).
marijnh added a commit that referenced this issue Sep 26, 2011
expr_rec, expr_tup, most of the exprs that don't return anything. Make
trans_ret almost trivial by using destination adaptors (trans_save_in,
trans_by_ref).

Issue #667
marijnh added a commit that referenced this issue Sep 26, 2011
Issue #667

Now, {a: {b: 10, c: 20}, d: @30} will simply write the values in the right
places, rather than creating intermediary records and then memmoving them.
Cuts about a megabyte off the unoptimized compiler size.
marijnh added a commit that referenced this issue Sep 27, 2011
marijnh added a commit that referenced this issue Sep 27, 2011
marijnh added a commit that referenced this issue Sep 27, 2011
marijnh added a commit that referenced this issue Sep 27, 2011
marijnh added a commit that referenced this issue Sep 28, 2011
marijnh added a commit that referenced this issue Sep 29, 2011
marijnh added a commit that referenced this issue Sep 29, 2011
marijnh added a commit that referenced this issue Sep 29, 2011
marijnh added a commit that referenced this issue Oct 4, 2011
Issue #667

The retptr passed to a function will now often be the actual
destination of the returned value (as in `{field1: func1()}`).
marijnh added a commit that referenced this issue Oct 4, 2011
It wasn't safe (computing the rval might invalidate the lval addr), and needlessly
complicating things (code was already building up intermediary results to work
around other unsafeties).

Issue #667
marijnh added a commit that referenced this issue Oct 4, 2011
marijnh added a commit that referenced this issue Oct 5, 2011
It's not needed.

Issue #667
marijnh added a commit that referenced this issue Oct 5, 2011
marijnh added a commit that referenced this issue Oct 5, 2011
Call trans_temp_lval if you want the old fallback-to-temporary behaviour.

Issue #667
@marijnh marijnh closed this as completed in 142f63f Oct 5, 2011
keeperofdakeys pushed a commit to keeperofdakeys/rust that referenced this issue Dec 12, 2017
pdietl pushed a commit to pdietl/rust that referenced this issue Apr 23, 2020
bors pushed a commit to rust-lang-ci/rust that referenced this issue Oct 26, 2020
ZuseZ4 pushed a commit to EnzymeAD/rust that referenced this issue Mar 7, 2023
celinval added a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
* Use rustc SwitchTarget as is (rust-lang#42)

There is no need to modify rustc code in order to access the
SwitchTarget targets field. Change direct access to calls to
all_targets().

* Remove old change made to rustc_driver (rust-lang#42)

This is no longer needed.

* Use rustc TyS as is (rust-lang#42)

There is no need to access the kind and flags field of TyS directly.
We should be using kind() and flags() methods instead. Thus, I'm
removing the modification we made to the original rustc code to make
these variables public and fixing the code that relied on the direct
access.

* Revert changes from ScalarInt

Use conversion methods instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-slow Issue: Problems and improvements with respect to performance of generated code.
Projects
None yet
Development

No branches or pull requests

2 participants