OLD | NEW |
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/globals.h" // Needed here to get TARGET_ARCH_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
7 | 7 |
8 #include "vm/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
9 | 9 |
10 #include "lib/error.h" | 10 #include "lib/error.h" |
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 __ cvtsi2sd(result, temp); | 1103 __ cvtsi2sd(result, temp); |
1104 __ Bind(&done); | 1104 __ Bind(&done); |
1105 } | 1105 } |
1106 | 1106 |
1107 | 1107 |
1108 #undef __ | 1108 #undef __ |
1109 #define __ compiler_->assembler()-> | 1109 #define __ compiler_->assembler()-> |
1110 | 1110 |
1111 | 1111 |
1112 void ParallelMoveResolver::EmitMove(int index) { | 1112 void ParallelMoveResolver::EmitMove(int index) { |
1113 Location source = moves_[index].src(); | 1113 MoveOperands* move = moves_[index]; |
1114 Location destination = moves_[index].dest(); | 1114 const Location source = move->src(); |
| 1115 const Location destination = move->dest(); |
1115 | 1116 |
1116 ASSERT(destination.IsRegister()); | 1117 ASSERT(destination.IsRegister()); |
1117 if (source.IsRegister()) { | 1118 if (source.IsRegister()) { |
1118 __ movl(destination.reg(), source.reg()); | 1119 __ movl(destination.reg(), source.reg()); |
1119 } else { | 1120 } else { |
1120 ASSERT(source.IsConstant()); | 1121 ASSERT(source.IsConstant()); |
1121 __ LoadObject(destination.reg(), source.constant()); | 1122 __ LoadObject(destination.reg(), source.constant()); |
1122 } | 1123 } |
1123 moves_[index].Eliminate(); | 1124 move->Eliminate(); |
1124 } | 1125 } |
1125 | 1126 |
1126 | 1127 |
1127 void ParallelMoveResolver::EmitSwap(int index) { | 1128 void ParallelMoveResolver::EmitSwap(int index) { |
1128 Location source = moves_[index].src(); | 1129 MoveOperands* move = moves_[index]; |
1129 Location destination = moves_[index].dest(); | 1130 const Location source = move->src(); |
| 1131 const Location destination = move->dest(); |
1130 | 1132 |
1131 ASSERT(source.IsRegister() && destination.IsRegister()); | 1133 ASSERT(source.IsRegister() && destination.IsRegister()); |
1132 __ xchgl(destination.reg(), source.reg()); | 1134 __ xchgl(destination.reg(), source.reg()); |
1133 | 1135 |
1134 // The swap of source and destination has executed a move from source to | 1136 // The swap of source and destination has executed a move from source to |
1135 // destination. | 1137 // destination. |
1136 moves_[index].Eliminate(); | 1138 move->Eliminate(); |
1137 | 1139 |
1138 // Any unperformed (including pending) move with a source of either | 1140 // Any unperformed (including pending) move with a source of either |
1139 // this move's source or destination needs to have their source | 1141 // this move's source or destination needs to have their source |
1140 // changed to reflect the state of affairs after the swap. | 1142 // changed to reflect the state of affairs after the swap. |
1141 for (int i = 0; i < moves_.length(); ++i) { | 1143 for (int i = 0; i < moves_.length(); ++i) { |
1142 MoveOperands other_move = moves_[i]; | 1144 const MoveOperands& other_move = *moves_[i]; |
1143 if (other_move.Blocks(source)) { | 1145 if (other_move.Blocks(source)) { |
1144 moves_[i].set_src(destination); | 1146 moves_[i]->set_src(destination); |
1145 } else if (other_move.Blocks(destination)) { | 1147 } else if (other_move.Blocks(destination)) { |
1146 moves_[i].set_src(source); | 1148 moves_[i]->set_src(source); |
1147 } | 1149 } |
1148 } | 1150 } |
1149 } | 1151 } |
1150 | 1152 |
1151 | 1153 |
1152 #undef __ | 1154 #undef __ |
1153 | 1155 |
1154 } // namespace dart | 1156 } // namespace dart |
1155 | 1157 |
1156 #endif // defined TARGET_ARCH_IA32 | 1158 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |