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

Unified Diff: src/compiler/js-native-context-specialization.cc

Issue 2065953002: [turbofan] Introduce dedicated NumberConvertHoleNaN 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 | « no previous file | src/compiler/js-typed-lowering.cc » ('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 03cab87d4d8e895cbd2f10374eb0e554d1f63107..c90f9cba11204f21735da2c64da9e04443f64db9 100644
--- a/src/compiler/js-native-context-specialization.cc
+++ b/src/compiler/js-native-context-specialization.cc
@@ -790,9 +790,6 @@ Reduction JSNativeContextSpecialization::ReduceElementAccess(
this_value = graph()->NewNode(simplified()->TypeGuard(element_type),
this_value, this_control);
} else if (elements_kind == FAST_HOLEY_DOUBLE_ELEMENTS) {
- // Perform the hole check on the result.
- Node* check =
- graph()->NewNode(simplified()->NumberIsHoleNaN(), this_value);
// Check if we are allowed to return the hole directly.
Type* initial_holey_array_type = Type::Class(
handle(isolate()->get_initial_js_array_map(elements_kind)),
@@ -804,11 +801,12 @@ Reduction JSNativeContextSpecialization::ReduceElementAccess(
isolate()->initial_object_prototype());
dependencies()->AssumePropertyCell(factory()->array_protector());
// Turn the hole into undefined.
- this_value = graph()->NewNode(
- common()->Select(MachineRepresentation::kTagged,
- BranchHint::kFalse),
- check, jsgraph()->UndefinedConstant(), this_value);
+ this_value = graph()->NewNode(simplified()->NumberConvertHoleNaN(),
+ this_value);
} else {
+ // Perform the hole check on the result.
+ Node* check =
+ graph()->NewNode(simplified()->NumberIsHoleNaN(), this_value);
// Deoptimize in case of the hole.
this_control = this_effect =
graph()->NewNode(common()->DeoptimizeIf(), check, frame_state,
« no previous file with comments | « no previous file | src/compiler/js-typed-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698