Chromium Code Reviews
DescriptionSplit the computation of uninstantiated type arguments between the factory case
and the constructor case, as suggested in my review of
https://chromiumcodereview.appspot.com/9700003/
Examples of generated IL (first factory, second non-factory).
foo() { return new List<T>(); }
moo() { return new A<T>(); }
==== file:///home/regis/test.dart_A_foo
0: [target]
t0 <- LoadLocal(this)
t0 <- NativeLoadField(t0, 16)
t0 <- ExtractFactoryTypeArguments(t0)
t0 <- StaticCall(List., t0)
return t0
==== file:///home/regis/test.dart_A_moo
0: [target]
t0 <- #null
t1 <- LoadLocal(this)
t1 <- NativeLoadField(t1, 16)
t2 <- Pick(t1)
t2 <- ExtractConstructorTypeArguments(t2)
t0 := t2
t1 <- ExtractConstructorInstantiator(t1, t2)
t0 <- AllocateObject(Library:'file:///home/regis/test.dart' Class: A, t0, t1)
t1 <- Pick(t0)
t2 <- #3
StaticCall(A., t1, t2)
return t0
This change removes the computation that previously returned two values at the
cost of a some small code duplication. We could address this duplication by
exposing the computation recognizing the identity vector at the IL level and
implement a branch.
Committed: https://code.google.com/p/dart/source/detail?r=5537
Patch Set 1 #
Total comments: 6
Patch Set 2 : #
Messages
Total messages: 3 (0 generated)
|
||||||||||||||||||||||||||||||||||||||||||||||