Chromium Code Reviews| Index: src/a64/macro-assembler-a64.h |
| diff --git a/src/a64/macro-assembler-a64.h b/src/a64/macro-assembler-a64.h |
| index c36a2e801612b8dd6b7ffc4de8ba2eca006aac7a..b711bd1560e52dbc7aa8eda0cdeda6ae9f0cefa5 100644 |
| --- a/src/a64/macro-assembler-a64.h |
| +++ b/src/a64/macro-assembler-a64.h |
| @@ -28,6 +28,8 @@ |
| #ifndef V8_A64_MACRO_ASSEMBLER_A64_H_ |
| #define V8_A64_MACRO_ASSEMBLER_A64_H_ |
| +#include <vector> |
| + |
| #include "v8globals.h" |
| #include "globals.h" |
| @@ -517,7 +519,8 @@ class MacroAssembler : public Assembler { |
| } |
| // Push the specified register 'count' times. |
| - void PushMultipleTimes(int count, Register src); |
| + void PushMultipleTimes(CPURegister src, Register count); |
| + void PushMultipleTimes(CPURegister src, int count); |
| // This is a convenience method for pushing a single Handle<Object>. |
| inline void Push(Handle<Object> handle); |
| @@ -531,6 +534,35 @@ class MacroAssembler : public Assembler { |
| Pop(dst); |
| } |
| + // Sometimes callers need to push or pop multiple registers in a way that is |
| + // difficult to structure efficiently for fixed Push or Pop calls. This scope |
| + // allows push requests to be queued up, then flushed at once. The |
| + // MacroAssembler will try to generate the most efficient sequence required. |
| + // |
| + // Unlike the other Push and Pop macros, PushPopQueue can handle mixed sets of |
| + // register sizes and types. |
| + class PushPopQueue { |
| + public: |
| + explicit PushPopQueue(MacroAssembler* masm) : masm_(masm), size_(0) { } |
| + |
| + ~PushPopQueue() { |
| + ASSERT(queued_.empty()); |
| + } |
| + |
| + void Queue(const CPURegister& rt) { |
| + size_ += rt.SizeInBytes(); |
| + queued_.push_back(rt); |
| + } |
| + |
| + void PushQueued(); |
| + void PopQueued(); |
| + |
| + private: |
| + MacroAssembler* masm_; |
| + int size_; |
| + std::vector<CPURegister> queued_; |
| + }; |
| + |
| // Poke 'src' onto the stack. The offset is in bytes. |
| // |
| // If the current stack pointer (according to StackPointer()) is csp, then |
| @@ -2001,9 +2033,12 @@ class MacroAssembler : public Assembler { |
| // Perform necessary maintenance operations before a push or pop. |
| // |
| - // Note that size is per register, and is specified in bytes. |
| - void PrepareForPush(int count, int size); |
| - void PrepareForPop(int count, int size); |
| + // Note that size is specified in bytes. |
| + void PrepareForPush(Operand total_size); |
| + void PrepareForPop(Operand total_size); |
| + |
| + void PrepareForPush(int count, int size) { PrepareForPush(count * size); } |
|
rmcilroy
2014/02/17 12:31:06
nit - restore the comment for these methods that:
|
| + void PrepareForPop(int count, int size) { PrepareForPop(count * size); } |
| // Call Printf. On a native build, a simple call will be generated, but if the |
| // simulator is being used then a suitable pseudo-instruction is used. The |