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

Side by Side Diff: runtime/vm/flow_graph_builder.h

Issue 9700003: Implement more of allocation code using type arguments. Type argument extraction for non-factories … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_FLOW_GRAPH_BUILDER_H_ 5 #ifndef VM_FLOW_GRAPH_BUILDER_H_
6 #define VM_FLOW_GRAPH_BUILDER_H_ 6 #define VM_FLOW_GRAPH_BUILDER_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/ast.h" 9 #include "vm/ast.h"
10 #include "vm/growable_array.h" 10 #include "vm/growable_array.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 int BuildIncrOpIndexedLoad(IncrOpIndexedNode* node, int start_index); 107 int BuildIncrOpIndexedLoad(IncrOpIndexedNode* node, int start_index);
108 108
109 // Build the increment part of an increment operation (add or subtract 1). 109 // Build the increment part of an increment operation (add or subtract 1).
110 // The original value is expected to be named with start_index-1, and the 110 // The original value is expected to be named with start_index-1, and the
111 // result will be named with start_index. 111 // result will be named with start_index.
112 void BuildIncrOpIncrement(Token::Kind kind, 112 void BuildIncrOpIncrement(Token::Kind kind,
113 intptr_t node_id, 113 intptr_t node_id,
114 intptr_t token_index, 114 intptr_t token_index,
115 int start_index); 115 int start_index);
116 116
117 // Creates type arguments (one or two values in 'args') used in preparation
118 // of a constructor or factory call.
119 // For factory call instantiates and returns type argument vector in 'args'.
120 // For constructor call returns type arguments and type arguments of the
121 // instantiator.
122 // May be called only if allocating an object of a parameterized class.
117 void BuildTypeArguments(ConstructorCallNode* node, 123 void BuildTypeArguments(ConstructorCallNode* node,
118 ZoneGrowableArray<Value*>* args); 124 ZoneGrowableArray<Value*>* args);
119 125
126 // Returns the value of the type arguments of the instantiator.
127 Value* GenerateInstantiatorTypeArguments(intptr_t token_index,
128 intptr_t type_arguments);
129
120 void CloseFragment() { exit_ = NULL; } 130 void CloseFragment() { exit_ = NULL; }
121 intptr_t AllocateTempIndex() { return temp_index_++; } 131 intptr_t AllocateTempIndex() { return temp_index_++; }
122 132
123 private: 133 private:
124 // Specify a computation as the final result. Adds a Do instruction to 134 // Specify a computation as the final result. Adds a Do instruction to
125 // the graph, but normally overridden in subclasses. 135 // the graph, but normally overridden in subclasses.
126 virtual void ReturnComputation(Computation* computation) { 136 virtual void ReturnComputation(Computation* computation) {
127 AddInstruction(new DoInstr(computation)); 137 AddInstruction(new DoInstr(computation));
128 } 138 }
129 139
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 } 266 }
257 267
258 // Output parameters. 268 // Output parameters.
259 BlockEntryInstr** true_successor_address_; 269 BlockEntryInstr** true_successor_address_;
260 BlockEntryInstr** false_successor_address_; 270 BlockEntryInstr** false_successor_address_;
261 }; 271 };
262 272
263 } // namespace dart 273 } // namespace dart
264 274
265 #endif // VM_FLOW_GRAPH_BUILDER_H_ 275 #endif // VM_FLOW_GRAPH_BUILDER_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698