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

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

Issue 10021070: Move type check elimination from backend to graph builder in new compiler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 // preparation of a constructor call. 149 // preparation of a constructor call.
150 // May be called only if allocating an object of a parameterized class. 150 // May be called only if allocating an object of a parameterized class.
151 void BuildConstructorTypeArguments(ConstructorCallNode* node, 151 void BuildConstructorTypeArguments(ConstructorCallNode* node,
152 intptr_t start_index, 152 intptr_t start_index,
153 ZoneGrowableArray<Value*>* args); 153 ZoneGrowableArray<Value*>* args);
154 154
155 // Returns the value of the type arguments of the instantiator. 155 // Returns the value of the type arguments of the instantiator.
156 Value* BuildInstantiatorTypeArguments(intptr_t token_index, 156 Value* BuildInstantiatorTypeArguments(intptr_t token_index,
157 intptr_t start_index); 157 intptr_t start_index);
158 158
159 // Perform a type check on the given value.
160 void BuildAssertAssignable(intptr_t node_id,
161 intptr_t token_index,
162 Value* value,
163 const AbstractType& dst_type,
164 const String& dst_name,
165 intptr_t start_index);
166
167 // Perform a type check on the given value and return it.
168 Value* BuildAssignableValue(intptr_t node_id,
169 intptr_t token_index,
170 Value* value,
171 const AbstractType& dst_type,
172 const String& dst_name,
173 intptr_t start_index);
174
159 virtual void BuildInstanceOf(ComparisonNode* node); 175 virtual void BuildInstanceOf(ComparisonNode* node);
160 176
161 bool MustSaveRestoreContext(SequenceNode* node) const; 177 bool MustSaveRestoreContext(SequenceNode* node) const;
162 178
163 // Moves parent context into the context register. 179 // Moves parent context into the context register.
164 void UnchainContext(); 180 void UnchainContext();
165 181
166 void CloseFragment() { exit_ = NULL; } 182 void CloseFragment() { exit_ = NULL; }
167 intptr_t AllocateTempIndex() { return temp_index_++; } 183 intptr_t AllocateTempIndex() { return temp_index_++; }
168 184
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 // function from an AstNode and next temporary index to a graph fragment (as 220 // function from an AstNode and next temporary index to a graph fragment (as
205 // in the EffectGraphVisitor), a next temporary index, and an intermediate 221 // in the EffectGraphVisitor), a next temporary index, and an intermediate
206 // language Value. 222 // language Value.
207 class ValueGraphVisitor : public EffectGraphVisitor { 223 class ValueGraphVisitor : public EffectGraphVisitor {
208 public: 224 public:
209 ValueGraphVisitor(FlowGraphBuilder* owner, intptr_t temp_index) 225 ValueGraphVisitor(FlowGraphBuilder* owner, intptr_t temp_index)
210 : EffectGraphVisitor(owner, temp_index), value_(NULL) { } 226 : EffectGraphVisitor(owner, temp_index), value_(NULL) { }
211 227
212 // Visit functions overridden by this class. 228 // Visit functions overridden by this class.
213 virtual void VisitLiteralNode(LiteralNode* node); 229 virtual void VisitLiteralNode(LiteralNode* node);
230 virtual void VisitAssignableNode(AssignableNode* node);
214 virtual void VisitIncrOpLocalNode(IncrOpLocalNode* node); 231 virtual void VisitIncrOpLocalNode(IncrOpLocalNode* node);
215 virtual void VisitIncrOpInstanceFieldNode(IncrOpInstanceFieldNode* node); 232 virtual void VisitIncrOpInstanceFieldNode(IncrOpInstanceFieldNode* node);
216 virtual void VisitIncrOpIndexedNode(IncrOpIndexedNode* node); 233 virtual void VisitIncrOpIndexedNode(IncrOpIndexedNode* node);
217 virtual void VisitConstructorCallNode(ConstructorCallNode* node); 234 virtual void VisitConstructorCallNode(ConstructorCallNode* node);
218 virtual void VisitBinaryOpNode(BinaryOpNode* node); 235 virtual void VisitBinaryOpNode(BinaryOpNode* node);
219 virtual void VisitConditionalExprNode(ConditionalExprNode* node); 236 virtual void VisitConditionalExprNode(ConditionalExprNode* node);
220 virtual void VisitLoadLocalNode(LoadLocalNode* node); 237 virtual void VisitLoadLocalNode(LoadLocalNode* node);
221 virtual void VisitThrowNode(ThrowNode* node); 238 virtual void VisitThrowNode(ThrowNode* node);
222 239
223 Value* value() const { return value_; } 240 Value* value() const { return value_; }
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 TargetEntryInstr** true_successor_address_; 340 TargetEntryInstr** true_successor_address_;
324 TargetEntryInstr** false_successor_address_; 341 TargetEntryInstr** false_successor_address_;
325 342
326 intptr_t condition_node_id_; 343 intptr_t condition_node_id_;
327 intptr_t condition_token_index_; 344 intptr_t condition_token_index_;
328 }; 345 };
329 346
330 } // namespace dart 347 } // namespace dart
331 348
332 #endif // VM_FLOW_GRAPH_BUILDER_H_ 349 #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