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

Issue 9700003: Implement more of allocation code using type arguments. Type argument extraction for non-factories … (Closed)

Created:
8 years, 9 months ago by srdjan
Modified:
8 years, 9 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Implement more of allocation code using type arguments. Type argument extraction for non-factories produces two results, however, instructions can produce only one temporary. Use a stack placeholder so that we have room to push two results. Examples of generated IL (first factory, second non-factory). foo() { return new List<T>(); } moo() { return new A<T>(); } ==== file:///sources/dartall/dart/runtime/Test.dart_A_foo 0: [target] t1 <- LoadLocal(this) t1 <- NativeLoadField(t1, 16) t1 <- ExtractTypeArguments(t1) t0 <- StaticCall(List., t0) return t0 ==== file:///sources/dartall/dart/runtime/Test.dart_A_moo 0: [target] t0 <- #null t1 <- LoadLocal(this) t1 <- NativeLoadField(t1, 16) t1 <- ExtractTypeArguments(t1) t0 <- AllocateObject(Library:'file:///sources/dartall/dart/runtime/Test.dart' Class: A, t0, t1) t1 <- Pick(t0) t2 <- #3 StaticCall(A., t1, t2) return t0 Committed: https://code.google.com/p/dart/source/detail?r=5480

Patch Set 1 #

Total comments: 2

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+203 lines, -1 line) Patch
M runtime/vm/flow_graph_builder.h View 1 1 chunk +10 lines, -0 lines 0 comments Download
M runtime/vm/flow_graph_builder.cc View 1 3 chunks +78 lines, -1 line 0 comments Download
M runtime/vm/flow_graph_compiler_x64.cc View 1 1 chunk +66 lines, -0 lines 0 comments Download
M runtime/vm/intermediate_language.h View 1 3 chunks +49 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
srdjan
8 years, 9 months ago (2012-03-14 00:33:16 UTC) #1
regis
LGTM You can submit now and we can refactor the code so that ExtractTypeArguments does ...
8 years, 9 months ago (2012-03-14 18:30:04 UTC) #2
srdjan
8 years, 9 months ago (2012-03-14 18:48:34 UTC) #3
Thanks for the review. It would be great if you could tackle the splitting as
you suggested.

https://chromiumcodereview.appspot.com/9700003/diff/1/runtime/vm/flow_graph_b...
File runtime/vm/flow_graph_builder.h (right):

https://chromiumcodereview.appspot.com/9700003/diff/1/runtime/vm/flow_graph_b...
runtime/vm/flow_graph_builder.h:120: Value*
GenerateInstantiatorTypeArguments(intptr_t token_index,
On 2012/03/14 18:30:04, regis wrote:
> GenerateInstantiatorTypeArguments and BuildTypeArguments above are missing
> comments.

Added comments.

  // Creates type arguments (one or two values in 'args') used in preparation
  // of a constructor or factory call.
  // For factory call instantiates and returns type argument vector in 'args'.
  // For constructor call returns type arguments and type arguments of the
  // instantiator.
  // May be called only if allocating an object of a parameterized class.
  void BuildTypeArguments(ConstructorCallNode* node,
                          ZoneGrowableArray<Value*>* args);

  // Returns the value of the type arguments of the instantiator.
  Value* GenerateInstantiatorTypeArguments(intptr_t token_index,
                                           intptr_t type_arguments);

Powered by Google App Engine
This is Rietveld 408576698