diff options
| author | bors <bors@rust-lang.org> | 2013-07-14 05:55:22 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-07-14 05:55:22 -0700 |
| commit | 66e2857253ff9bc8ce299398ad5bb346d64e3fc3 (patch) | |
| tree | ed3a392c8341754c2f21ce3affd296ec6bc8b839 /src/rt/rust_kernel.cpp | |
| parent | 51cb98443cfd053f3d2bdb26465fdb0c9d3a0f74 (diff) | |
| parent | e56b3691c87c24fc335fa8a293f1bf2e13a01ad9 (diff) | |
| download | rust-66e2857253ff9bc8ce299398ad5bb346d64e3fc3.tar.gz rust-66e2857253ff9bc8ce299398ad5bb346d64e3fc3.zip | |
auto merge of #7781 : dotdash/rust/glue, r=huonw
We used to have concrete types in glue functions, but the way we used to implement that broke inlining of those functions. To fix that, we converted all glue to just take an i8* and always casted to that type. The problem with the old implementation was that we made a wrong assumption about the glue functions, taking it for granted that they always take an i8*, because that's the function type expected by the TyDesc fields. Therefore, we always ended up with some kind of cast. But actually, we can initially have the glue with concrete types and only cast the functions to the generic type once we actually emit the TyDesc data. That means that for glue calls that can be statically resolved, we don't need any casts, unless the glue uses a simplified type. In that case we cast the argument. And for glue calls that are resolved at runtime, we cast the argument to i8*, because that's what the glue function in the TyDesc expects. Since most of out glue calls are static, this saves a lot of bitcasts. The size of the unoptimized librustc.ll goes down by 240k lines.
Diffstat (limited to 'src/rt/rust_kernel.cpp')
0 files changed, 0 insertions, 0 deletions
