[turbofan] Rename IrOpcode predicate IsLeafOpcode to IsConstantOpcode.

R=mstarzinger@chromium.org
BUG=

Review URL: https://codereview.chromium.org/863513002

Cr-Commit-Position: refs/heads/master@{#26141}
This commit is contained in:
Ben L. Titzer 2015-01-19 16:35:03 +01:00
parent 36003d07eb
commit 396381f944
3 changed files with 20 additions and 20 deletions

View File

@ -858,8 +858,8 @@ Reduction JSTypedLowering::ReduceJSStoreContext(Node* node) {
Reduction JSTypedLowering::Reduce(Node* node) {
// Check if the output type is a singleton. In that case we already know the
// result value and can simply replace the node if it's eliminable.
if (NodeProperties::IsTyped(node) &&
!IrOpcode::IsLeafOpcode(node->opcode()) &&
if (!IrOpcode::IsConstantOpcode(node->opcode()) &&
NodeProperties::IsTyped(node) &&
node->op()->HasProperty(Operator::kEliminatable)) {
Type* upper = NodeProperties::GetBounds(node).upper;
if (upper->IsConstant()) {

View File

@ -24,14 +24,14 @@
V(Start) \
V(End)
// Opcodes for common operators.
#define LEAF_OP_LIST(V) \
V(Int32Constant) \
V(Int64Constant) \
V(Float32Constant) \
V(Float64Constant) \
V(ExternalConstant) \
V(NumberConstant) \
// Opcodes for constant operators.
#define CONSTANT_OP_LIST(V) \
V(Int32Constant) \
V(Int64Constant) \
V(Float32Constant) \
V(Float64Constant) \
V(ExternalConstant) \
V(NumberConstant) \
V(HeapConstant)
#define INNER_OP_LIST(V) \
@ -48,7 +48,7 @@
V(Projection)
#define COMMON_OP_LIST(V) \
LEAF_OP_LIST(V) \
CONSTANT_OP_LIST(V) \
INNER_OP_LIST(V)
// Opcodes for JavaScript operators.
@ -290,8 +290,8 @@ class IrOpcode {
return kJSEqual <= value && value <= kJSDebugger;
}
// Returns true if opcode for leaf operator.
static bool IsLeafOpcode(Value value) {
// Returns true if opcode for constant operator.
static bool IsConstantOpcode(Value value) {
return kInt32Constant <= value && value <= kHeapConstant;
}
};

View File

@ -51,12 +51,12 @@ bool IsJsOpcode(IrOpcode::Value opcode) {
}
bool IsLeafOpcode(IrOpcode::Value opcode) {
bool IsConstantOpcode(IrOpcode::Value opcode) {
switch (opcode) {
#define OPCODE(Opcode) \
case IrOpcode::k##Opcode: \
return true;
LEAF_OP_LIST(OPCODE)
CONSTANT_OP_LIST(OPCODE)
#undef OPCODE
default:
return false;
@ -99,11 +99,11 @@ TEST(IrOpcodeTest, IsJsOpcode) {
}
TEST(IrOpcodeTest, IsLeafOpcode) {
EXPECT_FALSE(IrOpcode::IsLeafOpcode(kInvalidOpcode));
#define OPCODE(Opcode) \
EXPECT_EQ(IsLeafOpcode(IrOpcode::k##Opcode), \
IrOpcode::IsLeafOpcode(IrOpcode::k##Opcode));
TEST(IrOpcodeTest, IsConstantOpcode) {
EXPECT_FALSE(IrOpcode::IsConstantOpcode(kInvalidOpcode));
#define OPCODE(Opcode) \
EXPECT_EQ(IsConstantOpcode(IrOpcode::k##Opcode), \
IrOpcode::IsConstantOpcode(IrOpcode::k##Opcode));
ALL_OP_LIST(OPCODE)
#undef OPCODE
}