-
-
Notifications
You must be signed in to change notification settings - Fork 267
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
[2.079] Support minimal runtime #2641
Conversation
I've been wanting to do this for quite some time, thanks – but wouldn't it be natural to ditch the runtime module altogether now? |
(I.e. create the functions directly in the requesting module.) |
import core.stdc.stdio;
// pragma(LDC_no_moduleinfo);
void foo()
{
printf("Hello LDC2 %d\n", (void*).sizeof);
}
|
Wrt. runtime module, I wasn't sure whether it was just exploited as stringmap or whether caching the functions there brings some performance. Right now, the lazy 'declarers' may declare more than one function (same type, multiple names), so switching this exact scheme to forward-declaring directly into the desired module may yield a few superfluous declarations. |
Do we want to pass through the |
Yep, the loc would be nice to have of course. Given the elision of Module-/TypeInfos if there's no declaration, the chances of a missing TypeInfo should be pretty much restricted to a runtime function call requiring one of the few TypeInfo base types. As such, the existing loc param of merge-2.079 green on Win64 now with this, on Linux too except for the 32-bit std.file unittests. :) |
Well actually it'd probably be useful to do the runtime function lookup as early as possible. In various places, we first construct the args for the runtime function call (incl. TypeInfos) and afterwards do |
Expecting Win32 to succeed too now and so AppVeyor to become green. |
Thereby deferring requirements wrt. object.d declarations (Object, Throwable, TypeInfo, TypeInfo_Class, TypeInfo_Struct...) and paving the way for a minimal druntime. This also greatly reduces the `-vv` output for tiny code samples, e.g., reduced test cases.
Not all type declarations yet (e.g., some TypeInfo subtypes are still accessed directly), but those already wrapped as LazyType in the gen/runtime.cpp module (with check and proper error msg in case object.d doesn't contain a required declaration).
This is compatible with DMD.
…/minimal/object.d
This is compatible with DMD.
Otherwise linking only works if the directory is specified for the linker, which may not be the case when disabling the config file via `-conf=`.
To retain the LoC information in case TypeInfo declarations are missing.
Thereby deferring requirements wrt. object.d declarations (Object, Throwable, TypeInfo, TypeInfo_Class, TypeInfo_Struct...) and paving the way for a minimal druntime.
This also greatly reduces the
-vv
output for tiny code samples, e.g., reduced test cases.