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

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

Issue 15507006: Improve constant propagation for Mint and Smi. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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_optimizer.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_OPTIMIZER_H_ 5 #ifndef VM_FLOW_GRAPH_OPTIMIZER_H_
6 #define VM_FLOW_GRAPH_OPTIMIZER_H_ 6 #define VM_FLOW_GRAPH_OPTIMIZER_H_
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 #include "vm/flow_graph.h" 9 #include "vm/flow_graph.h"
10 10
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 bool IsUnknown(const Object& value) { 260 bool IsUnknown(const Object& value) {
261 return value.raw() == unknown_.raw(); 261 return value.raw() == unknown_.raw();
262 } 262 }
263 bool IsNonConstant(const Object& value) { 263 bool IsNonConstant(const Object& value) {
264 return value.raw() == non_constant_.raw(); 264 return value.raw() == non_constant_.raw();
265 } 265 }
266 bool IsConstant(const Object& value) { 266 bool IsConstant(const Object& value) {
267 return !IsNonConstant(value) && !IsUnknown(value); 267 return !IsNonConstant(value) && !IsUnknown(value);
268 } 268 }
269 269
270 void HandleBinaryOp(Definition* instr,
271 Token::Kind op_kind,
272 const Value& left,
273 const Value& right);
274
270 virtual void VisitBlocks() { UNREACHABLE(); } 275 virtual void VisitBlocks() { UNREACHABLE(); }
271 276
272 #define DECLARE_VISIT(type) virtual void Visit##type(type##Instr* instr); 277 #define DECLARE_VISIT(type) virtual void Visit##type(type##Instr* instr);
273 FOR_EACH_INSTRUCTION(DECLARE_VISIT) 278 FOR_EACH_INSTRUCTION(DECLARE_VISIT)
274 #undef DECLARE_VISIT 279 #undef DECLARE_VISIT
275 280
276 FlowGraph* graph_; 281 FlowGraph* graph_;
277 282
278 // Sentinels for unknown constant and non-constant values. 283 // Sentinels for unknown constant and non-constant values.
279 const Object& unknown_; 284 const Object& unknown_;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 // Optimize spill stores inside try-blocks by identifying values that always 361 // Optimize spill stores inside try-blocks by identifying values that always
357 // contain a single known constant at catch block entry. 362 // contain a single known constant at catch block entry.
358 class TryCatchAnalyzer : public AllStatic { 363 class TryCatchAnalyzer : public AllStatic {
359 public: 364 public:
360 static void Optimize(FlowGraph* flow_graph); 365 static void Optimize(FlowGraph* flow_graph);
361 }; 366 };
362 367
363 } // namespace dart 368 } // namespace dart
364 369
365 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ 370 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698