Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1054)

Unified Diff: src/compiler/js-generic-lowering.cc

Issue 1374683002: [turbofan] Make Strict(Not)Equal, TypeOf, ToBoolean, UnaryNot effectful. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove the no-write property from Strict(Not)Equal Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/compiler/js-operator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-generic-lowering.cc
diff --git a/src/compiler/js-generic-lowering.cc b/src/compiler/js-generic-lowering.cc
index 4937b1dea37f3b3db16049fb57eecb4a6f19a602..2d4210dff4e00af19ae59d3339c3a5100548b0f5 100644
--- a/src/compiler/js-generic-lowering.cc
+++ b/src/compiler/js-generic-lowering.cc
@@ -149,17 +149,19 @@ void JSGenericLowering::ReplaceWithCompareIC(Node* node, Token::Value token,
inputs.push_back(NodeProperties::GetValueInput(node, 0));
inputs.push_back(NodeProperties::GetValueInput(node, 1));
inputs.push_back(NodeProperties::GetContextInput(node));
- if (node->op()->HasProperty(Operator::kPure)) {
- // A pure (strict) comparison doesn't have an effect, control or frame
- // state. But for the graph, we need to add control and effect inputs.
- DCHECK(OperatorProperties::GetFrameStateInputCount(node->op()) == 0);
- inputs.push_back(graph()->start());
- inputs.push_back(graph()->start());
- } else {
+ // Some comparisons (StrictEqual) don't have an effect, control or frame
+ // state inputs, so handle those cases here.
+ if (OperatorProperties::GetFrameStateInputCount(node->op()) > 0) {
inputs.push_back(NodeProperties::GetFrameStateInput(node, 0));
- inputs.push_back(NodeProperties::GetEffectInput(node));
- inputs.push_back(NodeProperties::GetControlInput(node));
}
+ Node* effect = (node->op()->EffectInputCount() > 0)
+ ? NodeProperties::GetEffectInput(node)
+ : graph()->start();
+ inputs.push_back(effect);
+ Node* control = (node->op()->ControlInputCount() > 0)
+ ? NodeProperties::GetControlInput(node)
+ : graph()->start();
+ inputs.push_back(control);
CallDescriptor* desc_compare = Linkage::GetStubCallDescriptor(
isolate(), zone(), callable.descriptor(), 0,
CallDescriptor::kPatchableCallSiteWithNop | FlagsForNode(node),
« no previous file with comments | « no previous file | src/compiler/js-operator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698