-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Can we add a tag in the header of a kernel file to indicate if it is a full kernel file or an incremental kernel file #31545
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
Comments
I think we also need the following tags while we are at it:
|
What would be the difference between a 'fully linked kernel file' and a 'full self contained kernel application file' ? Would we consider the current vm-platform.dill file a 'fully linked kernel file'? |
I think I got confused by 'incremental': e.g. if we use Kernel binary as a script snapshot then it is not incremental in any way, it just does not contain core libraries. Now that I reread your definitions I think 'fully linked kernel binaries' are the same as 'self contained kernel application file'. Fully linked kernel binaries are used for AOT cases, while non-linked / partial / incremental (we need some sort of good name for this) are used for JIT cases. |
Yes, we will add this. |
The current design is:
There are a couple of other things that we use that I think we should consider to be VM-specific:
We should continue to think of these as snapshot formats owned by the VM team. We should probably indicate them by again using a different magic number (and then, we can put anything at all that we want in the header since we will know how to interpret it). As far as strong mode, I'm not entirely sure what we should do here. Eventually it will be the only mode. In any case, I'd like to come up with a property that makes sense for Kernel files independently of Dart and the way it was compiled from Dart by the front end (consider that Kernel code might be generated directly by some other tool). What is the property we are really interested in? Is it a flag that indicates that the program is not intended to type check? Proposal: I will introduce a pair of new magic numbers that we will use to indicate (a) that a file has been linked and (b) that it's a VM-specific Kernel-based format. |
There are two ways to look at this:
Maybe this is also a good moment to stop thinking about "strong mode" separately from other Dart 2 features. Maybe instead of "strong mode" flag we actually just need a Dart version flag on the Kernel binary.
One important thing to consider is persistence: if you deserialize program and then serialize it again the magic number needs to be correct. So I suggest instead of making it a magic number making it a flag on the root node (e.g. Program) or introducing a new node. |
Since we will be using kernel only in Dart 2.0 we should consider all kernel files as being 'strong mode'. One further requirement is we should be able to determine quickly from the kernel file it it is a
|
@kmillikin - I bumped this to Beta 3. Can you move to Beta 4 or Dart 2 if one of those is more appropriate? |
@a-siva any further thoughts on what is needed here? I agree that strong/nonstrong isn't needed. |
We need a state in the header file that would help us identify a kernel file type, the various types being
|
Let's do this to get unblocked: add a header metadata field that tools can write anything they want into. We can make it variable-sized eventually, but for now let's make it a fixed-size (1 byte). It'll be easy to skip, and easy to sniff. Since the Dart team currently controls all the tools and transformations, we can use it however we want. I'll create a doc somewhere we we can record the way that we use the field. |
Still required for 2.1? |
Unrelated to Dart 2.1. |
Missing this feature makes it really hard for us to track whether a Flutter app was build with the --track-widget-creation transformer or not which is critical to let users turn on that flag safely. Background info: |
I think this should be P1 not P2. |
Workaround CLs: |
Would be nice if we had a tag in the header of a kernel file which indicated if the file is a full self contained kernel application file Vs an incremental kernel file.
This would help the VM at startup, if the specified file is a full self contained kernel file it would create an isolate using this file directly and if the file is an incremental kernel file it would create an isolate with the platform file and then load this kernel file into the isolate.
The text was updated successfully, but these errors were encountered: