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

Unified Diff: src/compiler/js-native-context-specialization.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-global-object-specialization.cc ('k') | src/compiler/node-matchers.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-native-context-specialization.cc
diff --git a/src/compiler/js-native-context-specialization.cc b/src/compiler/js-native-context-specialization.cc
index 89d16a7d0048135feb81b77304c3ea29bf570357..408a0166208018fd9d7ebd32b85aee2d614325a0 100644
--- a/src/compiler/js-native-context-specialization.cc
+++ b/src/compiler/js-native-context-specialization.cc
@@ -80,7 +80,6 @@ Reduction JSNativeContextSpecialization::ReduceNamedAccess(
Node* receiver = NodeProperties::GetValueInput(node, 0);
Node* effect = NodeProperties::GetEffectInput(node);
Node* control = NodeProperties::GetControlInput(node);
- Node* frame_state = NodeProperties::FindFrameStateBefore(node);
// Not much we can do if deoptimization support is disabled.
if (!(flags() & kDeoptimizationEnabled)) return NoChange();
@@ -111,8 +110,7 @@ Reduction JSNativeContextSpecialization::ReduceNamedAccess(
if (index != nullptr) {
Node* check = graph()->NewNode(simplified()->ReferenceEqual(Type::Name()),
index, jsgraph()->HeapConstant(name));
- control = effect = graph()->NewNode(common()->DeoptimizeUnless(), check,
- frame_state, effect, control);
+ effect = graph()->NewNode(simplified()->CheckIf(), check, effect, control);
}
// Check if {receiver} may be a number.
@@ -158,9 +156,9 @@ Reduction JSNativeContextSpecialization::ReduceNamedAccess(
if (receiver_type->Is(Type::String())) {
Node* check = graph()->NewNode(simplified()->ObjectIsString(), receiver);
if (j == access_infos.size() - 1) {
- this_control = this_effect =
- graph()->NewNode(common()->DeoptimizeUnless(), check, frame_state,
- this_effect, fallthrough_control);
+ this_effect = graph()->NewNode(simplified()->CheckIf(), check,
+ this_effect, fallthrough_control);
+ this_control = fallthrough_control;
fallthrough_control = nullptr;
} else {
Node* branch =
@@ -181,11 +179,10 @@ Reduction JSNativeContextSpecialization::ReduceNamedAccess(
graph()->NewNode(simplified()->ReferenceEqual(Type::Internal()),
receiver_map, jsgraph()->Constant(map));
if (--num_classes == 0 && j == access_infos.size() - 1) {
- Node* deoptimize =
- graph()->NewNode(common()->DeoptimizeUnless(), check, frame_state,
- this_effect, fallthrough_control);
- this_controls.push_back(deoptimize);
- this_effects.push_back(deoptimize);
+ check = graph()->NewNode(simplified()->CheckIf(), check, this_effect,
+ fallthrough_control);
+ this_controls.push_back(fallthrough_control);
+ this_effects.push_back(check);
fallthrough_control = nullptr;
} else {
Node* branch =
@@ -237,9 +234,8 @@ Reduction JSNativeContextSpecialization::ReduceNamedAccess(
if (access_mode == AccessMode::kStore) {
Node* check = graph()->NewNode(
simplified()->ReferenceEqual(Type::Tagged()), value, this_value);
- this_control = this_effect =
- graph()->NewNode(common()->DeoptimizeUnless(), check, frame_state,
- this_effect, this_control);
+ this_effect = graph()->NewNode(simplified()->CheckIf(), check,
+ this_effect, this_control);
}
} else {
DCHECK(access_info.IsDataField());
@@ -331,9 +327,8 @@ Reduction JSNativeContextSpecialization::ReduceNamedAccess(
Node* check = graph()->NewNode(
simplified()->ReferenceEqual(Type::Internal()), this_value_map,
jsgraph()->Constant(field_type->Classes().Current()));
- this_control = this_effect =
- graph()->NewNode(common()->DeoptimizeUnless(), check,
- frame_state, this_effect, this_control);
+ this_effect = graph()->NewNode(simplified()->CheckIf(), check,
+ this_effect, this_control);
} else {
DCHECK_EQ(0, field_type->NumClasses());
}
@@ -564,11 +559,10 @@ Reduction JSNativeContextSpecialization::ReduceElementAccess(
// TODO(turbofan): This is ugly as hell! We should probably introduce
// macro-ish operators for property access that encapsulate this whole
// mess.
- Node* deoptimize =
- graph()->NewNode(common()->DeoptimizeUnless(), check, frame_state,
- effect, fallthrough_control);
- this_controls.push_back(deoptimize);
- this_effects.push_back(deoptimize);
+ check = graph()->NewNode(simplified()->CheckIf(), check, effect,
+ fallthrough_control);
+ this_controls.push_back(fallthrough_control);
+ this_effects.push_back(check);
fallthrough_control = nullptr;
} else {
Node* branch =
@@ -593,9 +587,10 @@ Reduction JSNativeContextSpecialization::ReduceElementAccess(
simplified()->ReferenceEqual(Type::Any()), receiver_map,
jsgraph()->HeapConstant(transition_source));
if (--num_transitions == 0 && j == access_infos.size() - 1) {
- transition_control = transition_effect =
- graph()->NewNode(common()->DeoptimizeUnless(), check, frame_state,
+ transition_effect =
+ graph()->NewNode(simplified()->CheckIf(), check,
transition_effect, fallthrough_control);
+ transition_control = fallthrough_control;
fallthrough_control = nullptr;
} else {
Node* branch =
@@ -680,9 +675,8 @@ Reduction JSNativeContextSpecialization::ReduceElementAccess(
Node* check = graph()->NewNode(
simplified()->ReferenceEqual(Type::Any()), this_elements_map,
jsgraph()->HeapConstant(factory()->fixed_array_map()));
- this_control = this_effect =
- graph()->NewNode(common()->DeoptimizeUnless(), check, frame_state,
- this_effect, this_control);
+ this_effect = graph()->NewNode(simplified()->CheckIf(), check,
+ this_effect, this_control);
}
// Load the length of the {receiver}.
« no previous file with comments | « src/compiler/js-global-object-specialization.cc ('k') | src/compiler/node-matchers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698