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

Unified Diff: src/compiler/code-generator.h

Issue 2082263002: [turbofan]: Support using push instructions for setting up tail call parameters (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix comments Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/arm64/code-generator-arm64.cc ('k') | src/compiler/code-generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/code-generator.h
diff --git a/src/compiler/code-generator.h b/src/compiler/code-generator.h
index 1083e66e023b0d350d50ba2798a8358a15cb167c..d9fa7e5ebbbc4305231f7b17668d14dacdab10d1 100644
--- a/src/compiler/code-generator.h
+++ b/src/compiler/code-generator.h
@@ -102,6 +102,11 @@ class CodeGenerator final : public GapResolver::Assembler {
void AssembleSourcePosition(Instruction* instr);
void AssembleGaps(Instruction* instr);
+ // Returns true if a instruction is a tail call that needs to adjust the stack
+ // pointer before execution. The stack slot index to the empty slot above the
+ // adjusted stack pointer is returned in |slot|.
+ bool GetSlotAboveSPBeforeTailCall(Instruction* instr, int* slot);
+
// ===========================================================================
// ============= Architecture-specific code generation methods. ==============
// ===========================================================================
@@ -124,18 +129,49 @@ class CodeGenerator final : public GapResolver::Assembler {
// to tear down a stack frame.
void AssembleReturn();
- // Generates code to deconstruct a the caller's frame, including arguments.
- void AssembleDeconstructActivationRecord(int stack_param_delta);
-
void AssembleDeconstructFrame();
// Generates code to manipulate the stack in preparation for a tail call.
- void AssemblePrepareTailCall(int stack_param_delta);
+ void AssemblePrepareTailCall();
// Generates code to pop current frame if it is an arguments adaptor frame.
void AssemblePopArgumentsAdaptorFrame(Register args_reg, Register scratch1,
Register scratch2, Register scratch3);
+ enum PushTypeFlag {
+ kImmediatePush = 0x1,
+ kScalarPush = 0x2,
+ kFloat32Push = 0x4,
+ kFloat64Push = 0x8,
+ kFloatPush = kFloat32Push | kFloat64Push
+ };
+
+ typedef base::Flags<PushTypeFlag> PushTypeFlags;
+
+ static bool IsValidPush(InstructionOperand source, PushTypeFlags push_type);
+
+ // Generate a list moves from an instruction that are candidates to be turned
+ // into push instructions on platforms that support them. In general, the list
+ // of push candidates are moves to a set of contiguous destination
+ // InstructionOperand locations on the stack that don't clobber values that
+ // are needed for resolve the gap or use values generated by the gap,
+ // i.e. moves that can be hoisted together before the actual gap and assembled
+ // together.
+ static void GetPushCompatibleMoves(Instruction* instr,
+ PushTypeFlags push_type,
+ ZoneVector<MoveOperands*>* pushes);
+
+ // Called before a tail call |instr|'s gap moves are assembled and allows
+ // gap-specific pre-processing, e.g. adjustment of the sp for tail calls that
+ // need it before gap moves or conversion of certain gap moves into pushes.
+ void AssembleTailCallBeforeGap(Instruction* instr,
+ int first_unused_stack_slot);
+ // Called after a tail call |instr|'s gap moves are assembled and allows
+ // gap-specific post-processing, e.g. adjustment of the sp for tail calls that
+ // need it after gap moves.
+ void AssembleTailCallAfterGap(Instruction* instr,
+ int first_unused_stack_slot);
+
// ===========================================================================
// ============== Architecture-specific gap resolver methods. ================
// ===========================================================================
@@ -188,12 +224,6 @@ class CodeGenerator final : public GapResolver::Assembler {
DeoptimizationExit* AddDeoptimizationExit(Instruction* instr,
size_t frame_state_offset);
- // Converts the delta in the number of stack parameter passed from a tail
- // caller to the callee into the distance (in pointers) the SP must be
- // adjusted, taking frame elision and other relevant factors into
- // consideration.
- int TailCallFrameStackSlotDelta(int stack_param_delta);
-
// ===========================================================================
struct DeoptimizationState : ZoneObject {
« no previous file with comments | « src/compiler/arm64/code-generator-arm64.cc ('k') | src/compiler/code-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698