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

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

Issue 2236443004: [turbofan] Introduce a dedicated ConvertTaggedHoleToUndefined operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix verify heap. Created 4 years, 4 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/effect-control-linearizer.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-native-context-specialization.cc
diff --git a/src/compiler/js-native-context-specialization.cc b/src/compiler/js-native-context-specialization.cc
index 0f6724ba2811af3da1e43c22cb565a2a486e93f6..28625c87f6b560d3bea5a1caf785d1c82d65a1c2 100644
--- a/src/compiler/js-native-context-specialization.cc
+++ b/src/compiler/js-native-context-specialization.cc
@@ -1158,7 +1158,7 @@ JSNativeContextSpecialization::BuildElementAccess(
}
// Compute the element access.
- Type* element_type = Type::Any();
+ Type* element_type = Type::NonInternal();
MachineType element_machine_type = MachineType::AnyTagged();
if (IsFastDoubleElementsKind(elements_kind)) {
element_type = Type::Number();
@@ -1176,10 +1176,8 @@ JSNativeContextSpecialization::BuildElementAccess(
// of holey backing stores.
if (elements_kind == FAST_HOLEY_ELEMENTS ||
elements_kind == FAST_HOLEY_SMI_ELEMENTS) {
- element_access.type = Type::Union(
- element_type,
- Type::Constant(factory()->the_hole_value(), graph()->zone()),
- graph()->zone());
+ element_access.type =
+ Type::Union(element_type, Type::Hole(), graph()->zone());
}
// Perform the actual backing store access.
value = effect =
@@ -1189,15 +1187,16 @@ JSNativeContextSpecialization::BuildElementAccess(
// the hole to undefined if possible, or deoptimizing otherwise.
if (elements_kind == FAST_HOLEY_ELEMENTS ||
elements_kind == FAST_HOLEY_SMI_ELEMENTS) {
- // Perform the hole check on the result.
- CheckTaggedHoleMode mode = CheckTaggedHoleMode::kNeverReturnHole;
// Check if we are allowed to turn the hole into undefined.
if (CanTreatHoleAsUndefined(receiver_maps, native_context)) {
// Turn the hole into undefined.
- mode = CheckTaggedHoleMode::kConvertHoleToUndefined;
+ value = graph()->NewNode(simplified()->ConvertTaggedHoleToUndefined(),
+ value);
+ } else {
+ // Bailout if we see the hole.
+ value = effect = graph()->NewNode(simplified()->CheckTaggedHole(),
+ value, effect, control);
}
- value = effect = graph()->NewNode(simplified()->CheckTaggedHole(mode),
- value, effect, control);
} else if (elements_kind == FAST_HOLEY_DOUBLE_ELEMENTS) {
// Perform the hole check on the result.
CheckFloat64HoleMode mode = CheckFloat64HoleMode::kNeverReturnHole;
« no previous file with comments | « src/compiler/effect-control-linearizer.cc ('k') | src/compiler/opcodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698