[webkit-changes] cvs commit: JavaScriptCore/tests/mozilla
jsDriver.pl
Darin
darin at opensource.apple.com
Sat Sep 10 11:24:44 PDT 2005
darin 05/09/10 11:24:44
Modified: . ChangeLog
kjs internal.cpp simple_number.h value.cpp
tests/mozilla jsDriver.pl
Log:
Windows changes by Krzysztof Kowalczyk <kkowalczyk at gmail.com>.
- fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4870
win portability: fix IS_NEGATIVE_ZERO macro in simple_number.h
* kjs/simple_number.h:
(KJS::isNegativeZero): Added. Inline function. Has a case for Windows that
uses _fpclass and a case for other platforms that uses signbit.
(KJS::SimpleNumber::fits): Use inline isNegativeZero instead of macro IS_NEGATIVE_ZERO.
* kjs/internal.cpp: Remove definition of now-unneeded negZero global.
* kjs/value.cpp: Touched the file because Xcode didn't know it needed to
recompile it.
- improved test engine
* tests/mozilla/jsDriver.pl: Sort tests in numeric order instead of using
a plain-ASCII sort; now test 33 will be after test 5 in any given set of
numbered tests.
Revision Changes Path
1.821 +23 -0 JavaScriptCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/JavaScriptCore/ChangeLog,v
retrieving revision 1.820
retrieving revision 1.821
diff -u -r1.820 -r1.821
--- ChangeLog 9 Sep 2005 01:19:17 -0000 1.820
+++ ChangeLog 10 Sep 2005 18:24:42 -0000 1.821
@@ -1,3 +1,26 @@
+2005-09-10 Darin Adler <darin at apple.com>
+
+ Windows changes by Krzysztof Kowalczyk <kkowalczyk at gmail.com>.
+
+ - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4870
+ win portability: fix IS_NEGATIVE_ZERO macro in simple_number.h
+
+ * kjs/simple_number.h:
+ (KJS::isNegativeZero): Added. Inline function. Has a case for Windows that
+ uses _fpclass and a case for other platforms that uses signbit.
+ (KJS::SimpleNumber::fits): Use inline isNegativeZero instead of macro IS_NEGATIVE_ZERO.
+
+ * kjs/internal.cpp: Remove definition of now-unneeded negZero global.
+
+ * kjs/value.cpp: Touched the file because Xcode didn't know it needed to
+ recompile it.
+
+ - improved test engine
+
+ * tests/mozilla/jsDriver.pl: Sort tests in numeric order instead of using
+ a plain-ASCII sort; now test 33 will be after test 5 in any given set of
+ numbered tests.
+
2005-09-08 Darin Adler <darin at apple.com>
- fixed overloaded versions of throwError so that they substitute *all*
1.69 +0 -2 JavaScriptCore/kjs/internal.cpp
Index: internal.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/internal.cpp,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -r1.68 -r1.69
--- internal.cpp 4 Sep 2005 01:18:11 -0000 1.68
+++ internal.cpp 10 Sep 2005 18:24:43 -0000 1.69
@@ -264,8 +264,6 @@
return (double)uint32 == val;
}
-double SimpleNumber::negZero = -0.0;
-
// ------------------------------ LabelStack -----------------------------------
bool LabelStack::push(const Identifier &id)
1.12 +15 -8 JavaScriptCore/kjs/simple_number.h
Index: simple_number.h
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/simple_number.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- simple_number.h 14 Jul 2005 18:27:03 -0000 1.11
+++ simple_number.h 10 Sep 2005 18:24:43 -0000 1.12
@@ -1,4 +1,3 @@
-// -*- c-basic-offset: 2 -*-
/*
* This file is part of the KDE libraries
* Copyright (C) 2003 Apple Computer, Inc
@@ -20,17 +19,26 @@
*
*/
-#ifndef _KJS_SIMPLE_NUMBER_H_
-#define _KJS_SIMPLE_NUMBER_H_
+#ifndef KJS_SIMPLE_NUMBER_H
+#define KJS_SIMPLE_NUMBER_H
+#include <float.h>
#include <math.h>
#include <string.h>
-#define IS_NEGATIVE_ZERO(num) (num == 0.0 && !memcmp(&num, &SimpleNumber::negZero, sizeof(double)))
-
namespace KJS {
+
class ValueImp;
+ inline bool isNegativeZero(double num)
+ {
+#if WIN32
+ return _fpclass(num) == _FPCLASS_NZ;
+#else
+ return num == -0.0 && signbit(num);
+#endif
+ }
+
class SimpleNumber {
public:
enum { tag = 1, shift = 2, mask = (1 << shift) - 1, sign = 1L << (sizeof(long) * 8 - 1 ), max = (1L << ((sizeof(long) * 8 - 1) - shift)) - 1, min = -max - 1, imax = (1L << ((sizeof(int) * 8 - 1) - shift)) - 1, imin = -imax - 1 };
@@ -43,11 +51,10 @@
static inline bool fits(long i) { return i <= max && i >= min; }
static inline bool fits(unsigned long i) { return i <= (unsigned)max; }
static inline bool integerFits(double d) { return !(d < min || d > max); }
- static inline bool fits(double d) { return d >= min && d <= max && d == (double)(long)d && !IS_NEGATIVE_ZERO(d); }
+ static inline bool fits(double d) { return d >= min && d <= max && d == (double)(long)d && !isNegativeZero(d); }
static inline ValueImp *make(long i) { return (ValueImp *)((i << shift) | tag); }
-
- static double negZero;
};
+
}
#endif
1.28 +1 -1 JavaScriptCore/kjs/value.cpp
Index: value.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/value.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- value.cpp 8 Aug 2005 04:07:29 -0000 1.27
+++ value.cpp 10 Sep 2005 18:24:43 -0000 1.28
@@ -45,7 +45,7 @@
AllocatedValueImp *ConstantValues::jsFalse = NULL;
AllocatedValueImp *ConstantValues::NaN = NULL;
-static const double D16 = 65536;
+static const double D16 = 65536.0;
static const double D32 = 4294967296.0;
void *AllocatedValueImp::operator new(size_t size)
1.6 +19 -2 JavaScriptCore/tests/mozilla/jsDriver.pl
Index: jsDriver.pl
===================================================================
RCS file: /cvs/root/JavaScriptCore/tests/mozilla/jsDriver.pl,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- jsDriver.pl 23 Jul 2005 00:34:51 -0000 1.5
+++ jsDriver.pl 10 Sep 2005 18:24:44 -0000 1.6
@@ -1172,6 +1172,23 @@
}
}
+sub numericcmp($$)
+{
+ my ($aa, $bb) = @_;
+
+ my @a = split /(\d+)/, $aa;
+ my @b = split /(\d+)/, $bb;
+
+ while (@a && @b) {
+ my $a = shift @a;
+ my $b = shift @b;
+ return $a <=> $b if $a =~ /^\d/ && $b =~ /^\d/ && $a != $b;
+ return $a cmp $b if $a ne $b;
+ }
+
+ return @a <=> @b;
+}
+
#
# given a directory, return an array of all subdirectories
#
@@ -1189,7 +1206,7 @@
}
}
opendir (DIR, $dir) || die ("couldn't open directory $dir: $!");
- my @testdir_contents = readdir(DIR);
+ my @testdir_contents = sort numericcmp readdir(DIR);
closedir(DIR);
foreach (@testdir_contents) {
@@ -1210,7 +1227,7 @@
opendir (TEST_SUBDIR, $test_subdir) || die ("couldn't open directory " .
"$test_subdir: $!");
- @subdir_files = readdir(TEST_SUBDIR);
+ @subdir_files = sort numericcmp readdir(TEST_SUBDIR);
closedir( TEST_SUBDIR );
foreach (@subdir_files) {
More information about the webkit-changes
mailing list