summaryrefslogtreecommitdiff
path: root/deps/v8/src/compiler/js-intrinsic-lowering.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/compiler/js-intrinsic-lowering.cc')
-rw-r--r--deps/v8/src/compiler/js-intrinsic-lowering.cc29
1 files changed, 14 insertions, 15 deletions
diff --git a/deps/v8/src/compiler/js-intrinsic-lowering.cc b/deps/v8/src/compiler/js-intrinsic-lowering.cc
index 3ed50acaeb..2322b8ac3a 100644
--- a/deps/v8/src/compiler/js-intrinsic-lowering.cc
+++ b/deps/v8/src/compiler/js-intrinsic-lowering.cc
@@ -69,8 +69,6 @@ Reduction JSIntrinsicLowering::Reduce(Node* node) {
return ReduceIsJSReceiver(node);
case Runtime::kInlineIsSmi:
return ReduceIsSmi(node);
- case Runtime::kInlineSubString:
- return ReduceSubString(node);
case Runtime::kInlineToInteger:
return ReduceToInteger(node);
case Runtime::kInlineToLength:
@@ -241,19 +239,22 @@ Reduction JSIntrinsicLowering::ReduceIsInstanceType(
Node* vtrue = jsgraph()->FalseConstant();
Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
- Node* efalse = graph()->NewNode(
- simplified()->LoadField(AccessBuilder::ForMapInstanceType()),
+ Node* efalse = effect;
+ Node* map = efalse =
graph()->NewNode(simplified()->LoadField(AccessBuilder::ForMap()), value,
- effect, if_false),
- effect, if_false);
- Node* vfalse = graph()->NewNode(simplified()->NumberEqual(), efalse,
- jsgraph()->Constant(instance_type));
+ efalse, if_false);
+ Node* map_instance_type = efalse = graph()->NewNode(
+ simplified()->LoadField(AccessBuilder::ForMapInstanceType()), map, efalse,
+ if_false);
+ Node* vfalse =
+ graph()->NewNode(simplified()->NumberEqual(), map_instance_type,
+ jsgraph()->Constant(instance_type));
Node* merge = graph()->NewNode(common()->Merge(2), if_true, if_false);
// Replace all effect uses of {node} with the {ephi}.
Node* ephi = graph()->NewNode(common()->EffectPhi(2), etrue, efalse, merge);
- ReplaceWithValue(node, node, ephi);
+ ReplaceWithValue(node, node, ephi, merge);
// Turn the {node} into a Phi.
return Change(node, common()->Phi(MachineRepresentation::kTagged, 2), vtrue,
@@ -281,11 +282,6 @@ Reduction JSIntrinsicLowering::Change(Node* node, const Operator* op) {
return Changed(node);
}
-Reduction JSIntrinsicLowering::ReduceSubString(Node* node) {
- return Change(node, CodeFactory::SubString(isolate()), 3);
-}
-
-
Reduction JSIntrinsicLowering::ReduceToInteger(Node* node) {
NodeProperties::ChangeOp(node, javascript()->ToInteger());
return Changed(node);
@@ -389,8 +385,11 @@ Reduction JSIntrinsicLowering::ReduceTheHole(Node* node) {
Reduction JSIntrinsicLowering::ReduceClassOf(Node* node) {
RelaxEffectsAndControls(node);
+ // The ClassOf operator has a single value input and control input.
+ Node* control_input = NodeProperties::GetControlInput(node, 0);
node->TrimInputCount(2);
- NodeProperties::ChangeOp(node, javascript()->ClassOf());
+ node->ReplaceInput(1, control_input);
+ NodeProperties::ChangeOp(node, simplified()->ClassOf());
return Changed(node);
}