Commit 396381f9 authored by Ben L. Titzer's avatar Ben L. Titzer

[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}
parent 36003d07
...@@ -858,8 +858,8 @@ Reduction JSTypedLowering::ReduceJSStoreContext(Node* node) { ...@@ -858,8 +858,8 @@ Reduction JSTypedLowering::ReduceJSStoreContext(Node* node) {
Reduction JSTypedLowering::Reduce(Node* node) { Reduction JSTypedLowering::Reduce(Node* node) {
// Check if the output type is a singleton. In that case we already know the // 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. // result value and can simply replace the node if it's eliminable.
if (NodeProperties::IsTyped(node) && if (!IrOpcode::IsConstantOpcode(node->opcode()) &&
!IrOpcode::IsLeafOpcode(node->opcode()) && NodeProperties::IsTyped(node) &&
node->op()->HasProperty(Operator::kEliminatable)) { node->op()->HasProperty(Operator::kEliminatable)) {
Type* upper = NodeProperties::GetBounds(node).upper; Type* upper = NodeProperties::GetBounds(node).upper;
if (upper->IsConstant()) { if (upper->IsConstant()) {
......
...@@ -24,14 +24,14 @@ ...@@ -24,14 +24,14 @@
V(Start) \ V(Start) \
V(End) V(End)
// Opcodes for common operators. // Opcodes for constant operators.
#define LEAF_OP_LIST(V) \ #define CONSTANT_OP_LIST(V) \
V(Int32Constant) \ V(Int32Constant) \
V(Int64Constant) \ V(Int64Constant) \
V(Float32Constant) \ V(Float32Constant) \
V(Float64Constant) \ V(Float64Constant) \
V(ExternalConstant) \ V(ExternalConstant) \
V(NumberConstant) \ V(NumberConstant) \
V(HeapConstant) V(HeapConstant)
#define INNER_OP_LIST(V) \ #define INNER_OP_LIST(V) \
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
V(Projection) V(Projection)
#define COMMON_OP_LIST(V) \ #define COMMON_OP_LIST(V) \
LEAF_OP_LIST(V) \ CONSTANT_OP_LIST(V) \
INNER_OP_LIST(V) INNER_OP_LIST(V)
// Opcodes for JavaScript operators. // Opcodes for JavaScript operators.
...@@ -290,8 +290,8 @@ class IrOpcode { ...@@ -290,8 +290,8 @@ class IrOpcode {
return kJSEqual <= value && value <= kJSDebugger; return kJSEqual <= value && value <= kJSDebugger;
} }
// Returns true if opcode for leaf operator. // Returns true if opcode for constant operator.
static bool IsLeafOpcode(Value value) { static bool IsConstantOpcode(Value value) {
return kInt32Constant <= value && value <= kHeapConstant; return kInt32Constant <= value && value <= kHeapConstant;
} }
}; };
......
...@@ -51,12 +51,12 @@ bool IsJsOpcode(IrOpcode::Value opcode) { ...@@ -51,12 +51,12 @@ bool IsJsOpcode(IrOpcode::Value opcode) {
} }
bool IsLeafOpcode(IrOpcode::Value opcode) { bool IsConstantOpcode(IrOpcode::Value opcode) {
switch (opcode) { switch (opcode) {
#define OPCODE(Opcode) \ #define OPCODE(Opcode) \
case IrOpcode::k##Opcode: \ case IrOpcode::k##Opcode: \
return true; return true;
LEAF_OP_LIST(OPCODE) CONSTANT_OP_LIST(OPCODE)
#undef OPCODE #undef OPCODE
default: default:
return false; return false;
...@@ -99,11 +99,11 @@ TEST(IrOpcodeTest, IsJsOpcode) { ...@@ -99,11 +99,11 @@ TEST(IrOpcodeTest, IsJsOpcode) {
} }
TEST(IrOpcodeTest, IsLeafOpcode) { TEST(IrOpcodeTest, IsConstantOpcode) {
EXPECT_FALSE(IrOpcode::IsLeafOpcode(kInvalidOpcode)); EXPECT_FALSE(IrOpcode::IsConstantOpcode(kInvalidOpcode));
#define OPCODE(Opcode) \ #define OPCODE(Opcode) \
EXPECT_EQ(IsLeafOpcode(IrOpcode::k##Opcode), \ EXPECT_EQ(IsConstantOpcode(IrOpcode::k##Opcode), \
IrOpcode::IsLeafOpcode(IrOpcode::k##Opcode)); IrOpcode::IsConstantOpcode(IrOpcode::k##Opcode));
ALL_OP_LIST(OPCODE) ALL_OP_LIST(OPCODE)
#undef OPCODE #undef OPCODE
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment