Reviewers: Toon Verwaest,
Message:
PTAL.
Description:
Fix bitwise negation on x64
BUG=chromium:285355
Please review this at https://codereview.chromium.org/24037003/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+11, -11 lines):
M src/x64/lithium-codegen-x64.cc
A + test/mjsunit/regress/regress-crbug-285355.js
Index: src/x64/lithium-codegen-x64.cc
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
index
fd9bf1897124c31190ada3ba5b371ff4a38bd428..fa2a632f8c0e5f5b0a87795bca52806c4b38e596
100644
--- a/src/x64/lithium-codegen-x64.cc
+++ b/src/x64/lithium-codegen-x64.cc
@@ -1425,7 +1425,7 @@ void LCodeGen::DoBitI(LBitI* instr) {
break;
case Token::BIT_XOR:
if (right_operand == int32_t(~0)) {
- __ not_(ToRegister(left));
+ __ notl(ToRegister(left));
} else {
__ xorl(ToRegister(left), Immediate(right_operand));
}
Index: test/mjsunit/regress/regress-crbug-285355.js
diff --git a/test/mjsunit/regress/regress-crbug-242870.js
b/test/mjsunit/regress/regress-crbug-285355.js
similarity index 84%
copy from test/mjsunit/regress/regress-crbug-242870.js
copy to test/mjsunit/regress/regress-crbug-285355.js
index
7183375ca811cedc81c870d34e694e98cf727f9b..ebd480a7103f300d726bc66ee1876d9449b05ada
100644
--- a/test/mjsunit/regress/regress-crbug-242870.js
+++ b/test/mjsunit/regress/regress-crbug-285355.js
@@ -27,17 +27,17 @@
// Flags: --allow-natives-syntax
-var non_const_true = true;
-
-function f() {
- return (non_const_true || true && g());
+function inverted_index() {
+ return ~1;
}
-function g() {
- for (;;) {}
+%NeverOptimizeFunction(inverted_index);
+
+function crash(array) {
+ return array[~inverted_index()] = 2;
}
-assertTrue(f());
-assertTrue(f());
-%OptimizeFunctionOnNextCall(f);
-assertTrue(f());
+assertEquals(2, crash(new Array(1)));
+assertEquals(2, crash(new Array(1)));
+%OptimizeFunctionOnNextCall(crash)
+assertEquals(2, crash(new Array(1)));
--
--
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.