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

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

Issue 328663002: Version 1.5.0-dev.4.5 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 6 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
« no previous file with comments | « dart/runtime/vm/flow_graph.h ('k') | dart/runtime/vm/flow_graph_builder.h » ('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 #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/longjump.h" 10 #include "vm/longjump.h"
(...skipping 24 matching lines...) Expand all
35 postorder_(), 35 postorder_(),
36 reverse_postorder_(), 36 reverse_postorder_(),
37 optimized_block_order_(), 37 optimized_block_order_(),
38 constant_null_(NULL), 38 constant_null_(NULL),
39 constant_dead_(NULL), 39 constant_dead_(NULL),
40 block_effects_(NULL), 40 block_effects_(NULL),
41 licm_allowed_(true), 41 licm_allowed_(true),
42 use_far_branches_(false), 42 use_far_branches_(false),
43 loop_headers_(NULL), 43 loop_headers_(NULL),
44 loop_invariant_loads_(NULL), 44 loop_invariant_loads_(NULL),
45 guarded_fields_(builder.guarded_fields()) { 45 guarded_fields_(builder.guarded_fields()),
46 deferred_prefixes_(builder.deferred_prefixes()) {
46 DiscoverBlocks(); 47 DiscoverBlocks();
47 } 48 }
48 49
49 50
50 void FlowGraph::AddToGuardedFields( 51 void FlowGraph::AddToGuardedFields(
51 ZoneGrowableArray<const Field*>* array, 52 ZoneGrowableArray<const Field*>* array,
52 const Field* field) { 53 const Field* field) {
53 if ((field->guarded_cid() == kDynamicCid) || 54 if ((field->guarded_cid() == kDynamicCid) ||
54 (field->guarded_cid() == kIllegalCid)) { 55 (field->guarded_cid() == kIllegalCid)) {
55 return; 56 return;
56 } 57 }
57 for (intptr_t j = 0; j < array->length(); j++) { 58 for (intptr_t j = 0; j < array->length(); j++) {
58 if ((*array)[j]->raw() == field->raw()) { 59 if ((*array)[j]->raw() == field->raw()) {
59 return; 60 return;
60 } 61 }
61 } 62 }
62 array->Add(field); 63 array->Add(field);
63 } 64 }
64 65
65 66
67 void FlowGraph::AddToDeferredPrefixes(
68 ZoneGrowableArray<const LibraryPrefix*>* from) {
69 ZoneGrowableArray<const LibraryPrefix*>* to = deferred_prefixes();
70 for (intptr_t i = 0; i < from->length(); i++) {
71 const LibraryPrefix* prefix = (*from)[i];
72 for (intptr_t j = 0; j < to->length(); j++) {
73 if ((*to)[j]->raw() == prefix->raw()) {
74 return;
75 }
76 }
77 to->Add(prefix);
78 }
79 }
80
81
66 bool FlowGraph::ShouldReorderBlocks(const Function& function, 82 bool FlowGraph::ShouldReorderBlocks(const Function& function,
67 bool is_optimized) { 83 bool is_optimized) {
68 return is_optimized && FLAG_reorder_basic_blocks && !function.is_intrinsic(); 84 return is_optimized && FLAG_reorder_basic_blocks && !function.is_intrinsic();
69 } 85 }
70 86
71 87
72 GrowableArray<BlockEntryInstr*>* FlowGraph::CodegenBlockOrder( 88 GrowableArray<BlockEntryInstr*>* FlowGraph::CodegenBlockOrder(
73 bool is_optimized) { 89 bool is_optimized) {
74 return ShouldReorderBlocks(parsed_function().function(), is_optimized) 90 return ShouldReorderBlocks(parsed_function().function(), is_optimized)
75 ? &optimized_block_order_ 91 ? &optimized_block_order_
(...skipping 1158 matching lines...) Expand 10 before | Expand all | Expand 10 after
1234 } 1250 }
1235 1251
1236 1252
1237 bool BlockEffects::IsSideEffectFreePath(BlockEntryInstr* from, 1253 bool BlockEffects::IsSideEffectFreePath(BlockEntryInstr* from,
1238 BlockEntryInstr* to) const { 1254 BlockEntryInstr* to) const {
1239 return available_at_[to->postorder_number()]->Contains( 1255 return available_at_[to->postorder_number()]->Contains(
1240 from->postorder_number()); 1256 from->postorder_number());
1241 } 1257 }
1242 1258
1243 } // namespace dart 1259 } // namespace dart
OLDNEW
« no previous file with comments | « dart/runtime/vm/flow_graph.h ('k') | dart/runtime/vm/flow_graph_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698