diff options
| author | 2014-04-03 16:49:25 +0000 | |
|---|---|---|
| committer | 2014-04-03 16:49:25 +0000 | |
| commit | a7b2826fa469c626ff2c3ff26fd848c28bccc092 (patch) | |
| tree | f53277bb95088b5b650cf982d0da666f1204517a /compiler/optimizing/code_generator.h | |
| parent | 5a4139fd33547d09c94d9650157e3a4e4c9eede4 (diff) | |
| parent | 4a34a428c6a2588e0857ef6baf88f1b73ce65958 (diff) | |
Merge "Support passing arguments to invoke-static* instructions."
Diffstat (limited to 'compiler/optimizing/code_generator.h')
| -rw-r--r-- | compiler/optimizing/code_generator.h | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/compiler/optimizing/code_generator.h b/compiler/optimizing/code_generator.h index 24dcab6131..01bbcc0bb6 100644 --- a/compiler/optimizing/code_generator.h +++ b/compiler/optimizing/code_generator.h @@ -141,8 +141,7 @@ class CodeGenerator : public ArenaObject { virtual void GenerateFrameEntry() = 0; virtual void GenerateFrameExit() = 0; virtual void Bind(Label* label) = 0; - virtual void Move(HInstruction* instruction, Location location) = 0; - virtual void Push(HInstruction* instruction, Location location) = 0; + virtual void Move(HInstruction* instruction, Location location, HInstruction* move_for) = 0; virtual HGraphVisitor* GetLocationBuilder() = 0; virtual HGraphVisitor* GetInstructionVisitor() = 0; virtual Assembler* GetAssembler() = 0; @@ -191,6 +190,33 @@ class CodeGenerator : public ArenaObject { DISALLOW_COPY_AND_ASSIGN(CodeGenerator); }; +template <typename T> +class CallingConvention { + public: + CallingConvention(const T* registers, int number_of_registers) + : registers_(registers), number_of_registers_(number_of_registers) {} + + size_t GetNumberOfRegisters() const { return number_of_registers_; } + + T GetRegisterAt(size_t index) const { + DCHECK_LT(index, number_of_registers_); + return registers_[index]; + } + + uint8_t GetStackOffsetOf(size_t index) const { + DCHECK_GE(index, number_of_registers_); + // We still reserve the space for parameters passed by registers. + // Add kWordSize for the method pointer. + return index * kWordSize + kWordSize; + } + + private: + const T* registers_; + const size_t number_of_registers_; + + DISALLOW_COPY_AND_ASSIGN(CallingConvention); +}; + } // namespace art #endif // ART_COMPILER_OPTIMIZING_CODE_GENERATOR_H_ |