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
Unnecessary bailout for known num receiver #8648
Labels
Comments
Added this to the Later milestone. |
Added TriageForM5 label. |
Removed TriageForM5 label. |
Removed this from the Later milestone. |
Removed Oldschool-Milestone-Later label. |
We do no longer generate bailout functions. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Consider this snippet from dart/samples/swarm/DataSource.dart:
static Section decode(Decoder decoder) {
final sectionId = decoder.readString();
final sectionTitle = decoder.readString();
final nSources = decoder.readInt();
final feeds = new ObservableList<Feed>();
for (int j=0; j < nSources; j++) {
feeds.add(Feed.decode(decoder));
}
return new Section(sectionId, sectionTitle, feeds);
}
This compiles to:
$.Section_decode = function(decoder) {$.ObservableList$ (null, $.Feed);$.Section$ (sectionId, sectionTitle, feeds);
var sectionId, sectionTitle, nSources, feeds, j;
sectionId = decoder.readString$0();
sectionTitle = decoder.readString$0();
nSources = decoder.readInt$0();
if (typeof nSources !== "number")
return $.Section_decode$bailout(1, decoder, sectionId, sectionTitle, nSources);
feeds =
for (j = 0; j < nSources; ++j)
feeds.add$1($.Feed_decode(decoder));
return
};
$.Section_decode$bailout = function(state0, decoder, sectionId, sectionTitle, nSources) {$.ObservableList$ (null, $.Feed);$.Section$ (sectionId, sectionTitle, feeds);
var feeds, j;
feeds =
for (j = 0; $.CONSTANT9.$lt(j, nSources); ++j)
feeds.add$1($.Feed_decode(decoder));
return
};
But it could be:
$.Section_decode = function(decoder) {$.$ $throw($.ArgumentError$ (nSources));$.ObservableList$ (null, $.Feed);$.Section$ (sectionId, sectionTitle, feeds);
var sectionId, sectionTitle, nSources, feeds, j;
sectionId = decoder.readString$0();
sectionTitle = decoder.readString$0();
nSources = decoder.readInt$0();
if (typeof nSources !== "number")
throw
feeds =
for (j = 0; j < nSources; ++j)
feeds.add$1($.Feed_decode(decoder));
return
};
The text was updated successfully, but these errors were encountered: