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

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

Issue 24837002: Optimize string interpolation by running it at compile time if all inputs are constant. This is don… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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 | « runtime/vm/flow_graph_builder.cc ('k') | 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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 } 275 }
276 bool IsConstant(const Object& value) { 276 bool IsConstant(const Object& value) {
277 return !IsNonConstant(value) && !IsUnknown(value); 277 return !IsNonConstant(value) && !IsUnknown(value);
278 } 278 }
279 279
280 void HandleBinaryOp(Definition* instr, 280 void HandleBinaryOp(Definition* instr,
281 Token::Kind op_kind, 281 Token::Kind op_kind,
282 const Value& left, 282 const Value& left,
283 const Value& right); 283 const Value& right);
284 284
285 void RemoveInterpolationInputs(const StaticCallInstr& call);
286
285 virtual void VisitBlocks() { UNREACHABLE(); } 287 virtual void VisitBlocks() { UNREACHABLE(); }
286 288
287 #define DECLARE_VISIT(type) virtual void Visit##type(type##Instr* instr); 289 #define DECLARE_VISIT(type) virtual void Visit##type(type##Instr* instr);
288 FOR_EACH_INSTRUCTION(DECLARE_VISIT) 290 FOR_EACH_INSTRUCTION(DECLARE_VISIT)
289 #undef DECLARE_VISIT 291 #undef DECLARE_VISIT
290 292
291 FlowGraph* graph_; 293 FlowGraph* graph_;
292 294
293 // Sentinels for unknown constant and non-constant values. 295 // Sentinels for unknown constant and non-constant values.
294 const Object& unknown_; 296 const Object& unknown_;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 // Optimize spill stores inside try-blocks by identifying values that always 373 // Optimize spill stores inside try-blocks by identifying values that always
372 // contain a single known constant at catch block entry. 374 // contain a single known constant at catch block entry.
373 class TryCatchAnalyzer : public AllStatic { 375 class TryCatchAnalyzer : public AllStatic {
374 public: 376 public:
375 static void Optimize(FlowGraph* flow_graph); 377 static void Optimize(FlowGraph* flow_graph);
376 }; 378 };
377 379
378 } // namespace dart 380 } // namespace dart
379 381
380 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ 382 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698