Chromium Code Reviews
Descriptiondart2js cps: Always use interceptors and type tags for 'is' checks.
"x is Foo" will become getInterceptor(x).$isFoo
Testing against a type with type arguments is still a giveup().
This test always works, but is not very fast. For instance, testing
against an int should be "typeof x === 'number' && Math.floor(x) === x".
Following an offline discussion with Karl, the plan is to rewrite
'is'-checks to more fine-grained tests in a CPS optimization pass,
probably the type propagator.
Concretely, we plan to introduce IR nodes like TypeOfTest, FloorTest,
InstanceofTest, etc, which optimization phases can introduce under the
right circumstances. That way, the code generation phase remains simple.
BUG=
R=karlklose@google.com
Committed: https://github.com/dart-lang/sdk/commit/f42a0ef25cd042f7fdd2b6afdc3cbb2a36b6dfd4
Patch Set 1 #Patch Set 2 : Long line #
Total comments: 2
Patch Set 3 : Moved interceptor from unsugar to build-time #Patch Set 4 : Intercept TypeOperator in buildTry #Patch Set 5 : Rebase + status file #Messages
Total messages: 5 (1 generated)
|