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

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

Issue 2820603002: Revert of Merged: Squashed multiple commits. (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | src/compiler/js-native-context-specialization.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-create-lowering.cc
diff --git a/src/compiler/js-create-lowering.cc b/src/compiler/js-create-lowering.cc
index 80105aebb422384426baf86f746871c018fb6ce7..f3ceb2b0c0858348eebb2930c22afb1d305ad8ed 100644
--- a/src/compiler/js-create-lowering.cc
+++ b/src/compiler/js-create-lowering.cc
@@ -1097,7 +1097,17 @@
ElementAccess access = IsFastDoubleElementsKind(elements_kind)
? AccessBuilder::ForFixedDoubleArrayElement()
: AccessBuilder::ForFixedArrayElement();
- Node* value = jsgraph()->TheHoleConstant();
+ 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();
+ }
// Actually allocate the backing store.
AllocationBuilder a(jsgraph(), effect, control);
@@ -1245,9 +1255,18 @@
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)) {
- elements_values[i] = jsgraph()->TheHoleConstant();
+ 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;
} 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698