Descriptiondart2js cps: More interceptor optimizations and fixes.
When the result of getInterceptor is either null or a known constant,
it is compiled to `x && const` or `x == null ? x : const` depending
on whether there are any other falsy values for that type.
This required some changes to share_interceptors so it can share/hoist
the constant subexpression separately from the whole expression.
The Interceptor root class is removed from the intercepted classes of
getInterceptor when it is "shadowed" by all the other intercepted classes.
E.g. if the input is a number or a string, there is no need
to intercept for {JSNumber, JSString, Interceptor}, because JSNumber
and JSString collectively shadow Interceptor.
R=sra@google.com
Committed: https://github.com/dart-lang/sdk/commit/f712e08e949f39f72fe7a446995f5b7dbf6f590d
Patch Set 1 #
Total comments: 8
Patch Set 2 : Fix exactness check #Patch Set 3 : Merge #
Total comments: 1
Patch Set 4 : Optimize for single class again, and fix hoisting bug #Patch Set 5 : Blank line fix #Patch Set 6 : Merge #Patch Set 7 : Do not intercept for compile-time classes #Patch Set 8 : Remove unused getter again #
Total comments: 8
Patch Set 9 : Comments #Patch Set 10 : Merge #Patch Set 11 : Fix indentation #Messages
Total messages: 10 (1 generated)
|