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

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

Issue 1488553002: [turbofan] Fewer gap moves for tail calls (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « src/compiler/mips64/code-generator-mips64.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/ast/scopes.h" 7 #include "src/ast/scopes.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 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 ASSEMBLE_CHECKED_STORE_INTEGER_IMPL(asm_instr, Immediate); \ 571 ASSEMBLE_CHECKED_STORE_INTEGER_IMPL(asm_instr, Immediate); \
572 } \ 572 } \
573 } while (false) 573 } while (false)
574 574
575 575
576 void CodeGenerator::AssembleDeconstructActivationRecord(int stack_param_delta) { 576 void CodeGenerator::AssembleDeconstructActivationRecord(int stack_param_delta) {
577 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); 577 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta);
578 if (sp_slot_delta > 0) { 578 if (sp_slot_delta > 0) {
579 __ addq(rsp, Immediate(sp_slot_delta * kPointerSize)); 579 __ addq(rsp, Immediate(sp_slot_delta * kPointerSize));
580 } 580 }
581 if (frame()->needs_frame()) {
582 __ popq(rbp);
583 }
584 frame_access_state()->SetFrameAccessToDefault(); 581 frame_access_state()->SetFrameAccessToDefault();
585 } 582 }
586 583
587 584
588 void CodeGenerator::AssemblePrepareTailCall(int stack_param_delta) { 585 void CodeGenerator::AssemblePrepareTailCall(int stack_param_delta) {
589 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); 586 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta);
590 if (sp_slot_delta < 0) { 587 if (sp_slot_delta < 0) {
591 __ subq(rsp, Immediate(-sp_slot_delta * kPointerSize)); 588 __ subq(rsp, Immediate(-sp_slot_delta * kPointerSize));
592 frame_access_state()->IncreaseSPDelta(-sp_slot_delta); 589 frame_access_state()->IncreaseSPDelta(-sp_slot_delta);
593 } 590 }
591 if (frame()->needs_frame()) {
592 __ movq(rbp, MemOperand(rbp, 0));
593 }
594 frame_access_state()->SetFrameAccessToSP(); 594 frame_access_state()->SetFrameAccessToSP();
595 } 595 }
596 596
597 597
598 // Assembles an instruction after register allocation, producing machine code. 598 // Assembles an instruction after register allocation, producing machine code.
599 void CodeGenerator::AssembleArchInstruction(Instruction* instr) { 599 void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
600 X64OperandConverter i(this, instr); 600 X64OperandConverter i(this, instr);
601 601
602 switch (ArchOpcodeField::decode(instr->opcode())) { 602 switch (ArchOpcodeField::decode(instr->opcode())) {
603 case kArchCallCodeObject: { 603 case kArchCallCodeObject: {
(...skipping 1443 matching lines...) Expand 10 before | Expand all | Expand 10 after
2047 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; 2047 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc;
2048 __ Nop(padding_size); 2048 __ Nop(padding_size);
2049 } 2049 }
2050 } 2050 }
2051 2051
2052 #undef __ 2052 #undef __
2053 2053
2054 } // namespace compiler 2054 } // namespace compiler
2055 } // namespace internal 2055 } // namespace internal
2056 } // namespace v8 2056 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/mips64/code-generator-mips64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698