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

Unified Diff: src/hydrogen.cc

Issue 863633002: Use signaling NaN for holes in fixed double arrays. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Restore SSE2 Created 5 years, 11 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/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 6d3f9eab6c7d82871bc53d1a77ec2456eab11d89..728169d9db6376201c3072be1a3950a717a159f7 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -2801,12 +2801,10 @@ void HGraphBuilder::BuildFillElementsWithHole(HValue* elements,
HValue* to) {
// Fast elements kinds need to be initialized in case statements below cause a
// garbage collection.
- Factory* factory = isolate()->factory();
- double nan_double = FixedDoubleArray::hole_nan_as_double();
HValue* hole = IsFastSmiOrObjectElementsKind(elements_kind)
- ? Add<HConstant>(factory->the_hole_value())
- : Add<HConstant>(nan_double);
+ ? graph()->GetConstantHole()
+ : Add<HConstant>(HConstant::kHoleNaN);
// Since we're about to store a hole value, the store instruction below must
// assume an elements kind that supports heap object values.
@@ -2904,8 +2902,8 @@ void HGraphBuilder::BuildCopyElements(HValue* from_elements,
if_hole.If<HCompareHoleAndBranch>(element);
if_hole.Then();
HConstant* hole_constant = IsFastDoubleElementsKind(to_elements_kind)
- ? Add<HConstant>(FixedDoubleArray::hole_nan_as_double())
- : graph()->GetConstantHole();
+ ? Add<HConstant>(HConstant::kHoleNaN)
+ : graph()->GetConstantHole();
Add<HStoreKeyed>(to_elements, key, hole_constant, kind);
if_hole.Else();
HStoreKeyed* store = Add<HStoreKeyed>(to_elements, key, element, kind);
@@ -8379,11 +8377,9 @@ bool HOptimizedGraphBuilder::TryInlineBuiltinMethodCall(
reduced_length = AddUncasted<HSub>(length, graph()->GetConstant1());
result = AddElementAccess(elements, reduced_length, NULL,
bounds_check, elements_kind, LOAD);
- Factory* factory = isolate()->factory();
- double nan_double = FixedDoubleArray::hole_nan_as_double();
HValue* hole = IsFastSmiOrObjectElementsKind(elements_kind)
- ? Add<HConstant>(factory->the_hole_value())
- : Add<HConstant>(nan_double);
+ ? graph()->GetConstantHole()
+ : Add<HConstant>(HConstant::kHoleNaN);
if (IsFastSmiOrObjectElementsKind(elements_kind)) {
elements_kind = FAST_HOLEY_ELEMENTS;
}
@@ -8545,8 +8541,8 @@ bool HOptimizedGraphBuilder::TryInlineBuiltinMethodCall(
// Put a hole at the end.
HValue* hole = IsFastSmiOrObjectElementsKind(kind)
- ? Add<HConstant>(isolate()->factory()->the_hole_value())
- : Add<HConstant>(FixedDoubleArray::hole_nan_as_double());
+ ? graph()->GetConstantHole()
+ : Add<HConstant>(HConstant::kHoleNaN);
if (IsFastSmiOrObjectElementsKind(kind)) kind = FAST_HOLEY_ELEMENTS;
Add<HStoreKeyed>(
elements, new_length, hole, kind, INITIALIZING_STORE);
« no previous file with comments | « src/globals.h ('k') | src/hydrogen-instructions.h » ('j') | src/hydrogen-instructions.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698