Index: src/x64/codegen-x64.h |
diff --git a/src/x64/codegen-x64.h b/src/x64/codegen-x64.h |
index 5747e0bc6f0d19c3bbec0f654a4e2fb2ab052a93..9b8454a3535ac77a681439e8c2a8b986cb61d8d2 100644 |
--- a/src/x64/codegen-x64.h |
+++ b/src/x64/codegen-x64.h |
@@ -103,6 +103,73 @@ class MathExpGenerator : public AllStatic { |
DISALLOW_COPY_AND_ASSIGN(MathExpGenerator); |
}; |
+ |
+enum StackArgumentsAccessorReceiverMode { |
+ ARGUMENTS_CONTAIN_RECEIVER, |
+ ARGUMENTS_DONT_CONTAIN_RECEIVER |
+}; |
+ |
+ |
+class StackArgumentsAccessor BASE_EMBEDDED { |
+ public: |
+ StackArgumentsAccessor( |
+ Register base_reg, |
+ int argument_count_immediate, |
+ StackArgumentsAccessorReceiverMode receiver_mode = |
+ ARGUMENTS_CONTAIN_RECEIVER, |
+ int extra_displacement_to_last_argument = 0) |
+ : base_reg_(base_reg), |
+ argument_count_reg_(no_reg), |
+ argument_count_immediate_(argument_count_immediate), |
+ receiver_mode_(receiver_mode), |
+ extra_displacement_to_last_argument_( |
+ extra_displacement_to_last_argument) { } |
+ |
+ StackArgumentsAccessor( |
+ Register base_reg, |
+ Register argument_count_reg, |
+ StackArgumentsAccessorReceiverMode receiver_mode = |
+ ARGUMENTS_CONTAIN_RECEIVER, |
+ int extra_displacement_to_last_argument = 0) |
+ : base_reg_(base_reg), |
+ argument_count_reg_(argument_count_reg), |
+ argument_count_immediate_(0), |
+ receiver_mode_(receiver_mode), |
+ extra_displacement_to_last_argument_( |
+ extra_displacement_to_last_argument) { } |
+ |
+ StackArgumentsAccessor( |
+ Register base_reg, |
+ const ParameterCount& parameter_count, |
+ StackArgumentsAccessorReceiverMode receiver_mode = |
+ ARGUMENTS_CONTAIN_RECEIVER, |
+ int extra_displacement_to_last_argument = 0) |
+ : base_reg_(base_reg), |
+ argument_count_reg_(parameter_count.is_reg() ? |
+ parameter_count.reg() : no_reg), |
+ argument_count_immediate_(parameter_count.is_immediate() ? |
+ parameter_count.immediate() : 0), |
+ receiver_mode_(receiver_mode), |
+ extra_displacement_to_last_argument_( |
+ extra_displacement_to_last_argument) { } |
+ |
+ Operand GetArgumentOperand(int index); |
+ Operand GetReceiverOperand() { |
+ ASSERT(receiver_mode_ == ARGUMENTS_CONTAIN_RECEIVER); |
+ return GetArgumentOperand(0);; |
+ } |
+ |
+ private: |
+ const Register base_reg_; |
+ const Register argument_count_reg_; |
+ const int argument_count_immediate_; |
+ const StackArgumentsAccessorReceiverMode receiver_mode_; |
+ const int extra_displacement_to_last_argument_; |
+ |
+ DISALLOW_IMPLICIT_CONSTRUCTORS(StackArgumentsAccessor); |
+}; |
+ |
+ |
} } // namespace v8::internal |
#endif // V8_X64_CODEGEN_X64_H_ |