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

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

Issue 2843933002: [cleanup] Minor cleanups concerning assemblers and code generation. (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « src/codegen.cc ('k') | src/macro-assembler.h » ('j') | 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 <limits> 7 #include <limits>
8 8
9 #include "src/compilation-info.h" 9 #include "src/compilation-info.h"
10 #include "src/compiler/code-generator-impl.h" 10 #include "src/compiler/code-generator-impl.h"
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 Operand(rbp, ArgumentsAdaptorFrameConstants::kLengthOffset)); 755 Operand(rbp, ArgumentsAdaptorFrameConstants::kLengthOffset));
756 756
757 ParameterCount callee_args_count(args_reg); 757 ParameterCount callee_args_count(args_reg);
758 __ PrepareForTailCall(callee_args_count, caller_args_count_reg, scratch2, 758 __ PrepareForTailCall(callee_args_count, caller_args_count_reg, scratch2,
759 scratch3, ReturnAddressState::kOnStack); 759 scratch3, ReturnAddressState::kOnStack);
760 __ bind(&done); 760 __ bind(&done);
761 } 761 }
762 762
763 namespace { 763 namespace {
764 764
765 void AdjustStackPointerForTailCall(MacroAssembler* masm, 765 void AdjustStackPointerForTailCall(Assembler* assembler,
766 FrameAccessState* state, 766 FrameAccessState* state,
767 int new_slot_above_sp, 767 int new_slot_above_sp,
768 bool allow_shrinkage = true) { 768 bool allow_shrinkage = true) {
769 int current_sp_offset = state->GetSPToFPSlotCount() + 769 int current_sp_offset = state->GetSPToFPSlotCount() +
770 StandardFrameConstants::kFixedSlotCountAboveFp; 770 StandardFrameConstants::kFixedSlotCountAboveFp;
771 int stack_slot_delta = new_slot_above_sp - current_sp_offset; 771 int stack_slot_delta = new_slot_above_sp - current_sp_offset;
772 if (stack_slot_delta > 0) { 772 if (stack_slot_delta > 0) {
773 masm->subq(rsp, Immediate(stack_slot_delta * kPointerSize)); 773 assembler->subq(rsp, Immediate(stack_slot_delta * kPointerSize));
774 state->IncreaseSPDelta(stack_slot_delta); 774 state->IncreaseSPDelta(stack_slot_delta);
775 } else if (allow_shrinkage && stack_slot_delta < 0) { 775 } else if (allow_shrinkage && stack_slot_delta < 0) {
776 masm->addq(rsp, Immediate(-stack_slot_delta * kPointerSize)); 776 assembler->addq(rsp, Immediate(-stack_slot_delta * kPointerSize));
777 state->IncreaseSPDelta(stack_slot_delta); 777 state->IncreaseSPDelta(stack_slot_delta);
778 } 778 }
779 } 779 }
780 780
781 } // namespace 781 } // namespace
782 782
783 void CodeGenerator::AssembleTailCallBeforeGap(Instruction* instr, 783 void CodeGenerator::AssembleTailCallBeforeGap(Instruction* instr,
784 int first_unused_stack_slot) { 784 int first_unused_stack_slot) {
785 CodeGenerator::PushTypeFlags flags(kImmediatePush | kScalarPush); 785 CodeGenerator::PushTypeFlags flags(kImmediatePush | kScalarPush);
786 ZoneVector<MoveOperands*> pushes(zone()); 786 ZoneVector<MoveOperands*> pushes(zone());
(...skipping 2389 matching lines...) Expand 10 before | Expand all | Expand 10 after
3176 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; 3176 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc;
3177 __ Nop(padding_size); 3177 __ Nop(padding_size);
3178 } 3178 }
3179 } 3179 }
3180 3180
3181 #undef __ 3181 #undef __
3182 3182
3183 } // namespace compiler 3183 } // namespace compiler
3184 } // namespace internal 3184 } // namespace internal
3185 } // namespace v8 3185 } // namespace v8
OLDNEW
« no previous file with comments | « src/codegen.cc ('k') | src/macro-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698