Index: src/compiler/opcodes.h |
diff --git a/src/compiler/opcodes.h b/src/compiler/opcodes.h |
index b7a2f6b51ba22c1e6bad7403407c77c3781fc91f..fa85974c0136e2ff46b8dcb2007efc75bfed89b3 100644 |
--- a/src/compiler/opcodes.h |
+++ b/src/compiler/opcodes.h |
@@ -275,57 +275,24 @@ class IrOpcode { |
// Returns the mnemonic name of an opcode. |
static char const* Mnemonic(Value value); |
- static bool IsJsOpcode(Value val) { |
- switch (val) { |
-// TODO(turbofan): make this a range check. |
-#define RETURN_NAME(x) \ |
- case k##x: \ |
- return true; |
- JS_OP_LIST(RETURN_NAME) |
-#undef RETURN_NAME |
- default: |
- return false; |
- } |
+ // Returns true if opcode for common operator. |
+ static bool IsCommonOpcode(Value value) { |
+ return kDead <= value && value <= kProjection; |
} |
- static bool IsControlOpcode(Value val) { |
- switch (val) { |
-// TODO(turbofan): make this a range check. |
-#define RETURN_NAME(x) \ |
- case k##x: \ |
- return true; |
- CONTROL_OP_LIST(RETURN_NAME) |
-#undef RETURN_NAME |
- default: |
- return false; |
- } |
+ // Returns true if opcode for control operator. |
+ static bool IsControlOpcode(Value value) { |
+ return kDead <= value && value <= kEnd; |
} |
- static bool IsLeafOpcode(Value val) { |
- switch (val) { |
-// TODO(turbofan): make this a table lookup. |
-#define RETURN_NAME(x) \ |
- case k##x: \ |
- return true; |
- LEAF_OP_LIST(RETURN_NAME) |
-#undef RETURN_NAME |
- default: |
- return false; |
- } |
+ // Returns true if opcode for JavaScript operator. |
+ static bool IsJsOpcode(Value value) { |
+ return kJSEqual <= value && value <= kJSDebugger; |
} |
- static bool IsCommonOpcode(Value val) { |
- switch (val) { |
-// TODO(turbofan): make this a table lookup or a range check. |
-#define RETURN_NAME(x) \ |
- case k##x: \ |
- return true; |
- CONTROL_OP_LIST(RETURN_NAME) |
- COMMON_OP_LIST(RETURN_NAME) |
-#undef RETURN_NAME |
- default: |
- return false; |
- } |
+ // Returns true if opcode for leaf operator. |
+ static bool IsLeafOpcode(Value value) { |
+ return kInt32Constant <= value && value <= kHeapConstant; |
} |
}; |