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

Side by Side Diff: runtime/vm/flow_graph.cc

Issue 564843002: Initial steps towards cleaning up integer arithmetic IR. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 #include "vm/flow_graph.h" 5 #include "vm/flow_graph.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/flow_graph_builder.h" 8 #include "vm/flow_graph_builder.h"
9 #include "vm/intermediate_language.h" 9 #include "vm/intermediate_language.h"
10 #include "vm/growable_array.h" 10 #include "vm/growable_array.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 return ShouldReorderBlocks(parsed_function().function(), is_optimized) 88 return ShouldReorderBlocks(parsed_function().function(), is_optimized)
89 ? &optimized_block_order_ 89 ? &optimized_block_order_
90 : &reverse_postorder_; 90 : &reverse_postorder_;
91 } 91 }
92 92
93 93
94 ConstantInstr* FlowGraph::GetConstant(const Object& object) { 94 ConstantInstr* FlowGraph::GetConstant(const Object& object) {
95 ConstantInstr* constant = constant_instr_pool_.Lookup(object); 95 ConstantInstr* constant = constant_instr_pool_.Lookup(object);
96 if (constant == NULL) { 96 if (constant == NULL) {
97 // Otherwise, allocate and add it to the pool. 97 // Otherwise, allocate and add it to the pool.
98 constant = new(isolate()) ConstantInstr(object); 98 constant = new(isolate()) ConstantInstr(Object::ZoneHandle(object.raw()));
srdjan 2014/09/11 17:38:11 isolate(), object.raw()
99 constant->set_ssa_temp_index(alloc_ssa_temp_index()); 99 constant->set_ssa_temp_index(alloc_ssa_temp_index());
100 AddToInitialDefinitions(constant); 100 AddToInitialDefinitions(constant);
101 constant_instr_pool_.Insert(constant); 101 constant_instr_pool_.Insert(constant);
102 } 102 }
103 return constant; 103 return constant;
104 } 104 }
105 105
106 106
107 void FlowGraph::AddToInitialDefinitions(Definition* defn) { 107 void FlowGraph::AddToInitialDefinitions(Definition* defn) {
108 // TODO(zerny): Set previous to the graph entry so it is accessible by 108 // TODO(zerny): Set previous to the graph entry so it is accessible by
(...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after
1254 } 1254 }
1255 1255
1256 1256
1257 bool BlockEffects::IsSideEffectFreePath(BlockEntryInstr* from, 1257 bool BlockEffects::IsSideEffectFreePath(BlockEntryInstr* from,
1258 BlockEntryInstr* to) const { 1258 BlockEntryInstr* to) const {
1259 return available_at_[to->postorder_number()]->Contains( 1259 return available_at_[to->postorder_number()]->Contains(
1260 from->postorder_number()); 1260 from->postorder_number());
1261 } 1261 }
1262 1262
1263 } // namespace dart 1263 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698