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

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

Issue 10668034: Recognize leaf functions: skip stack check and populating the pc slot, store the pc slot lazily in … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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
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 9
10 namespace dart { 10 namespace dart {
(...skipping 28 matching lines...) Expand all
39 bool TryReplaceWithUnaryOp(InstanceCallComp* comp, Token::Kind op_kind); 39 bool TryReplaceWithUnaryOp(InstanceCallComp* comp, Token::Kind op_kind);
40 40
41 bool TryInlineInstanceGetter(InstanceCallComp* comp); 41 bool TryInlineInstanceGetter(InstanceCallComp* comp);
42 bool TryInlineInstanceSetter(InstanceSetterComp* comp); 42 bool TryInlineInstanceSetter(InstanceSetterComp* comp);
43 43
44 bool TryInlineInstanceMethod(InstanceCallComp* comp); 44 bool TryInlineInstanceMethod(InstanceCallComp* comp);
45 45
46 DISALLOW_COPY_AND_ASSIGN(FlowGraphOptimizer); 46 DISALLOW_COPY_AND_ASSIGN(FlowGraphOptimizer);
47 }; 47 };
48 48
49
50 // Analyze the generated flow graph. Currently only if it is a leaf
51 // method, i.e., does not contain any calls to runtime or other Dart code.
52 class FlowGraphAnalyzer : public ValueObject {
53 public:
54 explicit FlowGraphAnalyzer(const GrowableArray<BlockEntryInstr*>& blocks);
55 virtual ~FlowGraphAnalyzer() {}
56
57 void Analyze();
58
59 bool is_leaf() const { return is_leaf_; }
60
61 private:
62 const GrowableArray<BlockEntryInstr*>& blocks_;
63 bool is_leaf_;
64
65 DISALLOW_COPY_AND_ASSIGN(FlowGraphAnalyzer);
66 };
67
49 } // namespace dart 68 } // namespace dart
50 69
51 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_ 70 #endif // VM_FLOW_GRAPH_OPTIMIZER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698