Reviewers: mvstanton,
Description:
Do not emit double values at their use sites.
Revert part of r14179. From the regression test's comment:
Currently, the gap resolver doesn't handle moves from a ConstantOperand to a
DoubleRegister, but these kind of moves appeared when HConstant::EmitAtUses
was changed to allow special double values (-0, NaN, hole). So we should
either enhance the gap resolver or make sure that such moves don't happen.
BUG=chrome:234101
Please review this at https://codereview.chromium.org/14429002/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/hydrogen-instructions.h
A + test/mjsunit/regress/regress-234101.js
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index
e3b3449e3c1390dcb13132d0e43b9c4c5b8c4a7e..fb1d2397e026203ed67dd127b622cf9b66621fd2
100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -3277,9 +3277,7 @@ class HConstant: public HTemplateInstruction<0> {
return has_int32_value_;
}
- virtual bool EmitAtUses() {
- return !representation().IsDouble() || IsSpecialDouble();
- }
+ virtual bool EmitAtUses() { return !representation().IsDouble(); }
virtual void PrintDataTo(StringStream* stream);
virtual HType CalculateInferredType();
bool IsInteger() { return handle()->IsSmi(); }
Index: test/mjsunit/regress/regress-234101.js
diff --git a/test/mjsunit/regress/regress-2499.js
b/test/mjsunit/regress/regress-234101.js
similarity index 80%
copy from test/mjsunit/regress/regress-2499.js
copy to test/mjsunit/regress/regress-234101.js
index
52aad874db6fcdc89f5ee1ae4db45304e64b0e77..74228dfabe532efdce2d2cd31736959eaff4349b
100644
--- a/test/mjsunit/regress/regress-2499.js
+++ b/test/mjsunit/regress/regress-234101.js
@@ -27,14 +27,16 @@
// Flags: --allow-natives-syntax
-function foo(word, nBits) {
- return (word[1] >>> nBits) | (word[0] << (32 - nBits));
-}
+// Currently, the gap resolver doesn't handle moves from a ConstantOperand
to a
+// DoubleRegister, but these kind of moves appeared when
HConstant::EmitAtUses
+// was changed to allow special double values (-0, NaN, hole). So we should
+// either enhance the gap resolver or make sure that such moves don't
happen.
-word = [0x1001, 0];
+function foo(x) {
+ return (x ? NaN : 0.2) + 0.1;
+}
-var expected = foo(word, 1);
-foo(word, 1);
+foo(false);
+foo(false);
%OptimizeFunctionOnNextCall(foo);
-var optimized = foo(word, 1);
-assertEquals(expected, optimized)
+foo(false);
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.