| Index: src/compiler/instruction.h
|
| diff --git a/src/compiler/instruction.h b/src/compiler/instruction.h
|
| index a87ef7dc9c469f865919aeef34a79fbaacb5e033..4994a2c165430e8a9e62167f2a9a61de92a4eccd 100644
|
| --- a/src/compiler/instruction.h
|
| +++ b/src/compiler/instruction.h
|
| @@ -30,7 +30,15 @@ class InstructionOperand {
|
|
|
| // TODO(dcarney): recover bit. INVALID can be represented as UNALLOCATED with
|
| // kInvalidVirtualRegister and some DCHECKS.
|
| - enum Kind { INVALID, UNALLOCATED, CONSTANT, IMMEDIATE, ALLOCATED };
|
| + enum Kind {
|
| + INVALID,
|
| + UNALLOCATED,
|
| + CONSTANT,
|
| + IMMEDIATE,
|
| + ALLOCATED,
|
| + STACK_POINTER,
|
| + FRAME_POINTER
|
| + };
|
|
|
| InstructionOperand() : InstructionOperand(INVALID) {}
|
|
|
| @@ -43,6 +51,8 @@ class InstructionOperand {
|
| INSTRUCTION_OPERAND_PREDICATE(Constant, CONSTANT)
|
| INSTRUCTION_OPERAND_PREDICATE(Immediate, IMMEDIATE)
|
| INSTRUCTION_OPERAND_PREDICATE(Allocated, ALLOCATED)
|
| + INSTRUCTION_OPERAND_PREDICATE(StackPointer, STACK_POINTER)
|
| + INSTRUCTION_OPERAND_PREDICATE(FramePointer, FRAME_POINTER)
|
| #undef INSTRUCTION_OPERAND_PREDICATE
|
|
|
| inline bool IsRegister() const;
|
| @@ -50,6 +60,10 @@ class InstructionOperand {
|
| inline bool IsStackSlot() const;
|
| inline bool IsDoubleStackSlot() const;
|
|
|
| + inline bool GeneratesRegister() const {
|
| + return IsRegister() || IsStackPointer() || IsFramePointer();
|
| + }
|
| +
|
| template <typename SubKindOperand>
|
| static SubKindOperand* New(Zone* zone, const SubKindOperand& op) {
|
| void* buffer = zone->New(sizeof(op));
|
| @@ -411,6 +425,30 @@ class AllocatedOperand : public InstructionOperand {
|
| };
|
|
|
|
|
| +class StackPointerOperand : public InstructionOperand {
|
| + public:
|
| + StackPointerOperand() : InstructionOperand(STACK_POINTER) {}
|
| +
|
| + static StackPointerOperand* New(Zone* zone) {
|
| + return InstructionOperand::New(zone, StackPointerOperand());
|
| + }
|
| +
|
| + INSTRUCTION_OPERAND_CASTS(StackPointerOperand, STACK_POINTER);
|
| +};
|
| +
|
| +
|
| +class FramePointerOperand : public InstructionOperand {
|
| + public:
|
| + FramePointerOperand() : InstructionOperand(FRAME_POINTER) {}
|
| +
|
| + static FramePointerOperand* New(Zone* zone) {
|
| + return InstructionOperand::New(zone, FramePointerOperand());
|
| + }
|
| +
|
| + INSTRUCTION_OPERAND_CASTS(FramePointerOperand, STACK_POINTER);
|
| +};
|
| +
|
| +
|
| #undef INSTRUCTION_OPERAND_CASTS
|
|
|
|
|
|
|