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

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

Issue 10918097: Allow smi comparisons to have constant operands. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler.cc » ('j') | runtime/vm/intermediate_language.h » ('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/flow_graph_allocator.h" 5 #include "vm/flow_graph_allocator.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 #include "vm/il_printer.h" 9 #include "vm/il_printer.h"
10 #include "vm/flow_graph.h" 10 #include "vm/flow_graph.h"
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 648
649 // Record the corresponding phi input use for each phi. 649 // Record the corresponding phi input use for each phi.
650 ZoneGrowableArray<PhiInstr*>* phis = join->phis(); 650 ZoneGrowableArray<PhiInstr*>* phis = join->phis();
651 intptr_t move_idx = 0; 651 intptr_t move_idx = 0;
652 for (intptr_t phi_idx = 0; phi_idx < phis->length(); phi_idx++) { 652 for (intptr_t phi_idx = 0; phi_idx < phis->length(); phi_idx++) {
653 PhiInstr* phi = (*phis)[phi_idx]; 653 PhiInstr* phi = (*phis)[phi_idx];
654 if (phi == NULL) continue; 654 if (phi == NULL) continue;
655 655
656 Value* val = phi->InputAt(pred_idx); 656 Value* val = phi->InputAt(pred_idx);
657 MoveOperands* move = parallel_move->MoveOperandsAt(move_idx); 657 MoveOperands* move = parallel_move->MoveOperandsAt(move_idx);
658
659 ConstantInstr* constant = val->definition()->AsConstant();
660 if (constant != NULL) {
661 move->set_src(Location::Constant(constant->value()));
662 move_idx++;
663 continue;
664 }
665
658 // Expected shape of live ranges: 666 // Expected shape of live ranges:
659 // 667 //
660 // g g' 668 // g g'
661 // value --* 669 // value --*
662 // 670 //
663 671
664 LiveRange* range = GetLiveRange(val->definition()->ssa_temp_index()); 672 LiveRange* range = GetLiveRange(val->definition()->ssa_temp_index());
665 673
666 range->AddUseInterval(block->start_pos(), pos); 674 range->AddUseInterval(block->start_pos(), pos);
667 range->AddHintedUse(pos, move->src_slot(), move->dest_slot()); 675 range->AddHintedUse(pos, move->src_slot(), move->dest_slot());
(...skipping 1507 matching lines...) Expand 10 before | Expand all | Expand 10 after
2175 OS::Print("-- [after ssa allocator] ir [%s] -------------\n", 2183 OS::Print("-- [after ssa allocator] ir [%s] -------------\n",
2176 function.ToFullyQualifiedCString()); 2184 function.ToFullyQualifiedCString());
2177 FlowGraphPrinter printer(flow_graph_, true); 2185 FlowGraphPrinter printer(flow_graph_, true);
2178 printer.PrintBlocks(); 2186 printer.PrintBlocks();
2179 OS::Print("----------------------------------------------\n"); 2187 OS::Print("----------------------------------------------\n");
2180 } 2188 }
2181 } 2189 }
2182 2190
2183 2191
2184 } // namespace dart 2192 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler.cc » ('j') | runtime/vm/intermediate_language.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698