-
Notifications
You must be signed in to change notification settings - Fork 39
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
internal: separate TLoc
from TSym
and TType
#790
Commits on Jul 8, 2023
-
Store all locs associated with symbols in lookup tables, with `TSym.loc` only being queried (but never written) for the external name or user- provided flags. In order to efficiently associate a `TSym` with a code-generator `TLoc`, each `TSym` stores a one-based index (`locId`) into one of the code generator's lookup tables. A table-based approach would have too, but it's slightly slower (~1.4% when building the compiler itselfs). In general, `cgen` becomes more strict with locs, now requiring globals, constants, and parameters to have their loc set-up once at definition processing time. Procedures, fields, and locals still need to support ad-hoc loc setup. Other changes: - writing the mangled names to NDI files is temporarily disabled - in symbol definitions contexts, `loc.t` is replaced with the querying the symbol's type directly (both are equivalent) - locs for constants now store a symbol node in their `lode` field
Configuration menu - View commit details
-
Copy full SHA for 1e167eb - Browse repository at this point
Copy the full SHA 1e167ebView commit details -
jsgen: decouple
TLoc
fromTSym
Use a `Table` to map symbols to the corresponding JavaScript name, which removes all modifications of `TSym.loc` from `jsgen`. Due the lesser complexity of the JavaScript code generator compared to the C code generator, a table-based approach works well enough.
Configuration menu - View commit details
-
Copy full SHA for bfe73f9 - Browse repository at this point
Copy the full SHA bfe73f9View commit details -
ast: remove
TLoc
fromTSym
andTType
`TType` doesn't need a `TLoc` field at all, and `TSym` only needs to store the external name (`extname`) plus the interface flags (`locFlags`). The `TLoc`, `TLocKind`, and `TStorageLoc` types are moved to `cgendata`, with `TLocFlag` staying in the `ast` module for now.
Configuration menu - View commit details
-
Copy full SHA for c4e7b46 - Browse repository at this point
Copy the full SHA c4e7b46View commit details -
cbackend: restore NDI generation
The orchestrator is now responsible for writing the mangled names to the NDI files.
Configuration menu - View commit details
-
Copy full SHA for 397e5af - Browse repository at this point
Copy the full SHA 397e5afView commit details -
cgen: less broad interface for the mangle procedures
This is made possible by them no longer requiring access to an NDI file.
Configuration menu - View commit details
-
Copy full SHA for 473b194 - Browse repository at this point
Copy the full SHA 473b194View commit details -
cgmeth: fix the dispatcher AST
It stored in the name slot the symbol of the method that the dispatcher was derived from, which now causes problems. With the fix, for all routines reaching the backend, `sym.ast[namePos] == sym` *should* be true.
Configuration menu - View commit details
-
Copy full SHA for 8af6d34 - Browse repository at this point
Copy the full SHA 8af6d34View commit details -
Configuration menu - View commit details
-
Copy full SHA for 58d906d - Browse repository at this point
Copy the full SHA 58d906dView commit details
Commits on Jul 9, 2023
-
apply suggestions from code review
Co-authored-by: Saem Ghani <saemghani+github@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 356ee71 - Browse repository at this point
Copy the full SHA 356ee71View commit details