bit_cast<intptr_t>(elements->external_pointer()));
Node* length = jsgraph()->Constant(byte_length / array->element_size());
Node* effect = NodeProperties::GetEffectInput(node);
- Node* control = NodeProperties::GetControlInput(node);
Node* load = graph()->NewNode(
simplified()->LoadElement(
AccessBuilder::ForTypedArrayElement(type, true)),
- pointer, key, length, effect, control);
+ pointer, key, length, effect);
return ReplaceEagerly(node, load);
}
}
case IrOpcode::kPhi:
case IrOpcode::kEffectPhi:
case IrOpcode::kLoad:
- case IrOpcode::kLoadElement:
case IrOpcode::kLoadField:
return 1;
#define OPCODE_CASE(x) case IrOpcode::k##x:
const ElementAccess& access = ElementAccessOf(node->op());
const Operator* op = machine()->Load(access.machine_type);
Node* key = node->InputAt(1);
+ Node* effect = node->InputAt(3);
Node* index = ComputeIndex(access, key);
if (access.bounds_check == kNoBoundsCheck) {
DCHECK_EQ(access.machine_type, output_type);
node->set_op(op);
node->ReplaceInput(1, index);
- node->RemoveInput(2);
+ node->ReplaceInput(2, effect);
+ node->ReplaceInput(3, graph()->start());
} else {
DCHECK_EQ(kTypedArrayBoundsCheck, access.bounds_check);
Node* base = node->InputAt(0);
Node* length = node->InputAt(2);
- Node* effect = node->InputAt(3);
- Node* control = node->InputAt(4);
Node* check = graph()->NewNode(machine()->Uint32LessThan(), key, length);
- Node* branch =
- graph()->NewNode(common()->Branch(BranchHint::kTrue), check, control);
+ Node* branch = graph()->NewNode(common()->Branch(BranchHint::kTrue), check,
+ graph()->start());
Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
Node* load = graph()->NewNode(op, base, index, effect, if_true);
IsLoadElement(AccessBuilder::ForTypedArrayElement(type, true),
IsIntPtrConstant(bit_cast<intptr_t>(&backing_store[0])),
key, IsNumberConstant(static_cast<double>(kLength)),
- effect, control));
+ effect));
}
}
const Matcher<Node*>& base_matcher,
const Matcher<Node*>& index_matcher,
const Matcher<Node*>& length_matcher,
- const Matcher<Node*>& effect_matcher,
- const Matcher<Node*>& control_matcher)
+ const Matcher<Node*>& effect_matcher)
: NodeMatcher(IrOpcode::kLoadElement),
access_matcher_(access_matcher),
base_matcher_(base_matcher),
index_matcher_(index_matcher),
length_matcher_(length_matcher),
- effect_matcher_(effect_matcher),
- control_matcher_(control_matcher) {}
+ effect_matcher_(effect_matcher) {}
virtual void DescribeTo(std::ostream* os) const OVERRIDE {
NodeMatcher::DescribeTo(os);
index_matcher_.DescribeTo(os);
*os << "), length (";
length_matcher_.DescribeTo(os);
- *os << "), effect (";
+ *os << ") and effect (";
effect_matcher_.DescribeTo(os);
- *os << ") and control (";
- control_matcher_.DescribeTo(os);
*os << ")";
}
PrintMatchAndExplain(NodeProperties::GetValueInput(node, 2),
"length", length_matcher_, listener) &&
PrintMatchAndExplain(NodeProperties::GetEffectInput(node), "effect",
- effect_matcher_, listener) &&
- PrintMatchAndExplain(NodeProperties::GetControlInput(node),
- "control", control_matcher_, listener));
+ effect_matcher_, listener));
}
private:
const Matcher<Node*> index_matcher_;
const Matcher<Node*> length_matcher_;
const Matcher<Node*> effect_matcher_;
- const Matcher<Node*> control_matcher_;
};
const Matcher<Node*>& base_matcher,
const Matcher<Node*>& index_matcher,
const Matcher<Node*>& length_matcher,
- const Matcher<Node*>& effect_matcher,
- const Matcher<Node*>& control_matcher) {
+ const Matcher<Node*>& effect_matcher) {
return MakeMatcher(new IsLoadElementMatcher(access_matcher, base_matcher,
index_matcher, length_matcher,
- effect_matcher, control_matcher));
+ effect_matcher));
}
const Matcher<Node*>& base_matcher,
const Matcher<Node*>& index_matcher,
const Matcher<Node*>& length_matcher,
- const Matcher<Node*>& effect_matcher,
- const Matcher<Node*>& control_matcher);
+ const Matcher<Node*>& effect_matcher);
Matcher<Node*> IsStoreElement(const Matcher<ElementAccess>& access_matcher,
const Matcher<Node*>& base_matcher,
const Matcher<Node*>& index_matcher,
access_nocheck.bounds_check = kNoBoundsCheck;
Node* const base = Parameter(0);
Node* const effect = graph()->start();
- Node* const control = graph()->start();
{
Node* const key = NumberConstant(-42.0);
Node* const length = NumberConstant(100.0);
Reduction r = Reduce(graph()->NewNode(simplified()->LoadElement(access),
- base, key, length, effect, control));
+ base, key, length, effect));
ASSERT_FALSE(r.Changed());
}
{
Node* const key = NumberConstant(-0.0);
Node* const length = NumberConstant(1.0);
Reduction r = Reduce(graph()->NewNode(simplified()->LoadElement(access),
- base, key, length, effect, control));
+ base, key, length, effect));
ASSERT_TRUE(r.Changed());
- EXPECT_THAT(r.replacement(), IsLoadElement(access_nocheck, base, key,
- length, effect, control));
+ EXPECT_THAT(r.replacement(),
+ IsLoadElement(access_nocheck, base, key, length, effect));
}
{
Node* const key = NumberConstant(0);
Node* const length = NumberConstant(1);
Reduction r = Reduce(graph()->NewNode(simplified()->LoadElement(access),
- base, key, length, effect, control));
+ base, key, length, effect));
ASSERT_TRUE(r.Changed());
- EXPECT_THAT(r.replacement(), IsLoadElement(access_nocheck, base, key,
- length, effect, control));
+ EXPECT_THAT(r.replacement(),
+ IsLoadElement(access_nocheck, base, key, length, effect));
}
{
Node* const key = NumberConstant(42.2);
Node* const length = NumberConstant(128);
Reduction r = Reduce(graph()->NewNode(simplified()->LoadElement(access),
- base, key, length, effect, control));
+ base, key, length, effect));
ASSERT_TRUE(r.Changed());
- EXPECT_THAT(r.replacement(), IsLoadElement(access_nocheck, base, key,
- length, effect, control));
+ EXPECT_THAT(r.replacement(),
+ IsLoadElement(access_nocheck, base, key, length, effect));
}
{
Node* const key = NumberConstant(39.2);
Node* const length = NumberConstant(32.0);
Reduction r = Reduce(graph()->NewNode(simplified()->LoadElement(access),
- base, key, length, effect, control));
+ base, key, length, effect));
ASSERT_FALSE(r.Changed());
}
}
EXPECT_EQ(3, OperatorProperties::GetValueInputCount(op));
EXPECT_EQ(1, OperatorProperties::GetEffectInputCount(op));
- EXPECT_EQ(1, OperatorProperties::GetControlInputCount(op));
- EXPECT_EQ(5, OperatorProperties::GetTotalInputCount(op));
+ EXPECT_EQ(0, OperatorProperties::GetControlInputCount(op));
+ EXPECT_EQ(4, OperatorProperties::GetTotalInputCount(op));
EXPECT_EQ(1, OperatorProperties::GetValueOutputCount(op));
EXPECT_EQ(1, OperatorProperties::GetEffectOutputCount(op));