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

refactor: dynamically include struct information in type information #84

Merged
merged 1 commit into from
Jan 29, 2020

Conversation

Wodann
Copy link
Collaborator

@Wodann Wodann commented Jan 20, 2020

Depends on #83.

TypeInfo is now a globally allocated type that can potentially have additional information appended, depending on its TypeGroup. As a result, all places that passed MunTypeInfo by value now use a MunTypeInfo*

This is not reflected in the mun_abi.h, as including a union type would affect the size of all MunTypeInfo - not just the ones that have a StructInfo appended. Please come up with more guarantees or tests, that could make this more secure.

@Wodann Wodann requested a review from baszalmstra January 20, 2020 16:17
@Wodann Wodann self-assigned this Jan 20, 2020
@codecov
Copy link

codecov bot commented Jan 20, 2020

Codecov Report

Merging #84 into master will increase coverage by 0.38%.
The diff coverage is 94.53%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #84      +/-   ##
=========================================
+ Coverage   74.42%   74.8%   +0.38%     
=========================================
  Files         121     121              
  Lines        9521    9599      +78     
=========================================
+ Hits         7086    7181      +95     
+ Misses       2435    2418      -17
Impacted Files Coverage Δ
crates/mun_runtime/src/reflection.rs 20.51% <ø> (ø) ⬆️
crates/mun_runtime/src/assembly.rs 73.68% <ø> (-0.13%) ⬇️
crates/mun_runtime/src/marshal.rs 0% <0%> (ø) ⬆️
crates/mun_runtime/src/macros.rs 43.54% <100%> (ø) ⬆️
crates/mun_runtime/src/struct.rs 51.13% <100%> (+1.13%) ⬆️
crates/mun_runtime/src/lib.rs 85.58% <100%> (+2.39%) ⬆️
crates/mun_codegen/src/code_gen.rs 77.27% <100%> (ø) ⬆️
crates/mun_codegen/src/code_gen/symbols.rs 96.5% <100%> (+2.17%) ⬆️
crates/mun_codegen/src/ir/module.rs 100% <100%> (ø) ⬆️
crates/mun_codegen/src/db.rs 100% <100%> (ø) ⬆️
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1a5d56a...7407966. Read the comment docs.

@Wodann Wodann force-pushed the refactor/struct-type-info branch 2 times, most recently from 315bd39 to 91e64f2 Compare January 26, 2020 10:55
@Wodann Wodann requested a review from baszalmstra January 26, 2020 11:00
@Wodann Wodann force-pushed the refactor/struct-type-info branch from 91e64f2 to 37f9f36 Compare January 29, 2020 15:11
…mation to be appended

Unique MunTypeInfo structs are globally allocated only once, but can be referred to in multiple places.
Depending on the TypeGroup, additional information can be appended in memory. For StructTypes, a
StructInfo struct is appended.
@Wodann Wodann force-pushed the refactor/struct-type-info branch from 37f9f36 to 7407966 Compare January 29, 2020 19:14
@Wodann Wodann merged commit 8596546 into mun-lang:master Jan 29, 2020
@Wodann Wodann changed the title Refactor type information to dynamically include struct information refactor: dynamically include struct information in type information Jan 31, 2020
@Wodann Wodann deleted the refactor/struct-type-info branch March 25, 2020 11:25
@Wodann Wodann added this to the Mun v0.2 milestone May 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants