Primitives that potentially throw cannot normally be hoisted, but we can
sometimes hoist them anyway if they are at the loop entry.
We now hoist GetLength, GetField, GetIndex, NullCheck, and BoundsCheck.
BUG=
R=sigmund@google.com
Review URL: https://codereview.chromium.org/1578963002 .
Notes: most test code was copied from the original test files. The expectations
in patchset #1 are what we had in the files, expectations in patchset #2 are the
updated expectations.
Here is how the files under tests/compiler/dart2js/cps_ir/ are organized:
- up_to_date_test.dart: test that checks that your files are up to date, and
gives you the option to update them.
- passing "update" as an argument will update all *_test.dart files in
this folder and "update_all.dart".
- some_name_N_test.dart: a unit test
- takes cps_ir/input/some_name_N.dart as input, compiles it, and compares
the output to cps_ir/expected/some_name_N.js
- it accepts "update" as a command line argument to update the expectations in place
- update_all.dart: updates expectations on all tests.
- runner.dart: imported from all individual tests, basically an adaptation of
the logic from js_backend_cps_ir.dart.
Test failures indicate how to update them, normally you will run 2 commands:
up_to_date_test.dart update // to update the list of tests
update_all.dart // to update the expectations.
R=asgerf@google.com, kmillikin@google.com
Review URL: https://codereview.chromium.org/1576093003 .
These were sort of useful, but are way too expensive to maintain and
have broken the build bots way more often than they have uncovered bugs.
If we want to monitor the concrete compiler output we should build real
tools for that. They are not unit tests.
BUG=
Review URL: https://codereview.chromium.org/1562263002 .
After inlining, test expectations have changed. A few tests have
starting unexpectedly passing --- this could be because inlining
implements the correct semantics, or the could be passing for the
wrong reason. In any case, the underlying bug in the compiler has not
been fixed.
I will look into all these issues after the Christmas holidays.
BUG=
Review URL: https://codereview.chromium.org/1546943002 .
Perform a depth-first postorder traversal of the call graph of known
functions. Make an inlining decision based on the vector of argument
types at the call site, and cache inlining decisions. For positive
inlining decisions, cache the optimized function body specialized to
the receiver and argument types at the call site.
Future work:
* Real inlining heuristics.
* Propagate result types of inlined calls.
* Specialized for constant arguments when it makes sense.
* Performance improvements.
R=asgerf@google.com, sra@google.com
Committed: https://github.com/dart-lang/sdk/commit/d63053fea8731d2fb380022c1c3d296489d1c017
Review URL: https://codereview.chromium.org/1537663002 .
In response to dartbug.com/18661 and dartbug.com/21651.
Dart2js doesn't know pubspec.yaml or the directory structure but pub does. Next step is to pass arguments from pub.
BUG=
R=sigmund@google.com
Review URL: https://codereview.chromium.org/1513263002.
The new instruction is expanded into low-level operations
in a new pass Finalize. The Finalize pass is mandatory.
The BoundsCheck returns the indexable object being checked
so it can be used to restrict code motion.
BUG=
R=sra@google.com
Review URL: https://codereview.chromium.org/1512303002 .