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/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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 __ asm_instr(value, i.InputOffset(3), lo); \ | 297 __ asm_instr(value, i.InputOffset(3), lo); \ |
298 DCHECK_EQ(LeaveCC, i.OutputSBit()); \ | 298 DCHECK_EQ(LeaveCC, i.OutputSBit()); \ |
299 } while (0) | 299 } while (0) |
300 | 300 |
301 | 301 |
302 void CodeGenerator::AssembleDeconstructActivationRecord() { | 302 void CodeGenerator::AssembleDeconstructActivationRecord() { |
303 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 303 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
304 int stack_slots = frame()->GetSpillSlotCount(); | 304 int stack_slots = frame()->GetSpillSlotCount(); |
305 if (descriptor->IsJSFunctionCall() || stack_slots > 0) { | 305 if (descriptor->IsJSFunctionCall() || stack_slots > 0) { |
306 __ LeaveFrame(StackFrame::MANUAL); | 306 __ LeaveFrame(StackFrame::MANUAL); |
307 int pop_count = descriptor->IsJSFunctionCall() | |
308 ? static_cast<int>(descriptor->JSParameterCount()) | |
309 : 0; | |
310 __ Drop(pop_count); | |
311 } | 307 } |
312 } | 308 } |
313 | 309 |
314 | 310 |
315 // Assembles an instruction after register allocation, producing machine code. | 311 // Assembles an instruction after register allocation, producing machine code. |
316 void CodeGenerator::AssembleArchInstruction(Instruction* instr) { | 312 void CodeGenerator::AssembleArchInstruction(Instruction* instr) { |
317 ArmOperandConverter i(this, instr); | 313 ArmOperandConverter i(this, instr); |
318 | 314 |
319 switch (ArchOpcodeField::decode(instr->opcode())) { | 315 switch (ArchOpcodeField::decode(instr->opcode())) { |
320 case kArchCallCodeObject: { | 316 case kArchCallCodeObject: { |
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1046 __ Ret(); | 1042 __ Ret(); |
1047 } else if (descriptor->IsJSFunctionCall() || needs_frame_) { | 1043 } else if (descriptor->IsJSFunctionCall() || needs_frame_) { |
1048 // Canonicalize JSFunction return sites for now. | 1044 // Canonicalize JSFunction return sites for now. |
1049 if (return_label_.is_bound()) { | 1045 if (return_label_.is_bound()) { |
1050 __ b(&return_label_); | 1046 __ b(&return_label_); |
1051 } else { | 1047 } else { |
1052 __ bind(&return_label_); | 1048 __ bind(&return_label_); |
1053 __ LeaveFrame(StackFrame::MANUAL); | 1049 __ LeaveFrame(StackFrame::MANUAL); |
1054 int pop_count = descriptor->IsJSFunctionCall() | 1050 int pop_count = descriptor->IsJSFunctionCall() |
1055 ? static_cast<int>(descriptor->JSParameterCount()) | 1051 ? static_cast<int>(descriptor->JSParameterCount()) |
1056 : 0; | 1052 : (info()->IsStub() |
1057 __ Drop(pop_count); | 1053 ? info()->code_stub()->GetStackParameterCount() |
| 1054 : 0); |
| 1055 if (pop_count != 0) { |
| 1056 __ Drop(pop_count); |
| 1057 } |
1058 __ Ret(); | 1058 __ Ret(); |
1059 } | 1059 } |
1060 } else { | 1060 } else { |
1061 __ Ret(); | 1061 __ Ret(); |
1062 } | 1062 } |
1063 } | 1063 } |
1064 | 1064 |
1065 | 1065 |
1066 void CodeGenerator::AssembleMove(InstructionOperand* source, | 1066 void CodeGenerator::AssembleMove(InstructionOperand* source, |
1067 InstructionOperand* destination) { | 1067 InstructionOperand* destination) { |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1266 } | 1266 } |
1267 } | 1267 } |
1268 } | 1268 } |
1269 } | 1269 } |
1270 | 1270 |
1271 #undef __ | 1271 #undef __ |
1272 | 1272 |
1273 } // namespace compiler | 1273 } // namespace compiler |
1274 } // namespace internal | 1274 } // namespace internal |
1275 } // namespace v8 | 1275 } // namespace v8 |
OLD | NEW |