Skip to content
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

dart2js: Add effects 'length' for arrays and 'other' for effects outside of the Dart execution model #25544

Open
rakudrama opened this issue Jan 20, 2016 · 2 comments
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. dart2js-inference dart2js-optimization type-enhancement A request for a change that isn't a bug web-dart2js

Comments

@rakudrama
Copy link
Member

We have effects for instance variables, static variables and indexing.
We should add separate effects for lengths and external effects (e.g. DOM accesses)

@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed type-enhancement labels Mar 1, 2016
@vsmenon vsmenon added the area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. label Jul 20, 2019
@sigmundch
Copy link
Member

would the intent be to keep the two disjoint? that way native and js-interop methods have all "external" side-effects, but no internal side-effects?

@rakudrama
Copy link
Member Author

Tracking lengths separately to other fields will help Dart-only array loops see that the length is not changed, allowing the length to be hoisted, better bounds check elimination, and the concurrent modification check to be removed from the for-in expansion for JSIndexables.

Generally native/interop methods can change everything, since they might call an escaped Dart closure, and I expect the union of effects over all escaped closures to be complete. Most native/interop methods don't call back, so we could annotate the most important native methods to have an effect without the effect being something that blocks optimizations on Dart fields.

native/interop methods can modify arrays, so I expect lengths and indexes to be seen as modified by native code by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. dart2js-inference dart2js-optimization type-enhancement A request for a change that isn't a bug web-dart2js
Projects
None yet
Development

No branches or pull requests

4 participants