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

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

Issue 78733002: Generalize if-conversion to arbitrary smi comparisons. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: added missing test file Created 7 years, 1 month 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 | runtime/vm/flow_graph_builder.cc » ('j') | runtime/vm/flow_graph_builder.cc » ('J')
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/compiler.h" 5 #include "vm/compiler.h"
6 6
7 #include "vm/assembler.h" 7 #include "vm/assembler.h"
8 8
9 #include "vm/ast_printer.h" 9 #include "vm/ast_printer.h"
10 #include "vm/block_scheduler.h" 10 #include "vm/block_scheduler.h"
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 363
364 // Propagate types and eliminate more type tests. 364 // Propagate types and eliminate more type tests.
365 FlowGraphTypePropagator::Propagate(flow_graph); 365 FlowGraphTypePropagator::Propagate(flow_graph);
366 DEBUG_ASSERT(flow_graph->VerifyUseLists()); 366 DEBUG_ASSERT(flow_graph->VerifyUseLists());
367 367
368 // Use propagated class-ids to optimize further. 368 // Use propagated class-ids to optimize further.
369 optimizer.ApplyClassIds(); 369 optimizer.ApplyClassIds();
370 DEBUG_ASSERT(flow_graph->VerifyUseLists()); 370 DEBUG_ASSERT(flow_graph->VerifyUseLists());
371 371
372 // Do optimizations that depend on the propagated type information. 372 // Do optimizations that depend on the propagated type information.
373 optimizer.Canonicalize(); 373 if (optimizer.Canonicalize()) {
374 // Invoke Canonicalize twice in order to fully canonicalize certains
Kevin Millikin (Google) 2013/11/22 14:09:34 certains ==> certain, or just get rid of it becaus
375 // patterns like "if (a & const == 0) { }".
376 optimizer.Canonicalize();
377 }
374 DEBUG_ASSERT(flow_graph->VerifyUseLists()); 378 DEBUG_ASSERT(flow_graph->VerifyUseLists());
375 379
376 BranchSimplifier::Simplify(flow_graph); 380 BranchSimplifier::Simplify(flow_graph);
377 DEBUG_ASSERT(flow_graph->VerifyUseLists()); 381 DEBUG_ASSERT(flow_graph->VerifyUseLists());
378 382
379 IfConverter::Simplify(flow_graph); 383 IfConverter::Simplify(flow_graph);
380 DEBUG_ASSERT(flow_graph->VerifyUseLists()); 384 DEBUG_ASSERT(flow_graph->VerifyUseLists());
381 385
382 if (FLAG_constant_propagation) { 386 if (FLAG_constant_propagation) {
383 ConstantPropagator::Optimize(flow_graph); 387 ConstantPropagator::Optimize(flow_graph);
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
928 Object::Handle(isolate->object_store()->sticky_error()); 932 Object::Handle(isolate->object_store()->sticky_error());
929 isolate->object_store()->clear_sticky_error(); 933 isolate->object_store()->clear_sticky_error();
930 isolate->set_long_jump_base(base); 934 isolate->set_long_jump_base(base);
931 return result.raw(); 935 return result.raw();
932 } 936 }
933 UNREACHABLE(); 937 UNREACHABLE();
934 return Object::null(); 938 return Object::null();
935 } 939 }
936 940
937 } // namespace dart 941 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_builder.cc » ('j') | runtime/vm/flow_graph_builder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698