Revision: 24935
Author: [email protected]
Date: Tue Oct 28 13:00:11 2014 UTC
Log: [turbofan] LoadElement should not have a control input.
TEST=unittests
[email protected]
Review URL: https://codereview.chromium.org/685723002
https://code.google.com/p/v8/source/detail?r=24935
Modified:
/branches/bleeding_edge/src/compiler/js-typed-lowering.cc
/branches/bleeding_edge/src/compiler/operator-properties-inl.h
/branches/bleeding_edge/src/compiler/simplified-lowering.cc
/branches/bleeding_edge/test/unittests/compiler/js-typed-lowering-unittest.cc
/branches/bleeding_edge/test/unittests/compiler/node-test-utils.cc
/branches/bleeding_edge/test/unittests/compiler/node-test-utils.h
/branches/bleeding_edge/test/unittests/compiler/simplified-operator-reducer-unittest.cc
/branches/bleeding_edge/test/unittests/compiler/simplified-operator-unittest.cc
=======================================
--- /branches/bleeding_edge/src/compiler/js-typed-lowering.cc Tue Oct 28
09:54:00 2014 UTC
+++ /branches/bleeding_edge/src/compiler/js-typed-lowering.cc Tue Oct 28
13:00:11 2014 UTC
@@ -614,11 +614,10 @@
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);
}
}
=======================================
--- /branches/bleeding_edge/src/compiler/operator-properties-inl.h Mon Oct
27 08:41:32 2014 UTC
+++ /branches/bleeding_edge/src/compiler/operator-properties-inl.h Tue Oct
28 13:00:11 2014 UTC
@@ -122,7 +122,6 @@
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:
=======================================
--- /branches/bleeding_edge/src/compiler/simplified-lowering.cc Fri Oct 24
13:06:48 2014 UTC
+++ /branches/bleeding_edge/src/compiler/simplified-lowering.cc Tue Oct 28
13:00:11 2014 UTC
@@ -1079,23 +1079,23 @@
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);
=======================================
---
/branches/bleeding_edge/test/unittests/compiler/js-typed-lowering-unittest.cc
Tue Oct 28 08:33:52 2014 UTC
+++
/branches/bleeding_edge/test/unittests/compiler/js-typed-lowering-unittest.cc
Tue Oct 28 13:00:11 2014 UTC
@@ -143,7 +143,7 @@
IsLoadElement(AccessBuilder::ForTypedArrayElement(type, true),
IsIntPtrConstant(bit_cast<intptr_t>(&backing_store[0])),
key, IsNumberConstant(static_cast<double>(kLength)),
- effect, control));
+ effect));
}
}
=======================================
--- /branches/bleeding_edge/test/unittests/compiler/node-test-utils.cc Tue
Oct 28 08:33:52 2014 UTC
+++ /branches/bleeding_edge/test/unittests/compiler/node-test-utils.cc Tue
Oct 28 13:00:11 2014 UTC
@@ -403,15 +403,13 @@
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);
@@ -423,10 +421,8 @@
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 << ")";
}
@@ -442,9 +438,7 @@
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:
@@ -453,7 +447,6 @@
const Matcher<Node*> index_matcher_;
const Matcher<Node*> length_matcher_;
const Matcher<Node*> effect_matcher_;
- const Matcher<Node*> control_matcher_;
};
@@ -813,11 +806,10 @@
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));
}
=======================================
--- /branches/bleeding_edge/test/unittests/compiler/node-test-utils.h Tue
Oct 28 08:33:52 2014 UTC
+++ /branches/bleeding_edge/test/unittests/compiler/node-test-utils.h Tue
Oct 28 13:00:11 2014 UTC
@@ -77,8 +77,7 @@
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,
=======================================
---
/branches/bleeding_edge/test/unittests/compiler/simplified-operator-reducer-unittest.cc
Tue Oct 28 08:28:36 2014 UTC
+++
/branches/bleeding_edge/test/unittests/compiler/simplified-operator-reducer-unittest.cc
Tue Oct 28 13:00:11 2014 UTC
@@ -490,46 +490,45 @@
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());
}
}
=======================================
---
/branches/bleeding_edge/test/unittests/compiler/simplified-operator-unittest.cc
Wed Oct 1 11:08:37 2014 UTC
+++
/branches/bleeding_edge/test/unittests/compiler/simplified-operator-unittest.cc
Tue Oct 28 13:00:11 2014 UTC
@@ -177,8 +177,8 @@
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));
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.