Commit 0e039730 authored by bmeurer's avatar bmeurer Committed by Commit bot

[turbofan] Introduce PretenureFlagOf helper function.

R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2357573002
Cr-Commit-Position: refs/heads/master@{#39539}
parent b42ecda5
......@@ -107,7 +107,7 @@ void MemoryOptimizer::VisitAllocate(Node* node, AllocationState const* state) {
Node* size = node->InputAt(0);
Node* effect = node->InputAt(1);
Node* control = node->InputAt(2);
PretenureFlag pretenure = OpParameter<PretenureFlag>(node->op());
PretenureFlag pretenure = PretenureFlagOf(node->op());
// Propagate tenuring from outer allocations to inner allocations, i.e.
// when we allocate an object in old space and store a newly allocated
......@@ -119,7 +119,7 @@ void MemoryOptimizer::VisitAllocate(Node* node, AllocationState const* state) {
if (user->opcode() == IrOpcode::kStoreField && edge.index() == 0) {
Node* const child = user->InputAt(1);
if (child->opcode() == IrOpcode::kAllocate &&
OpParameter<PretenureFlag>(child) == NOT_TENURED) {
PretenureFlagOf(child->op()) == NOT_TENURED) {
NodeProperties::ChangeOp(child, node->op());
break;
}
......@@ -132,7 +132,7 @@ void MemoryOptimizer::VisitAllocate(Node* node, AllocationState const* state) {
if (user->opcode() == IrOpcode::kStoreField && edge.index() == 1) {
Node* const parent = user->InputAt(0);
if (parent->opcode() == IrOpcode::kAllocate &&
OpParameter<PretenureFlag>(parent) == TENURED) {
PretenureFlagOf(parent->op()) == TENURED) {
pretenure = TENURED;
break;
}
......
......@@ -332,6 +332,11 @@ NumberOperationHint NumberOperationHintOf(const Operator* op) {
return OpParameter<NumberOperationHint>(op);
}
PretenureFlag PretenureFlagOf(const Operator* op) {
DCHECK_EQ(IrOpcode::kAllocate, op->opcode());
return OpParameter<PretenureFlag>(op);
}
#define PURE_OP_LIST(V) \
V(BooleanNot, Operator::kNoProperties, 1, 0) \
V(NumberEqual, Operator::kCommutative, 2, 0) \
......
......@@ -183,6 +183,8 @@ std::ostream& operator<<(std::ostream&, NumberOperationHint);
NumberOperationHint NumberOperationHintOf(const Operator* op)
WARN_UNUSED_RESULT;
PretenureFlag PretenureFlagOf(const Operator* op) WARN_UNUSED_RESULT;
// Interface for building simplified operators, which represent the
// medium-level operations of V8, including adding numbers, allocating objects,
// indexing into objects and arrays, etc.
......
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