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

Unified Diff: test/mjsunit/bit-not.js

Issue 524059: Speed up compares with characters ie single-character strings.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 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
« no previous file with comments | « src/x64/ic-x64.cc ('k') | test/mjsunit/compare-character.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/bit-not.js
===================================================================
--- test/mjsunit/bit-not.js (revision 3561)
+++ test/mjsunit/bit-not.js (working copy)
@@ -25,43 +25,43 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-function testBitNot(x) {
+function testBitNot(x, name) {
// The VM constant folds so we use that to check the result.
var expected = eval("~(" + x + ")");
var actual = ~x;
- assertEquals(expected, actual, "x: " + x);
+ assertEquals(expected, actual, "x: " + name);
// Test the path where we can overwrite the result. Use -
// to avoid concatenating strings.
expected = eval("~(" + x + " - 0.01)");
actual = ~(x - 0.01);
- assertEquals(expected, actual, "x - 0.01: " + x);
+ assertEquals(expected, actual, "x - 0.01: " + name);
}
-testBitNot(0);
-testBitNot(1);
-testBitNot(-1);
-testBitNot(100);
-testBitNot(0x40000000);
-testBitNot(0x7fffffff);
-testBitNot(0x80000000);
+testBitNot(0, 0);
+testBitNot(1, 1);
+testBitNot(-1, 1);
+testBitNot(100, 100);
+testBitNot(0x40000000, "0x40000000");
+testBitNot(0x7fffffff, "0x7fffffff");
+testBitNot(0x80000000, "0x80000000");
-testBitNot(2.2);
-testBitNot(-2.3);
-testBitNot(Infinity);
-testBitNot(NaN);
-testBitNot(-Infinity);
-testBitNot(0x40000000 + 0.12345);
-testBitNot(0x40000000 - 0.12345);
-testBitNot(0x7fffffff + 0.12345);
-testBitNot(0x7fffffff - 0.12345);
-testBitNot(0x80000000 + 0.12345);
-testBitNot(0x80000000 - 0.12345);
+testBitNot(2.2, 2.2);
+testBitNot(-2.3, -2.3);
+testBitNot(Infinity, "Infinity");
+testBitNot(NaN, "NaN");
+testBitNot(-Infinity, "-Infinity");
+testBitNot(0x40000000 + 0.12345, "float1");
+testBitNot(0x40000000 - 0.12345, "float2");
+testBitNot(0x7fffffff + 0.12345, "float3");
+testBitNot(0x7fffffff - 0.12345, "float4");
+testBitNot(0x80000000 + 0.12345, "float5");
+testBitNot(0x80000000 - 0.12345, "float6");
-testBitNot("0");
-testBitNot("2.3");
-testBitNot("-9.4");
+testBitNot("0", "string0");
+testBitNot("2.3", "string2.3");
+testBitNot("-9.4", "string-9.4");
// Try to test that we can deal with allocation failures in
« no previous file with comments | « src/x64/ic-x64.cc ('k') | test/mjsunit/compare-character.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698