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

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

Issue 1377113004: VM: Support phis with pair representations. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: rebased Created 5 years, 2 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
« no previous file with comments | « no previous file | runtime/vm/flow_graph_allocator.cc » ('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/il_printer.h" 9 #include "vm/il_printer.h"
10 #include "vm/intermediate_language.h" 10 #include "vm/intermediate_language.h"
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after
914 GrowableArray<PhiInstr*>* live_phis, 914 GrowableArray<PhiInstr*>* live_phis,
915 VariableLivenessAnalysis* variable_liveness) { 915 VariableLivenessAnalysis* variable_liveness) {
916 // 1. Process phis first. 916 // 1. Process phis first.
917 if (block_entry->IsJoinEntry()) { 917 if (block_entry->IsJoinEntry()) {
918 JoinEntryInstr* join = block_entry->AsJoinEntry(); 918 JoinEntryInstr* join = block_entry->AsJoinEntry();
919 if (join->phis() != NULL) { 919 if (join->phis() != NULL) {
920 for (intptr_t i = 0; i < join->phis()->length(); ++i) { 920 for (intptr_t i = 0; i < join->phis()->length(); ++i) {
921 PhiInstr* phi = (*join->phis())[i]; 921 PhiInstr* phi = (*join->phis())[i];
922 if (phi != NULL) { 922 if (phi != NULL) {
923 (*env)[i] = phi; 923 (*env)[i] = phi;
924 phi->set_ssa_temp_index(alloc_ssa_temp_index()); // New SSA temp. 924 AllocateSSAIndexes(phi); // New SSA temp.
925 if (block_entry->InsideTryBlock() && !phi->is_alive()) { 925 if (block_entry->InsideTryBlock() && !phi->is_alive()) {
926 // This is a safe approximation. Inside try{} all locals are 926 // This is a safe approximation. Inside try{} all locals are
927 // used at every call implicitly, so we mark all phis as live 927 // used at every call implicitly, so we mark all phis as live
928 // from the start. 928 // from the start.
929 // TODO(fschneider): Improve this approximation to eliminate 929 // TODO(fschneider): Improve this approximation to eliminate
930 // more redundant phis. 930 // more redundant phis.
931 phi->mark_alive(); 931 phi->mark_alive();
932 live_phis->Add(phi); 932 live_phis->Add(phi);
933 } 933 }
934 } 934 }
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
1390 } 1390 }
1391 1391
1392 1392
1393 bool BlockEffects::IsSideEffectFreePath(BlockEntryInstr* from, 1393 bool BlockEffects::IsSideEffectFreePath(BlockEntryInstr* from,
1394 BlockEntryInstr* to) const { 1394 BlockEntryInstr* to) const {
1395 return available_at_[to->postorder_number()]->Contains( 1395 return available_at_[to->postorder_number()]->Contains(
1396 from->postorder_number()); 1396 from->postorder_number());
1397 } 1397 }
1398 1398
1399 } // namespace dart 1399 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698