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

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

Issue 13455008: There are still issues with using guarded-cid (tests/compiler/dart2js/cpa_inference_test.dart fails… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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 | « no previous file | no next file » | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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_optimizer.h" 5 #include "vm/flow_graph_optimizer.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/cha.h" 8 #include "vm/cha.h"
9 #include "vm/flow_graph_builder.h" 9 #include "vm/flow_graph_builder.h"
10 #include "vm/flow_graph_compiler.h" 10 #include "vm/flow_graph_compiler.h"
11 #include "vm/hash_map.h" 11 #include "vm/hash_map.h"
12 #include "vm/il_printer.h" 12 #include "vm/il_printer.h"
13 #include "vm/intermediate_language.h" 13 #include "vm/intermediate_language.h"
14 #include "vm/object_store.h" 14 #include "vm/object_store.h"
15 #include "vm/parser.h" 15 #include "vm/parser.h"
16 #include "vm/resolver.h" 16 #include "vm/resolver.h"
17 #include "vm/scopes.h" 17 #include "vm/scopes.h"
18 #include "vm/symbols.h" 18 #include "vm/symbols.h"
19 19
20 namespace dart { 20 namespace dart {
21 21
22 DEFINE_FLAG(bool, array_bounds_check_elimination, true, 22 DEFINE_FLAG(bool, array_bounds_check_elimination, true,
23 "Eliminate redundant bounds checks."); 23 "Eliminate redundant bounds checks.");
24 // TODO(srdjan): Enable/remove flag once it works.
25 DEFINE_FLAG(bool, inline_getter_with_guarded_cid, false,
26 "Inline implict getter using guarded cid");
24 DEFINE_FLAG(bool, load_cse, true, "Use redundant load elimination."); 27 DEFINE_FLAG(bool, load_cse, true, "Use redundant load elimination.");
25 DEFINE_FLAG(int, max_polymorphic_checks, 4, 28 DEFINE_FLAG(int, max_polymorphic_checks, 4,
26 "Maximum number of polymorphic check, otherwise it is megamorphic."); 29 "Maximum number of polymorphic check, otherwise it is megamorphic.");
27 DEFINE_FLAG(bool, remove_redundant_phis, true, "Remove redundant phis."); 30 DEFINE_FLAG(bool, remove_redundant_phis, true, "Remove redundant phis.");
28 DEFINE_FLAG(bool, trace_constant_propagation, false, 31 DEFINE_FLAG(bool, trace_constant_propagation, false,
29 "Print constant propagation and useless code elimination."); 32 "Print constant propagation and useless code elimination.");
30 DEFINE_FLAG(bool, trace_optimization, false, "Print optimization details."); 33 DEFINE_FLAG(bool, trace_optimization, false, "Print optimization details.");
31 DEFINE_FLAG(bool, trace_range_analysis, false, "Trace range analysis progress"); 34 DEFINE_FLAG(bool, trace_range_analysis, false, "Trace range analysis progress");
32 DEFINE_FLAG(bool, truncating_left_shift, true, 35 DEFINE_FLAG(bool, truncating_left_shift, true,
33 "Optimize left shift to truncate if possible"); 36 "Optimize left shift to truncate if possible");
(...skipping 1167 matching lines...) Expand 10 before | Expand all | Expand 10 after
1201 } 1204 }
1202 load->set_field(&Field::ZoneHandle(field.raw())); 1205 load->set_field(&Field::ZoneHandle(field.raw()));
1203 } 1206 }
1204 load->set_field_name(String::Handle(field.name()).ToCString()); 1207 load->set_field_name(String::Handle(field.name()).ToCString());
1205 1208
1206 // Discard the environment from the original instruction because the load 1209 // Discard the environment from the original instruction because the load
1207 // can't deoptimize. 1210 // can't deoptimize.
1208 call->RemoveEnvironment(); 1211 call->RemoveEnvironment();
1209 ReplaceCall(call, load); 1212 ReplaceCall(call, load);
1210 1213
1211 if (load->result_cid() != kDynamicCid) { 1214 if (FLAG_inline_getter_with_guarded_cid) {
1212 // Reset value types if guarded_cid was used. 1215 if (load->result_cid() != kDynamicCid) {
1213 for (Value::Iterator it(load->input_use_list()); !it.Done(); it.Advance()) { 1216 // Reset value types if guarded_cid was used.
1214 it.Current()->SetReachingType(NULL); 1217 for (Value::Iterator it(load->input_use_list());
1218 !it.Done();
1219 it.Advance()) {
1220 it.Current()->SetReachingType(NULL);
1221 }
1215 } 1222 }
1216 } 1223 }
1217 } 1224 }
1218 1225
1219 1226
1220 void FlowGraphOptimizer::InlineArrayLengthGetter(InstanceCallInstr* call, 1227 void FlowGraphOptimizer::InlineArrayLengthGetter(InstanceCallInstr* call,
1221 intptr_t length_offset, 1228 intptr_t length_offset,
1222 bool is_immutable, 1229 bool is_immutable,
1223 MethodRecognizer::Kind kind) { 1230 MethodRecognizer::Kind kind) {
1224 AddReceiverCheck(call); 1231 AddReceiverCheck(call);
(...skipping 3500 matching lines...) Expand 10 before | Expand all | Expand 10 after
4725 if (changed) { 4732 if (changed) {
4726 // We may have changed the block order and the dominator tree. 4733 // We may have changed the block order and the dominator tree.
4727 flow_graph->DiscoverBlocks(); 4734 flow_graph->DiscoverBlocks();
4728 GrowableArray<BitVector*> dominance_frontier; 4735 GrowableArray<BitVector*> dominance_frontier;
4729 flow_graph->ComputeDominators(&dominance_frontier); 4736 flow_graph->ComputeDominators(&dominance_frontier);
4730 } 4737 }
4731 } 4738 }
4732 4739
4733 4740
4734 } // namespace dart 4741 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698