| 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 #include "src/compiler/code-generator-impl.h" | 6 #include "src/compiler/code-generator-impl.h" |
| 7 #include "src/compiler/gap-resolver.h" | 7 #include "src/compiler/gap-resolver.h" |
| 8 #include "src/compiler/node-matchers.h" | 8 #include "src/compiler/node-matchers.h" |
| 9 #include "src/mips/macro-assembler-mips.h" | 9 #include "src/mips/macro-assembler-mips.h" |
| 10 #include "src/scopes.h" | 10 #include "src/scopes.h" |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 __ bind(ool->exit()); \ | 392 __ bind(ool->exit()); \ |
| 393 __ bind(&done); \ | 393 __ bind(&done); \ |
| 394 } while (0) | 394 } while (0) |
| 395 | 395 |
| 396 | 396 |
| 397 void CodeGenerator::AssembleDeconstructActivationRecord() { | 397 void CodeGenerator::AssembleDeconstructActivationRecord() { |
| 398 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 398 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
| 399 int stack_slots = frame()->GetSpillSlotCount(); | 399 int stack_slots = frame()->GetSpillSlotCount(); |
| 400 if (descriptor->IsJSFunctionCall() || stack_slots > 0) { | 400 if (descriptor->IsJSFunctionCall() || stack_slots > 0) { |
| 401 __ LeaveFrame(StackFrame::MANUAL); | 401 __ LeaveFrame(StackFrame::MANUAL); |
| 402 int pop_count = descriptor->IsJSFunctionCall() | |
| 403 ? static_cast<int>(descriptor->JSParameterCount()) | |
| 404 : 0; | |
| 405 __ Drop(pop_count); | |
| 406 } | 402 } |
| 407 } | 403 } |
| 408 | 404 |
| 409 | 405 |
| 410 // Assembles an instruction after register allocation, producing machine code. | 406 // Assembles an instruction after register allocation, producing machine code. |
| 411 void CodeGenerator::AssembleArchInstruction(Instruction* instr) { | 407 void CodeGenerator::AssembleArchInstruction(Instruction* instr) { |
| 412 MipsOperandConverter i(this, instr); | 408 MipsOperandConverter i(this, instr); |
| 413 InstructionCode opcode = instr->opcode(); | 409 InstructionCode opcode = instr->opcode(); |
| 414 | 410 |
| 415 switch (ArchOpcodeField::decode(opcode)) { | 411 switch (ArchOpcodeField::decode(opcode)) { |
| (...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1150 } else if (descriptor->IsJSFunctionCall() || needs_frame_) { | 1146 } else if (descriptor->IsJSFunctionCall() || needs_frame_) { |
| 1151 // Canonicalize JSFunction return sites for now. | 1147 // Canonicalize JSFunction return sites for now. |
| 1152 if (return_label_.is_bound()) { | 1148 if (return_label_.is_bound()) { |
| 1153 __ Branch(&return_label_); | 1149 __ Branch(&return_label_); |
| 1154 } else { | 1150 } else { |
| 1155 __ bind(&return_label_); | 1151 __ bind(&return_label_); |
| 1156 __ mov(sp, fp); | 1152 __ mov(sp, fp); |
| 1157 __ Pop(ra, fp); | 1153 __ Pop(ra, fp); |
| 1158 int pop_count = descriptor->IsJSFunctionCall() | 1154 int pop_count = descriptor->IsJSFunctionCall() |
| 1159 ? static_cast<int>(descriptor->JSParameterCount()) | 1155 ? static_cast<int>(descriptor->JSParameterCount()) |
| 1160 : 0; | 1156 : (info()->IsStub() |
| 1161 __ DropAndRet(pop_count); | 1157 ? info()->code_stub()->GetStackParameterCount() |
| 1158 : 0); |
| 1159 if (pop_count != 0) { |
| 1160 __ DropAndRet(pop_count); |
| 1161 } else { |
| 1162 __ Ret(); |
| 1163 } |
| 1162 } | 1164 } |
| 1163 } else { | 1165 } else { |
| 1164 __ Ret(); | 1166 __ Ret(); |
| 1165 } | 1167 } |
| 1166 } | 1168 } |
| 1167 | 1169 |
| 1168 | 1170 |
| 1169 void CodeGenerator::AssembleMove(InstructionOperand* source, | 1171 void CodeGenerator::AssembleMove(InstructionOperand* source, |
| 1170 InstructionOperand* destination) { | 1172 InstructionOperand* destination) { |
| 1171 MipsOperandConverter g(this, NULL); | 1173 MipsOperandConverter g(this, NULL); |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1370 } | 1372 } |
| 1371 } | 1373 } |
| 1372 } | 1374 } |
| 1373 } | 1375 } |
| 1374 | 1376 |
| 1375 #undef __ | 1377 #undef __ |
| 1376 | 1378 |
| 1377 } // namespace compiler | 1379 } // namespace compiler |
| 1378 } // namespace internal | 1380 } // namespace internal |
| 1379 } // namespace v8 | 1381 } // namespace v8 |
| OLD | NEW |