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

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

Issue 2814013003: [turbofan] Properly represent the float64 hole. (Closed)
Patch Set: Make sure the_hole has the correct hole NaN bit pattern on Win32. Created 3 years, 8 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
Index: src/compiler/js-create-lowering.cc
diff --git a/src/compiler/js-create-lowering.cc b/src/compiler/js-create-lowering.cc
index 19418c7aad0660a841e0d65fbba74047ffa55d6f..432b5c620b5a15cc9559af1f9d7436ca39ffca8b 100644
--- a/src/compiler/js-create-lowering.cc
+++ b/src/compiler/js-create-lowering.cc
@@ -1103,17 +1103,7 @@ Node* JSCreateLowering::AllocateElements(Node* effect, Node* control,
ElementAccess access = IsFastDoubleElementsKind(elements_kind)
? AccessBuilder::ForFixedDoubleArrayElement()
: AccessBuilder::ForFixedArrayElement();
- Node* value;
- if (IsFastDoubleElementsKind(elements_kind)) {
- // Load the hole NaN pattern from the canonical location.
- value = effect = graph()->NewNode(
- simplified()->LoadField(AccessBuilder::ForExternalDoubleValue()),
- jsgraph()->ExternalConstant(
- ExternalReference::address_of_the_hole_nan()),
- effect, control);
- } else {
- value = jsgraph()->TheHoleConstant();
- }
+ Node* value = jsgraph()->TheHoleConstant();
// Actually allocate the backing store.
AllocationBuilder a(jsgraph(), effect, control);
@@ -1261,18 +1251,9 @@ Node* JSCreateLowering::AllocateFastLiteralElements(
if (elements_map->instance_type() == FIXED_DOUBLE_ARRAY_TYPE) {
Handle<FixedDoubleArray> elements =
Handle<FixedDoubleArray>::cast(boilerplate_elements);
- Node* the_hole_value = nullptr;
for (int i = 0; i < elements_length; ++i) {
if (elements->is_the_hole(i)) {
- if (the_hole_value == nullptr) {
- // Load the hole NaN pattern from the canonical location.
- the_hole_value = effect = graph()->NewNode(
- simplified()->LoadField(AccessBuilder::ForExternalDoubleValue()),
- jsgraph()->ExternalConstant(
- ExternalReference::address_of_the_hole_nan()),
- effect, control);
- }
- elements_values[i] = the_hole_value;
+ elements_values[i] = jsgraph()->TheHoleConstant();
} else {
elements_values[i] = jsgraph()->Constant(elements->get_scalar(i));
}
« no previous file with comments | « no previous file | src/compiler/js-native-context-specialization.cc » ('j') | src/compiler/simplified-lowering.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698