Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(309)

Issue 9703080: Split the computation of uninstantiated type arguments between the factory case (Closed)

Created:
8 years, 9 months ago by regis
Modified:
8 years, 9 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Split 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 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+272 lines, -89 lines) Patch
M runtime/vm/flow_graph_builder.h View 1 2 chunks +17 lines, -12 lines 0 comments Download
M runtime/vm/flow_graph_builder.cc View 1 9 chunks +82 lines, -41 lines 0 comments Download
M runtime/vm/flow_graph_compiler_x64.cc View 1 2 chunks +104 lines, -29 lines 0 comments Download
M runtime/vm/intermediate_language.h View 1 5 chunks +69 lines, -7 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
regis
8 years, 9 months ago (2012-03-15 19:08:01 UTC) #1
srdjan
LGTM https://chromiumcodereview.appspot.com/9703080/diff/1/runtime/vm/intermediate_language.h File runtime/vm/intermediate_language.h (right): https://chromiumcodereview.appspot.com/9703080/diff/1/runtime/vm/intermediate_language.h#newcode733 runtime/vm/intermediate_language.h:733: DECLARE_COMPUTATION(ExtractFactoryTypeArgumentsComp) DEFCLARE_COMPUTATION(ExtractFactoryTypeArguments) ... no Comp... can you fix ...
8 years, 9 months ago (2012-03-15 19:58:05 UTC) #2
regis
8 years, 9 months ago (2012-03-15 20:13:02 UTC) #3
Thanks!

https://chromiumcodereview.appspot.com/9703080/diff/1/runtime/vm/intermediate...
File runtime/vm/intermediate_language.h (right):

https://chromiumcodereview.appspot.com/9703080/diff/1/runtime/vm/intermediate...
runtime/vm/intermediate_language.h:712: DECLARE_COMPUTATION(NativeLoadFieldComp)
I fixed this one too.

https://chromiumcodereview.appspot.com/9703080/diff/1/runtime/vm/intermediate...
runtime/vm/intermediate_language.h:733:
DECLARE_COMPUTATION(ExtractFactoryTypeArgumentsComp)
On 2012/03/15 19:58:05, srdjan wrote:
> DEFCLARE_COMPUTATION(ExtractFactoryTypeArguments)  ... no Comp... can you fix
> the NativeLoadField above as well?

Done.

https://chromiumcodereview.appspot.com/9703080/diff/1/runtime/vm/intermediate...
runtime/vm/intermediate_language.h:759:
DECLARE_COMPUTATION(ExtractConstructorTypeArgumentsComp)
Fixed this one too.

https://chromiumcodereview.appspot.com/9703080/diff/1/runtime/vm/intermediate...
runtime/vm/intermediate_language.h:788:
DECLARE_COMPUTATION(ExtractConstructorInstantiatorComp)
On 2012/03/15 19:58:05, srdjan wrote:
> ditto

Done.

Powered by Google App Engine
This is Rietveld 408576698