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/arm64/macro-assembler-arm64.h" | 7 #include "src/arm64/macro-assembler-arm64.h" |
8 #include "src/compiler/code-generator-impl.h" | 8 #include "src/compiler/code-generator-impl.h" |
9 #include "src/compiler/gap-resolver.h" | 9 #include "src/compiler/gap-resolver.h" |
10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 } \ | 344 } \ |
345 } while (0) | 345 } while (0) |
346 | 346 |
347 | 347 |
348 void CodeGenerator::AssembleDeconstructActivationRecord() { | 348 void CodeGenerator::AssembleDeconstructActivationRecord() { |
349 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 349 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
350 int stack_slots = frame()->GetSpillSlotCount(); | 350 int stack_slots = frame()->GetSpillSlotCount(); |
351 if (descriptor->IsJSFunctionCall() || stack_slots > 0) { | 351 if (descriptor->IsJSFunctionCall() || stack_slots > 0) { |
352 __ Mov(jssp, fp); | 352 __ Mov(jssp, fp); |
353 __ Pop(fp, lr); | 353 __ Pop(fp, lr); |
354 int pop_count = descriptor->IsJSFunctionCall() | |
355 ? static_cast<int>(descriptor->JSParameterCount()) | |
356 : 0; | |
357 __ Drop(pop_count); | |
358 } | 354 } |
359 } | 355 } |
360 | 356 |
361 | 357 |
362 // Assembles an instruction after register allocation, producing machine code. | 358 // Assembles an instruction after register allocation, producing machine code. |
363 void CodeGenerator::AssembleArchInstruction(Instruction* instr) { | 359 void CodeGenerator::AssembleArchInstruction(Instruction* instr) { |
364 Arm64OperandConverter i(this, instr); | 360 Arm64OperandConverter i(this, instr); |
365 InstructionCode opcode = instr->opcode(); | 361 InstructionCode opcode = instr->opcode(); |
366 switch (ArchOpcodeField::decode(opcode)) { | 362 switch (ArchOpcodeField::decode(opcode)) { |
367 case kArchCallCodeObject: { | 363 case kArchCallCodeObject: { |
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1177 } else if (descriptor->IsJSFunctionCall() || needs_frame_) { | 1173 } else if (descriptor->IsJSFunctionCall() || needs_frame_) { |
1178 // Canonicalize JSFunction return sites for now. | 1174 // Canonicalize JSFunction return sites for now. |
1179 if (return_label_.is_bound()) { | 1175 if (return_label_.is_bound()) { |
1180 __ B(&return_label_); | 1176 __ B(&return_label_); |
1181 } else { | 1177 } else { |
1182 __ Bind(&return_label_); | 1178 __ Bind(&return_label_); |
1183 __ Mov(jssp, fp); | 1179 __ Mov(jssp, fp); |
1184 __ Pop(fp, lr); | 1180 __ Pop(fp, lr); |
1185 int pop_count = descriptor->IsJSFunctionCall() | 1181 int pop_count = descriptor->IsJSFunctionCall() |
1186 ? static_cast<int>(descriptor->JSParameterCount()) | 1182 ? static_cast<int>(descriptor->JSParameterCount()) |
1187 : 0; | 1183 : (info()->IsStub() |
1188 __ Drop(pop_count); | 1184 ? info()->code_stub()->GetStackParameterCount() |
| 1185 : 0); |
| 1186 if (pop_count != 0) { |
| 1187 __ Drop(pop_count); |
| 1188 } |
1189 __ Ret(); | 1189 __ Ret(); |
1190 } | 1190 } |
1191 } else { | 1191 } else { |
1192 __ Ret(); | 1192 __ Ret(); |
1193 } | 1193 } |
1194 } | 1194 } |
1195 | 1195 |
1196 | 1196 |
1197 void CodeGenerator::AssembleMove(InstructionOperand* source, | 1197 void CodeGenerator::AssembleMove(InstructionOperand* source, |
1198 InstructionOperand* destination) { | 1198 InstructionOperand* destination) { |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1374 } | 1374 } |
1375 } | 1375 } |
1376 } | 1376 } |
1377 } | 1377 } |
1378 | 1378 |
1379 #undef __ | 1379 #undef __ |
1380 | 1380 |
1381 } // namespace compiler | 1381 } // namespace compiler |
1382 } // namespace internal | 1382 } // namespace internal |
1383 } // namespace v8 | 1383 } // namespace v8 |
OLD | NEW |