summaryrefslogtreecommitdiff
path: root/deps/v8/src/lithium.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/lithium.h')
-rw-r--r--deps/v8/src/lithium.h32
1 files changed, 10 insertions, 22 deletions
diff --git a/deps/v8/src/lithium.h b/deps/v8/src/lithium.h
index 2ccbf56c50..d1e2e3cdef 100644
--- a/deps/v8/src/lithium.h
+++ b/deps/v8/src/lithium.h
@@ -35,14 +35,6 @@
namespace v8 {
namespace internal {
-#define LITHIUM_OPERAND_LIST(V) \
- V(ConstantOperand, CONSTANT_OPERAND) \
- V(StackSlot, STACK_SLOT) \
- V(DoubleStackSlot, DOUBLE_STACK_SLOT) \
- V(Register, REGISTER) \
- V(DoubleRegister, DOUBLE_REGISTER)
-
-
class LOperand: public ZoneObject {
public:
enum Kind {
@@ -60,13 +52,14 @@ class LOperand: public ZoneObject {
Kind kind() const { return KindField::decode(value_); }
int index() const { return static_cast<int>(value_) >> kKindFieldWidth; }
-#define LITHIUM_OPERAND_PREDICATE(name, type) \
- bool Is##name() const { return kind() == type; }
- LITHIUM_OPERAND_LIST(LITHIUM_OPERAND_PREDICATE)
- LITHIUM_OPERAND_PREDICATE(Argument, ARGUMENT)
- LITHIUM_OPERAND_PREDICATE(Unallocated, UNALLOCATED)
- LITHIUM_OPERAND_PREDICATE(Ignored, INVALID)
-#undef LITHIUM_OPERAND_PREDICATE
+ bool IsConstantOperand() const { return kind() == CONSTANT_OPERAND; }
+ bool IsStackSlot() const { return kind() == STACK_SLOT; }
+ bool IsDoubleStackSlot() const { return kind() == DOUBLE_STACK_SLOT; }
+ bool IsRegister() const { return kind() == REGISTER; }
+ bool IsDoubleRegister() const { return kind() == DOUBLE_REGISTER; }
+ bool IsArgument() const { return kind() == ARGUMENT; }
+ bool IsUnallocated() const { return kind() == UNALLOCATED; }
+ bool IsIgnored() const { return kind() == INVALID; }
bool Equals(LOperand* other) const { return value_ == other->value_; }
void PrintTo(StringStream* stream);
@@ -76,9 +69,9 @@ class LOperand: public ZoneObject {
ASSERT(this->index() == index);
}
- // Calls SetUpCache()/TearDownCache() for each subclass.
+ // Calls SetUpCache() for each subclass. Don't forget to update this method
+ // if you add a new LOperand subclass.
static void SetUpCaches();
- static void TearDownCaches();
protected:
static const int kKindFieldWidth = 3;
@@ -272,7 +265,6 @@ class LConstantOperand: public LOperand {
}
static void SetUpCache();
- static void TearDownCache();
private:
static const int kNumCachedOperands = 128;
@@ -308,7 +300,6 @@ class LStackSlot: public LOperand {
}
static void SetUpCache();
- static void TearDownCache();
private:
static const int kNumCachedOperands = 128;
@@ -333,7 +324,6 @@ class LDoubleStackSlot: public LOperand {
}
static void SetUpCache();
- static void TearDownCache();
private:
static const int kNumCachedOperands = 128;
@@ -358,7 +348,6 @@ class LRegister: public LOperand {
}
static void SetUpCache();
- static void TearDownCache();
private:
static const int kNumCachedOperands = 16;
@@ -383,7 +372,6 @@ class LDoubleRegister: public LOperand {
}
static void SetUpCache();
- static void TearDownCache();
private:
static const int kNumCachedOperands = 16;