OLD | NEW |
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/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
6 | 6 |
7 #include "src/arm/macro-assembler-arm.h" | 7 #include "src/arm/macro-assembler-arm.h" |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/compiler/code-generator-impl.h" | 9 #include "src/compiler/code-generator-impl.h" |
10 #include "src/compiler/gap-resolver.h" | 10 #include "src/compiler/gap-resolver.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 } | 140 } |
141 UNREACHABLE(); | 141 UNREACHABLE(); |
142 return MemOperand(r0); | 142 return MemOperand(r0); |
143 } | 143 } |
144 | 144 |
145 MemOperand InputOffset(size_t first_index = 0) { | 145 MemOperand InputOffset(size_t first_index = 0) { |
146 return InputOffset(&first_index); | 146 return InputOffset(&first_index); |
147 } | 147 } |
148 | 148 |
149 MemOperand ToMemOperand(InstructionOperand* op) const { | 149 MemOperand ToMemOperand(InstructionOperand* op) const { |
150 DCHECK(op != NULL); | 150 DCHECK_NOT_NULL(op); |
151 DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot()); | 151 DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot()); |
152 FrameOffset offset = frame_access_state()->GetFrameOffset( | 152 FrameOffset offset = frame_access_state()->GetFrameOffset( |
153 AllocatedOperand::cast(op)->index()); | 153 AllocatedOperand::cast(op)->index()); |
154 return MemOperand(offset.from_stack_pointer() ? sp : fp, offset.offset()); | 154 return MemOperand(offset.from_stack_pointer() ? sp : fp, offset.offset()); |
155 } | 155 } |
156 }; | 156 }; |
157 | 157 |
158 | 158 |
159 namespace { | 159 namespace { |
160 | 160 |
(...skipping 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1168 __ bind(&return_label_); | 1168 __ bind(&return_label_); |
1169 __ LeaveFrame(StackFrame::MANUAL); | 1169 __ LeaveFrame(StackFrame::MANUAL); |
1170 } | 1170 } |
1171 } | 1171 } |
1172 __ Ret(pop_count); | 1172 __ Ret(pop_count); |
1173 } | 1173 } |
1174 | 1174 |
1175 | 1175 |
1176 void CodeGenerator::AssembleMove(InstructionOperand* source, | 1176 void CodeGenerator::AssembleMove(InstructionOperand* source, |
1177 InstructionOperand* destination) { | 1177 InstructionOperand* destination) { |
1178 ArmOperandConverter g(this, NULL); | 1178 ArmOperandConverter g(this, nullptr); |
1179 // Dispatch on the source and destination operand kinds. Not all | 1179 // Dispatch on the source and destination operand kinds. Not all |
1180 // combinations are possible. | 1180 // combinations are possible. |
1181 if (source->IsRegister()) { | 1181 if (source->IsRegister()) { |
1182 DCHECK(destination->IsRegister() || destination->IsStackSlot()); | 1182 DCHECK(destination->IsRegister() || destination->IsStackSlot()); |
1183 Register src = g.ToRegister(source); | 1183 Register src = g.ToRegister(source); |
1184 if (destination->IsRegister()) { | 1184 if (destination->IsRegister()) { |
1185 __ mov(g.ToRegister(destination), src); | 1185 __ mov(g.ToRegister(destination), src); |
1186 } else { | 1186 } else { |
1187 __ str(src, g.ToMemOperand(destination)); | 1187 __ str(src, g.ToMemOperand(destination)); |
1188 } | 1188 } |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1276 __ vstr(temp, g.ToMemOperand(destination)); | 1276 __ vstr(temp, g.ToMemOperand(destination)); |
1277 } | 1277 } |
1278 } else { | 1278 } else { |
1279 UNREACHABLE(); | 1279 UNREACHABLE(); |
1280 } | 1280 } |
1281 } | 1281 } |
1282 | 1282 |
1283 | 1283 |
1284 void CodeGenerator::AssembleSwap(InstructionOperand* source, | 1284 void CodeGenerator::AssembleSwap(InstructionOperand* source, |
1285 InstructionOperand* destination) { | 1285 InstructionOperand* destination) { |
1286 ArmOperandConverter g(this, NULL); | 1286 ArmOperandConverter g(this, nullptr); |
1287 // Dispatch on the source and destination operand kinds. Not all | 1287 // Dispatch on the source and destination operand kinds. Not all |
1288 // combinations are possible. | 1288 // combinations are possible. |
1289 if (source->IsRegister()) { | 1289 if (source->IsRegister()) { |
1290 // Register-register. | 1290 // Register-register. |
1291 Register temp = kScratchReg; | 1291 Register temp = kScratchReg; |
1292 Register src = g.ToRegister(source); | 1292 Register src = g.ToRegister(source); |
1293 if (destination->IsRegister()) { | 1293 if (destination->IsRegister()) { |
1294 Register dst = g.ToRegister(destination); | 1294 Register dst = g.ToRegister(destination); |
1295 __ Move(temp, src); | 1295 __ Move(temp, src); |
1296 __ Move(src, dst); | 1296 __ Move(src, dst); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1378 padding_size -= v8::internal::Assembler::kInstrSize; | 1378 padding_size -= v8::internal::Assembler::kInstrSize; |
1379 } | 1379 } |
1380 } | 1380 } |
1381 } | 1381 } |
1382 | 1382 |
1383 #undef __ | 1383 #undef __ |
1384 | 1384 |
1385 } // namespace compiler | 1385 } // namespace compiler |
1386 } // namespace internal | 1386 } // namespace internal |
1387 } // namespace v8 | 1387 } // namespace v8 |
OLD | NEW |