The test was completely constant folded!
Making functions @NoInline() and also obfuscating values to a num/uint31/uint32 value gives better coverage of the internals of the more complex operators.
R=asgerf@google.com
Review URL: https://codereview.chromium.org/1388423004 .
The analysis uses a watered-down octagon domain which reduces range
analysis to a graph problem.
There are more ideas to try out to improve on this, but I think this is
a nice baseline to work from.
BUG=
R=sra@google.com
Review URL: https://codereview.chromium.org//1353443002 .
All passes must now preserve valid parent pointers. Several passes
already did this (or tried to do it).
The IR integrity checker can now check that parent pointers are valid.
This has caught a number of missing parent pointers assignments in
passes that otherwise tried to preserve them.
All node constructors now set parent pointers. This is very convenient
for simple transformations, but also a bit of a trap since updating a
field on an existing node does not update the parent pointer.
This is a pretty heavy-handed change. The main rationale for it are:
- The helpers methods require parent pointers, so they are more useful
when parent pointers are always set.
- The integrity checker can catch bogus parent pointers after passes
that have to maintain them anyway.
- The integrity checker is super slow, but this can finally be fixed
if it can assume parent pointers are valid (not part of this CL).
The IR visitors have been changed a bit to support a generic parent
visitor that does not have to implement every visit method.
The 'parent index' fields have been removed.
BUG=
R=kmillikin@google.com
Committed: 6cc9b43535
Review URL: https://codereview.chromium.org/1375213003 .
2. Cleanup and refactor WriteObjectRef and WriteObjectInlined and pass as_reference as a parameter to the WriteTo function to allow respective types to deal with it.
3. Added a as_reference parameter to the ReadFrom functions (currently the parameter is not used but the next round of changes will cleanup ReadObjectRef and ReadObjectInlined similarly).
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/1388543008 .
Type propagation:
Added better type_propagation rules for various operators to detect more uint31/uint32/non-negative cases.
Moved the rules to per-operator code so the rules can be shared by invokes (e.g. '<') and the builtin operations they are lowered to (NumLt).
In the case of NumLt, this removes lower bounds checks from injected bounds checks (i.e. NumLt(index, 0)) for constant indexes by simple constant folding.
Bit operations:
The '>>> 0' coercion is often not needed.
If we can tell the result is in the uint31 range then the result
generated by JavaScript's bit operations will not have become
negative.
Added a tree analysis to codegen to tell if the result fits in uint31.
This works quite well and removes about as many coercions as SSA.
It misses some coercions due to lack of type information in tree_ir.
Added missing operators:
NumShr aka '>>>', valid on limited inputs.
NumDiv (Seems like a simple omission, boost some math code)
NumTruncatingDivideToSigned32
R=asgerf@google.com
Review URL: https://codereview.chromium.org/1393763004 .
All passes must now preserve valid parent pointers. Several passes
already did this (or tried to do it).
The IR integrity checker can now check that parent pointers are valid.
This has caught a number of missing parent pointers assignments in
passes that otherwise tried to preserve them.
All node constructors now set parent pointers. This is very convenient
for simple transformations, but also a bit of a trap since updating a
field on an existing node does not update the parent pointer.
This is a pretty heavy-handed change. The main rationale for it are:
- The helpers methods require parent pointers, so they are more useful
when parent pointers are always set.
- The integrity checker can catch bogus parent pointers after passes
that have to maintain them anyway.
- The integrity checker is super slow, but this can finally be fixed
if it can assume parent pointers are valid (not part of this CL).
The IR visitors have been changed a bit to support a generic parent
visitor that does not have to implement every visit method.
The 'parent index' fields have been removed.
BUG=
R=kmillikin@google.com
Review URL: https://codereview.chromium.org//1375213003 .