Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: src/compiler/mips64/code-generator-mips64.cc

Issue 1216933011: [turbofan] Enable tail calls for %_CallFunction. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix platform ports Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 807 matching lines...) Expand 10 before | Expand all | Expand 10 after
1223 } else if (descriptor->IsJSFunctionCall() || needs_frame_) { 1219 } else if (descriptor->IsJSFunctionCall() || needs_frame_) {
1224 // Canonicalize JSFunction return sites for now. 1220 // Canonicalize JSFunction return sites for now.
1225 if (return_label_.is_bound()) { 1221 if (return_label_.is_bound()) {
1226 __ Branch(&return_label_); 1222 __ Branch(&return_label_);
1227 } else { 1223 } else {
1228 __ bind(&return_label_); 1224 __ bind(&return_label_);
1229 __ mov(sp, fp); 1225 __ mov(sp, fp);
1230 __ Pop(ra, fp); 1226 __ Pop(ra, fp);
1231 int pop_count = descriptor->IsJSFunctionCall() 1227 int pop_count = descriptor->IsJSFunctionCall()
1232 ? static_cast<int>(descriptor->JSParameterCount()) 1228 ? static_cast<int>(descriptor->JSParameterCount())
1233 : 0; 1229 : (info()->IsStub()
1234 __ DropAndRet(pop_count); 1230 ? info()->code_stub()->GetStackParameterCount()
1231 : 0);
1232 if (pop_count != 0) {
1233 __ DropAndRet(pop_count);
1234 } else {
1235 __ Ret();
1236 }
1235 } 1237 }
1236 } else { 1238 } else {
1237 __ Ret(); 1239 __ Ret();
1238 } 1240 }
1239 } 1241 }
1240 1242
1241 1243
1242 void CodeGenerator::AssembleMove(InstructionOperand* source, 1244 void CodeGenerator::AssembleMove(InstructionOperand* source,
1243 InstructionOperand* destination) { 1245 InstructionOperand* destination) {
1244 MipsOperandConverter g(this, NULL); 1246 MipsOperandConverter g(this, NULL);
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1443 } 1445 }
1444 } 1446 }
1445 } 1447 }
1446 } 1448 }
1447 1449
1448 #undef __ 1450 #undef __
1449 1451
1450 } // namespace compiler 1452 } // namespace compiler
1451 } // namespace internal 1453 } // namespace internal
1452 } // namespace v8 1454 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/mips/instruction-selector-mips.cc ('k') | src/compiler/mips64/instruction-selector-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698