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

Side by Side Diff: src/arm/lithium-codegen-arm.cc

Issue 6263005: Change the algorithm and generated code for parallel moves on IA32. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge/build/ia32
Patch Set: Fix compilation on all platforms. Created 9 years, 11 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
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 } 165 }
166 166
167 167
168 bool LGapResolver::CanReach(LGapNode* a, LGapNode* b) { 168 bool LGapResolver::CanReach(LGapNode* a, LGapNode* b) {
169 ASSERT(a != b); 169 ASSERT(a != b);
170 return CanReach(a, b, next_visited_id_++); 170 return CanReach(a, b, next_visited_id_++);
171 } 171 }
172 172
173 173
174 void LGapResolver::RegisterMove(LMoveOperands move) { 174 void LGapResolver::RegisterMove(LMoveOperands move) {
175 if (move.from()->IsConstantOperand()) { 175 if (move.source()->IsConstantOperand()) {
176 // Constant moves should be last in the machine code. Therefore add them 176 // Constant moves should be last in the machine code. Therefore add them
177 // first to the result set. 177 // first to the result set.
178 AddResultMove(move.from(), move.to()); 178 AddResultMove(move.source(), move.destination());
179 } else { 179 } else {
180 LGapNode* from = LookupNode(move.from()); 180 LGapNode* from = LookupNode(move.source());
181 LGapNode* to = LookupNode(move.to()); 181 LGapNode* to = LookupNode(move.destination());
182 if (to->IsAssigned() && to->assigned_from() == from) { 182 if (to->IsAssigned() && to->assigned_from() == from) {
183 move.Eliminate(); 183 move.Eliminate();
184 return; 184 return;
185 } 185 }
186 ASSERT(!to->IsAssigned()); 186 ASSERT(!to->IsAssigned());
187 if (CanReach(from, to)) { 187 if (CanReach(from, to)) {
188 // This introduces a cycle. Save. 188 // This introduces a cycle. Save.
189 identified_cycles_.Add(from); 189 identified_cycles_.Add(from);
190 } 190 }
191 to->set_assigned_from(from); 191 to->set_assigned_from(from);
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 DoubleRegister dbl_scratch = d0; 809 DoubleRegister dbl_scratch = d0;
810 LUnallocated marker_operand(LUnallocated::NONE); 810 LUnallocated marker_operand(LUnallocated::NONE);
811 811
812 Register core_scratch = scratch0(); 812 Register core_scratch = scratch0();
813 bool destroys_core_scratch = false; 813 bool destroys_core_scratch = false;
814 814
815 const ZoneList<LMoveOperands>* moves = 815 const ZoneList<LMoveOperands>* moves =
816 resolver_.Resolve(move->move_operands(), &marker_operand); 816 resolver_.Resolve(move->move_operands(), &marker_operand);
817 for (int i = moves->length() - 1; i >= 0; --i) { 817 for (int i = moves->length() - 1; i >= 0; --i) {
818 LMoveOperands move = moves->at(i); 818 LMoveOperands move = moves->at(i);
819 LOperand* from = move.from(); 819 LOperand* from = move.source();
820 LOperand* to = move.to(); 820 LOperand* to = move.destination();
821 ASSERT(!from->IsDoubleRegister() || 821 ASSERT(!from->IsDoubleRegister() ||
822 !ToDoubleRegister(from).is(dbl_scratch)); 822 !ToDoubleRegister(from).is(dbl_scratch));
823 ASSERT(!to->IsDoubleRegister() || !ToDoubleRegister(to).is(dbl_scratch)); 823 ASSERT(!to->IsDoubleRegister() || !ToDoubleRegister(to).is(dbl_scratch));
824 ASSERT(!from->IsRegister() || !ToRegister(from).is(core_scratch)); 824 ASSERT(!from->IsRegister() || !ToRegister(from).is(core_scratch));
825 ASSERT(!to->IsRegister() || !ToRegister(to).is(core_scratch)); 825 ASSERT(!to->IsRegister() || !ToRegister(to).is(core_scratch));
826 if (from == &marker_operand) { 826 if (from == &marker_operand) {
827 if (to->IsRegister()) { 827 if (to->IsRegister()) {
828 __ mov(ToRegister(to), core_scratch); 828 __ mov(ToRegister(to), core_scratch);
829 ASSERT(destroys_core_scratch); 829 ASSERT(destroys_core_scratch);
830 } else if (to->IsStackSlot()) { 830 } else if (to->IsStackSlot()) {
(...skipping 2348 matching lines...) Expand 10 before | Expand all | Expand 10 after
3179 3179
3180 3180
3181 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { 3181 void LCodeGen::DoOsrEntry(LOsrEntry* instr) {
3182 Abort("DoOsrEntry unimplemented."); 3182 Abort("DoOsrEntry unimplemented.");
3183 } 3183 }
3184 3184
3185 3185
3186 #undef __ 3186 #undef __
3187 3187
3188 } } // namespace v8::internal 3188 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698