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

Side by Side Diff: src/compiler/gap-resolver.cc

Issue 1111323003: Reland: [turbofan] add MachineType to AllocatedOperand (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 5 years, 7 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 | « src/compiler/frame.h ('k') | src/compiler/instruction.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/gap-resolver.h" 5 #include "src/compiler/gap-resolver.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <set> 9 #include <set>
10 10
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 } 68 }
69 } 69 }
70 70
71 // We are about to resolve this move and don't need it marked as pending, so 71 // We are about to resolve this move and don't need it marked as pending, so
72 // restore its destination. 72 // restore its destination.
73 move->set_destination(destination); 73 move->set_destination(destination);
74 74
75 // This move's source may have changed due to swaps to resolve cycles and so 75 // This move's source may have changed due to swaps to resolve cycles and so
76 // it may now be the last move in the cycle. If so remove it. 76 // it may now be the last move in the cycle. If so remove it.
77 InstructionOperand source = move->source(); 77 InstructionOperand source = move->source();
78 if (source == destination) { 78 if (source.EqualsModuloType(destination)) {
79 move->Eliminate(); 79 move->Eliminate();
80 return; 80 return;
81 } 81 }
82 82
83 // The move may be blocked on a (at most one) pending move, in which case we 83 // The move may be blocked on a (at most one) pending move, in which case we
84 // have a cycle. Search for such a blocking move and perform a swap to 84 // have a cycle. Search for such a blocking move and perform a swap to
85 // resolve it. 85 // resolve it.
86 auto blocker = std::find_if(moves->begin(), moves->end(), 86 auto blocker = std::find_if(moves->begin(), moves->end(),
87 std::bind2nd(std::ptr_fun(&Blocks), destination)); 87 std::bind2nd(std::ptr_fun(&Blocks), destination));
88 if (blocker == moves->end()) { 88 if (blocker == moves->end()) {
(...skipping 18 matching lines...) Expand all
107 if (other->Blocks(source)) { 107 if (other->Blocks(source)) {
108 other->set_source(destination); 108 other->set_source(destination);
109 } else if (other->Blocks(destination)) { 109 } else if (other->Blocks(destination)) {
110 other->set_source(source); 110 other->set_source(source);
111 } 111 }
112 } 112 }
113 } 113 }
114 } 114 }
115 } 115 }
116 } // namespace v8::internal::compiler 116 } // namespace v8::internal::compiler
OLDNEW
« no previous file with comments | « src/compiler/frame.h ('k') | src/compiler/instruction.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698