| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
The tenses on a bunch of the members and variables are a little confusing. I left some suggestions below on renames. Mostly focusing on a "verb first" naming scheme.
typesCheck: {parameterCheck, downcastCheck},Jus realized, should we have `recordUse: {noInline}` here? Rather than adding it above in `ir/annotations.dart`.
This keeps all the implied pragmas in one place.
'prefer-inline': tryInline,We don't fully know that no one in the community isn't using `resource-identifier`. For backward compatibility it's probably safer to just add an alias here that maps the old pragma name to the new pragma value.
The docs won't mention the old name at all so I wouldn't expect any new users to find the alias. So it would just be precautionary.
bool methodRecordUses(MemberEntity member) {Rename to `shouldRecordMethodUses`
methodRecordUse = _methodRecordUse(rename var here to `recordedMethodUses`
RecordedUse _methodRecordUse(`_recordMethodUses`
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
typesCheck: {parameterCheck, downcastCheck},Jus realized, should we have `recordUse: {noInline}` here? Rather than adding it above in `ir/annotations.dart`.
This keeps all the implied pragmas in one place.
I tried this. However then you get hints because the annotation is converted to both. So then I removed the implied annotation. But then stuff started being inlined. I didn't dig deeper than that and simply reverted. Do you want me to dig into this more?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
We don't fully know that no one in the community isn't using `resource-identifier`. For backward compatibility it's probably safer to just add an alias here that maps the old pragma name to the new pragma value.
The docs won't mention the old name at all so I wouldn't expect any new users to find the alias. So it would just be precautionary.
Done
bool methodRecordUses(MemberEntity member) {Daco HarkesRename to `shouldRecordMethodUses`
Done
rename var here to `recordedMethodUses`
Done
RecordedUse _methodRecordUse(Daco Harkes`_recordMethodUses`
Done
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +2 |
Daco HarkesJus realized, should we have `recordUse: {noInline}` here? Rather than adding it above in `ir/annotations.dart`.
This keeps all the implied pragmas in one place.
I tried this. However then you get hints because the annotation is converted to both. So then I removed the implied annotation. But then stuff started being inlined. I didn't dig deeper than that and simply reverted. Do you want me to dig into this more?
As discussed offline, leaving a TODO to check this later.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
5 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: pkg/compiler/lib/src/js_backend/annotations.dart
Insertions: 6, Deletions: 2.
@@ -117,6 +117,9 @@
static const Map<PragmaAnnotation, Set<PragmaAnnotation>> implies = {
typesTrust: {parameterTrust, downcastTrust},
typesCheck: {parameterCheck, downcastCheck},
+ // TODO(dacoharkes,natebiggs): Removing `RecordUse` being converted to
+ // noInline and enabling this doesn't work. Why not?
+ // recordUse: {noInline},
};
static const Map<PragmaAnnotation, Set<PragmaAnnotation>> excludes = {
noInline: {tryInline},
@@ -143,6 +146,7 @@
// Aliases
'never-inline': noInline,
'prefer-inline': tryInline,
+ 'resource-identifier': recordUse,
};
}
@@ -361,7 +365,7 @@
String getLoadLibraryPriority(ir.LoadLibrary node);
/// Determines whether [member] is annotated with `RecordUse()`.
- bool methodRecordUses(FunctionEntity member);
+ bool shouldRecordMethodUses(FunctionEntity member);
/// Is this node in a context requesting that the captured stack in a `throw`
/// expression generates extra code to avoid having a runtime helper on the
@@ -654,7 +658,7 @@
}
@override
- bool methodRecordUses(MemberEntity member) {
+ bool shouldRecordMethodUses(MemberEntity member) {
EnumSet<PragmaAnnotation>? annotations = pragmaAnnotations[member];
if (annotations != null) {
if (annotations.contains(PragmaAnnotation.recordUse)) {
```
```
The name of the file: pkg/compiler/lib/src/ssa/codegen.dart
Insertions: 6, Deletions: 6.
@@ -2360,7 +2360,7 @@
);
} else {
StaticUse staticUse;
- Object? methodRecordUse;
+ Object? recordedMethodUses;
if (element is ConstructorEntity) {
CallStructure callStructure = CallStructure.unnamed(
arguments.length,
@@ -2382,8 +2382,8 @@
callStructure,
node.typeArguments,
);
- if (_closedWorld.annotationsData.methodRecordUses(element)) {
- methodRecordUse = _methodRecordUse(
+ if (_closedWorld.annotationsData.shouldRecordMethodUses(element)) {
+ recordedMethodUses = _recordMethodUses(
element,
callStructure,
node.inputs,
@@ -2396,13 +2396,13 @@
push(
js.Call(pop(), arguments, sourceInformation: node.sourceInformation),
);
- if (methodRecordUse != null) {
- push(pop().withAnnotation(methodRecordUse));
+ if (recordedMethodUses != null) {
+ push(pop().withAnnotation(recordedMethodUses));
}
}
}
- RecordedUse _methodRecordUse(
+ RecordedUse _recordMethodUses(
FunctionEntity element,
CallStructure callStructure,
List<HInstruction> arguments,
```
[dart2js] Remove `@pragma('dart2js:resource-identifier')`
The same functionality is available with `@RecordUse()` now.
This CL renames all the implementation to refer to recorded uses
instead of resource identifiers. These are only renames, there is no
logical change.
This CL keeps the implementation to be the pragma machinery. The
pragmas.md has been updated to reflect that the pragma should not be
used but that `RecordUse()` should be used instead.
This CL does _not_ change the `--write-resources` command-line flag.
We'll decide on some flag that works across all compiler backends in
the future: https://github.com/dart-lang/native/issues/2939.
This CL updates the documentation to talk about `@RecordUse()`.| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |