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

Unified Diff: src/compiler/js-call-reducer.cc

Issue 2115513002: [turbofan] Introduce CheckIf simplified operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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-call-reducer.h ('k') | src/compiler/js-global-object-specialization.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-call-reducer.cc
diff --git a/src/compiler/js-call-reducer.cc b/src/compiler/js-call-reducer.cc
index f4b0d7b603d4ed3ac1bac47e7a1e890d9606c2f2..6c71983f8b9ec8c2862146124efbd6e92fd04d21 100644
--- a/src/compiler/js-call-reducer.cc
+++ b/src/compiler/js-call-reducer.cc
@@ -6,6 +6,7 @@
#include "src/compiler/js-graph.h"
#include "src/compiler/node-matchers.h"
+#include "src/compiler/simplified-operator.h"
#include "src/objects-inl.h"
#include "src/type-feedback-vector-inl.h"
@@ -220,7 +221,6 @@ Reduction JSCallReducer::ReduceJSCallFunction(Node* node) {
Node* context = NodeProperties::GetContextInput(node);
Node* control = NodeProperties::GetControlInput(node);
Node* effect = NodeProperties::GetEffectInput(node);
- Node* frame_state = NodeProperties::FindFrameStateBefore(node);
// Try to specialize JSCallFunction {node}s with constant {target}s.
HeapObjectMatcher m(target);
@@ -323,16 +323,13 @@ Reduction JSCallReducer::ReduceJSCallFunction(Node* node) {
}
// Check that the {target} is still the {array_function}.
- Node* check = graph()->NewNode(
- javascript()->StrictEqual(CompareOperationHints::Any()), target,
- array_function, context);
- control = effect = graph()->NewNode(common()->DeoptimizeUnless(), check,
- frame_state, effect, control);
+ Node* check = graph()->NewNode(simplified()->ReferenceEqual(Type::Any()),
+ target, array_function);
+ effect = graph()->NewNode(simplified()->CheckIf(), check, effect, control);
// Turn the {node} into a {JSCreateArray} call.
NodeProperties::ReplaceValueInput(node, array_function, 0);
NodeProperties::ReplaceEffectInput(node, effect);
- NodeProperties::ReplaceControlInput(node, control);
return ReduceArrayConstructor(node);
} else if (feedback->IsWeakCell()) {
Handle<WeakCell> cell = Handle<WeakCell>::cast(feedback);
@@ -341,16 +338,14 @@ Reduction JSCallReducer::ReduceJSCallFunction(Node* node) {
jsgraph()->Constant(handle(cell->value(), isolate()));
// Check that the {target} is still the {target_function}.
- Node* check = graph()->NewNode(
- javascript()->StrictEqual(CompareOperationHints::Any()), target,
- target_function, context);
- control = effect = graph()->NewNode(common()->DeoptimizeUnless(), check,
- frame_state, effect, control);
+ Node* check = graph()->NewNode(simplified()->ReferenceEqual(Type::Any()),
+ target, target_function);
+ effect =
+ graph()->NewNode(simplified()->CheckIf(), check, effect, control);
// Specialize the JSCallFunction node to the {target_function}.
NodeProperties::ReplaceValueInput(node, target_function, 0);
NodeProperties::ReplaceEffectInput(node, effect);
- NodeProperties::ReplaceControlInput(node, control);
// Try to further reduce the JSCallFunction {node}.
Reduction const reduction = ReduceJSCallFunction(node);
@@ -371,7 +366,6 @@ Reduction JSCallReducer::ReduceJSCallConstruct(Node* node) {
Node* context = NodeProperties::GetContextInput(node);
Node* effect = NodeProperties::GetEffectInput(node);
Node* control = NodeProperties::GetControlInput(node);
- Node* frame_state = NodeProperties::FindFrameStateBefore(node);
// Try to specialize JSCallConstruct {node}s with constant {target}s.
HeapObjectMatcher m(target);
@@ -445,15 +439,12 @@ Reduction JSCallReducer::ReduceJSCallConstruct(Node* node) {
}
// Check that the {target} is still the {array_function}.
- Node* check = graph()->NewNode(
- javascript()->StrictEqual(CompareOperationHints::Any()), target,
- array_function, context);
- control = effect = graph()->NewNode(common()->DeoptimizeUnless(), check,
- frame_state, effect, control);
+ Node* check = graph()->NewNode(simplified()->ReferenceEqual(Type::Any()),
+ target, array_function);
+ effect = graph()->NewNode(simplified()->CheckIf(), check, effect, control);
// Turn the {node} into a {JSCreateArray} call.
NodeProperties::ReplaceEffectInput(node, effect);
- NodeProperties::ReplaceControlInput(node, control);
for (int i = arity; i > 0; --i) {
NodeProperties::ReplaceValueInput(
node, NodeProperties::GetValueInput(node, i), i + 1);
@@ -468,16 +459,14 @@ Reduction JSCallReducer::ReduceJSCallConstruct(Node* node) {
jsgraph()->Constant(handle(cell->value(), isolate()));
// Check that the {target} is still the {target_function}.
- Node* check = graph()->NewNode(
- javascript()->StrictEqual(CompareOperationHints::Any()), target,
- target_function, context);
- control = effect = graph()->NewNode(common()->DeoptimizeUnless(), check,
- frame_state, effect, control);
+ Node* check = graph()->NewNode(simplified()->ReferenceEqual(Type::Any()),
+ target, target_function);
+ effect =
+ graph()->NewNode(simplified()->CheckIf(), check, effect, control);
// Specialize the JSCallConstruct node to the {target_function}.
NodeProperties::ReplaceValueInput(node, target_function, 0);
NodeProperties::ReplaceEffectInput(node, effect);
- NodeProperties::ReplaceControlInput(node, control);
if (target == new_target) {
NodeProperties::ReplaceValueInput(node, target_function, arity + 1);
}
@@ -514,6 +503,10 @@ JSOperatorBuilder* JSCallReducer::javascript() const {
return jsgraph()->javascript();
}
+SimplifiedOperatorBuilder* JSCallReducer::simplified() const {
+ return jsgraph()->simplified();
+}
+
} // namespace compiler
} // namespace internal
} // namespace v8
« no previous file with comments | « src/compiler/js-call-reducer.h ('k') | src/compiler/js-global-object-specialization.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698