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

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

Issue 2059653002: [turbofan] Introduce PlainPrimitiveToNumber. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Tweak Created 4 years, 6 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 | « src/compiler/js-graph.cc ('k') | src/compiler/opcodes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-typed-lowering.cc
diff --git a/src/compiler/js-typed-lowering.cc b/src/compiler/js-typed-lowering.cc
index 32316bf32395f7c2f103b294840f643303900e06..575b64a48780780ed4986df9eccf5f61b8d10c24 100644
--- a/src/compiler/js-typed-lowering.cc
+++ b/src/compiler/js-typed-lowering.cc
@@ -289,10 +289,7 @@ class JSBinopReduction final {
if (NodeProperties::GetType(node)->Is(Type::NumberOrUndefined())) {
return node;
}
- // TODO(bmeurer): Introduce PlainPrimitiveToNumber here.
- return graph()->NewNode(
- javascript()->ToNumber(), node, jsgraph()->NoContextConstant(),
- lowering_->EmptyFrameState(), graph()->start(), graph()->start());
+ return graph()->NewNode(simplified()->PlainPrimitiveToNumber(), node);
}
Node* ConvertSingleInputToNumber(Node* node, Node* frame_state) {
@@ -869,20 +866,10 @@ Reduction JSTypedLowering::ReduceJSToNumber(Node* node) {
}
Type* const input_type = NodeProperties::GetType(input);
if (input_type->Is(Type::PlainPrimitive())) {
- if (NodeProperties::GetContextInput(node) !=
- jsgraph()->NoContextConstant() ||
- NodeProperties::GetEffectInput(node) != graph()->start() ||
- NodeProperties::GetControlInput(node) != graph()->start()) {
- // JSToNumber(x:plain-primitive,context,effect,control)
- // => JSToNumber(x,no-context,start,start)
- RelaxEffectsAndControls(node);
- NodeProperties::ReplaceContextInput(node, jsgraph()->NoContextConstant());
- NodeProperties::ReplaceControlInput(node, graph()->start());
- NodeProperties::ReplaceEffectInput(node, graph()->start());
- DCHECK_EQ(1, OperatorProperties::GetFrameStateInputCount(node->op()));
- NodeProperties::ReplaceFrameStateInput(node, 0, EmptyFrameState());
- return Changed(node);
- }
+ RelaxEffectsAndControls(node);
+ node->TrimInputCount(1);
+ NodeProperties::ChangeOp(node, simplified()->PlainPrimitiveToNumber());
+ return Changed(node);
}
return NoChange();
}
« no previous file with comments | « src/compiler/js-graph.cc ('k') | src/compiler/opcodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698