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

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

Issue 10855007: Store variable counts in the flow graph builder. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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_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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 void AddCatchEntry(TargetEntryInstr* entry); 43 void AddCatchEntry(TargetEntryInstr* entry);
44 44
45 intptr_t current_ssa_temp_index() const { 45 intptr_t current_ssa_temp_index() const {
46 return current_ssa_temp_index_; 46 return current_ssa_temp_index_;
47 } 47 }
48 48
49 intptr_t alloc_ssa_temp_index() { 49 intptr_t alloc_ssa_temp_index() {
50 return current_ssa_temp_index_++; 50 return current_ssa_temp_index_++;
51 } 51 }
52 52
53 intptr_t copied_parameter_count() const { return copied_parameter_count_; }
54
53 private: 55 private:
56 intptr_t parameter_count() const {
57 return copied_parameter_count_ + non_copied_parameter_count_;
58 }
59 intptr_t variable_count() const {
60 return parameter_count() + stack_local_count_;
61 }
62
54 void ComputeDominators(GrowableArray<BlockEntryInstr*>* preorder, 63 void ComputeDominators(GrowableArray<BlockEntryInstr*>* preorder,
55 GrowableArray<intptr_t>* parent, 64 GrowableArray<intptr_t>* parent,
56 GrowableArray<BitVector*>* dominance_frontier); 65 GrowableArray<BitVector*>* dominance_frontier);
57 66
58 void CompressPath(intptr_t start_index, 67 void CompressPath(intptr_t start_index,
59 intptr_t current_index, 68 intptr_t current_index,
60 GrowableArray<intptr_t>* parent, 69 GrowableArray<intptr_t>* parent,
61 GrowableArray<intptr_t>* label); 70 GrowableArray<intptr_t>* label);
62 71
63 void Rename(intptr_t stack_local_count, 72 void Rename();
64 intptr_t fixed_parameter_count,
65 intptr_t copied_parameter_count);
66 void RenameRecursive(BlockEntryInstr* block_entry, 73 void RenameRecursive(BlockEntryInstr* block_entry,
67 GrowableArray<Value*>* env, 74 GrowableArray<Value*>* env);
68 intptr_t var_count,
69 intptr_t param_count);
70 75
71 void InsertPhis(const GrowableArray<BlockEntryInstr*>& preorder, 76 void InsertPhis(const GrowableArray<BlockEntryInstr*>& preorder,
72 const GrowableArray<BitVector*>& assigned_vars, 77 const GrowableArray<BitVector*>& assigned_vars,
73 const intptr_t var_count,
74 const GrowableArray<BitVector*>& dom_frontier); 78 const GrowableArray<BitVector*>& dom_frontier);
75 79
76 const ParsedFunction& parsed_function_; 80 const ParsedFunction& parsed_function_;
81
82 const intptr_t copied_parameter_count_;
83 const intptr_t non_copied_parameter_count_;
84 const intptr_t stack_local_count_; // Does not include any parameters.
85
77 GrowableArray<BlockEntryInstr*> preorder_block_entries_; 86 GrowableArray<BlockEntryInstr*> preorder_block_entries_;
78 GrowableArray<BlockEntryInstr*> postorder_block_entries_; 87 GrowableArray<BlockEntryInstr*> postorder_block_entries_;
79 intptr_t context_level_; 88 intptr_t context_level_;
80 intptr_t last_used_try_index_; 89 intptr_t last_used_try_index_;
81 intptr_t try_index_; 90 intptr_t try_index_;
82 GraphEntryInstr* graph_entry_; 91 GraphEntryInstr* graph_entry_;
83 intptr_t current_ssa_temp_index_; 92 intptr_t current_ssa_temp_index_;
84 93
85 DISALLOW_IMPLICIT_CONSTRUCTORS(FlowGraphBuilder); 94 DISALLOW_IMPLICIT_CONSTRUCTORS(FlowGraphBuilder);
86 }; 95 };
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 // Output parameters. 366 // Output parameters.
358 TargetEntryInstr** true_successor_address_; 367 TargetEntryInstr** true_successor_address_;
359 TargetEntryInstr** false_successor_address_; 368 TargetEntryInstr** false_successor_address_;
360 369
361 intptr_t condition_token_pos_; 370 intptr_t condition_token_pos_;
362 }; 371 };
363 372
364 } // namespace dart 373 } // namespace dart
365 374
366 #endif // VM_FLOW_GRAPH_BUILDER_H_ 375 #endif // VM_FLOW_GRAPH_BUILDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698