зеркало из https://github.com/mozilla/gecko-dev.git
Backout 61d052e202c8 (bug 647367) due to Windows bustage.
This commit is contained in:
Родитель
231d28d084
Коммит
e3deb8235d
|
@ -17,9 +17,7 @@ include $(DEPTH)/config/autoconf.mk
|
|||
MODULE = jsdebug
|
||||
LIBRARY_NAME = jsd
|
||||
DIRS = idl
|
||||
CPPSRCS = \
|
||||
jsd_xpc.cpp \
|
||||
jshash.cpp
|
||||
CPPSRCS = jsd_xpc.cpp
|
||||
IS_COMPONENT = 1
|
||||
LIBXUL_LIBRARY = 1
|
||||
|
||||
|
|
|
@ -82,6 +82,7 @@ CPPSRCS = \
|
|||
jsfun.cpp \
|
||||
jsgc.cpp \
|
||||
jscrashreport.cpp \
|
||||
jshash.cpp \
|
||||
jsinfer.cpp \
|
||||
jsinterp.cpp \
|
||||
jsiter.cpp \
|
||||
|
@ -160,6 +161,7 @@ INSTALLED_HEADERS = \
|
|||
jsdhash.h \
|
||||
jsfriendapi.h \
|
||||
jsgc.h \
|
||||
jshash.h \
|
||||
jslock.h \
|
||||
json.h \
|
||||
jsproxy.h \
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include "jstypes.h"
|
||||
#include "jsutil.h"
|
||||
#include "jshash.h"
|
||||
#include "jsprf.h"
|
||||
#include "jsapi.h"
|
||||
#include "jsatom.h"
|
||||
|
@ -42,6 +43,12 @@ using namespace js::gc;
|
|||
|
||||
const size_t JSAtomState::commonAtomsOffset = offsetof(JSAtomState, emptyAtom);
|
||||
|
||||
/*
|
||||
* ATOM_HASH assumes that JSHashNumber is 32-bit even on 64-bit systems.
|
||||
*/
|
||||
JS_STATIC_ASSERT(sizeof(JSHashNumber) == 4);
|
||||
JS_STATIC_ASSERT(sizeof(JSAtom *) == JS_BYTES_PER_WORD);
|
||||
|
||||
const char *
|
||||
js_AtomToPrintableString(JSContext *cx, JSAtom *atom, JSAutoByteString *bytes)
|
||||
{
|
||||
|
|
|
@ -12,12 +12,12 @@
|
|||
#include "jsalloc.h"
|
||||
#include "jsapi.h"
|
||||
#include "jsprvtd.h"
|
||||
#include "jshash.h"
|
||||
#include "jspubtd.h"
|
||||
#include "jslock.h"
|
||||
|
||||
#include "gc/Barrier.h"
|
||||
#include "js/HashTable.h"
|
||||
#include "mozilla/HashFunctions.h"
|
||||
|
||||
struct JSIdArray {
|
||||
int length;
|
||||
|
@ -83,15 +83,23 @@ JSID_TO_ATOM(jsid id)
|
|||
return (JSAtom *)JSID_TO_STRING(id);
|
||||
}
|
||||
|
||||
JS_STATIC_ASSERT(sizeof(js::HashNumber) == 4);
|
||||
JS_STATIC_ASSERT(sizeof(JSHashNumber) == 4);
|
||||
JS_STATIC_ASSERT(sizeof(jsid) == JS_BYTES_PER_WORD);
|
||||
|
||||
namespace js {
|
||||
|
||||
static JS_ALWAYS_INLINE js::HashNumber
|
||||
static JS_ALWAYS_INLINE JSHashNumber
|
||||
HashId(jsid id)
|
||||
{
|
||||
return HashGeneric(JSID_BITS(id));
|
||||
JSHashNumber n =
|
||||
#if JS_BYTES_PER_WORD == 4
|
||||
JSHashNumber(JSID_BITS(id));
|
||||
#elif JS_BYTES_PER_WORD == 8
|
||||
JSHashNumber(JSID_BITS(id)) ^ JSHashNumber(JSID_BITS(id) >> 32);
|
||||
#else
|
||||
# error "Unsupported configuration"
|
||||
#endif
|
||||
return n * JS_GOLDEN_RATIO;
|
||||
}
|
||||
|
||||
static JS_ALWAYS_INLINE Value
|
||||
|
@ -127,6 +135,15 @@ struct DefaultHasher<jsid>
|
|||
|
||||
}
|
||||
|
||||
#if JS_BYTES_PER_WORD == 4
|
||||
# define ATOM_HASH(atom) ((JSHashNumber)(atom) >> 2)
|
||||
#elif JS_BYTES_PER_WORD == 8
|
||||
# define ATOM_HASH(atom) (((JSHashNumber)(uintptr_t)(atom) >> 3) ^ \
|
||||
(JSHashNumber)((uintptr_t)(atom) >> 32))
|
||||
#else
|
||||
# error "Unsupported configuration"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Return a printable, lossless char[] representation of a string-type atom.
|
||||
* The lifetime of the result matches the lifetime of bytes.
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
|
||||
#include "jstypes.h"
|
||||
#include "jsutil.h"
|
||||
#include "jshash.h"
|
||||
#include "jsclist.h"
|
||||
#include "jsprf.h"
|
||||
#include "jsapi.h"
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include "jstypes.h"
|
||||
#include "jsutil.h"
|
||||
#include "jshash.h"
|
||||
#include "jsprf.h"
|
||||
#include "jsapi.h"
|
||||
#include "jsarray.h"
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "jsclass.h"
|
||||
#include "jsfriendapi.h"
|
||||
#include "jsinfer.h"
|
||||
#include "jshash.h"
|
||||
#include "jspubtd.h"
|
||||
#include "jsprvtd.h"
|
||||
#include "jslock.h"
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#include "jsscope.h"
|
||||
#include "jsstr.h"
|
||||
|
||||
#include "js/HashTable.h"
|
||||
#include "js/MemoryMetrics.h"
|
||||
|
||||
#include "jsatominlines.h"
|
||||
|
@ -146,7 +145,7 @@ Shape::hashify(JSContext *cx)
|
|||
Shape **
|
||||
ShapeTable::search(jsid id, bool adding)
|
||||
{
|
||||
js::HashNumber hash0, hash1, hash2;
|
||||
JSHashNumber hash0, hash1, hash2;
|
||||
int sizeLog2;
|
||||
Shape *stored, *shape, **spp, **firstRemoved;
|
||||
uint32_t sizeMask;
|
||||
|
|
|
@ -955,7 +955,7 @@ struct ScriptFilenameEntry
|
|||
struct ScriptFilenameHasher
|
||||
{
|
||||
typedef const char *Lookup;
|
||||
static HashNumber hash(const char *l) { return mozilla::HashString(l); }
|
||||
static HashNumber hash(const char *l) { return JS_HashString(l); }
|
||||
static bool match(const ScriptFilenameEntry *e, const char *l) {
|
||||
return strcmp(e->filename, l) == 0;
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include <string.h>
|
||||
#include "jstypes.h"
|
||||
#include "jsutil.h"
|
||||
#include "jshash.h"
|
||||
#include "jsprf.h"
|
||||
#include "jsapi.h"
|
||||
#include "jsarray.h"
|
||||
|
@ -41,7 +42,6 @@
|
|||
#include "jsversion.h"
|
||||
|
||||
#include "builtin/RegExp.h"
|
||||
#include "js/HashTable.h"
|
||||
#include "vm/GlobalObject.h"
|
||||
#include "vm/NumericConversions.h"
|
||||
#include "vm/RegExpObject.h"
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "mozilla/FloatingPoint.h"
|
||||
#include "jstypes.h"
|
||||
#include "jsutil.h"
|
||||
#include "jshash.h"
|
||||
#include "jsprf.h"
|
||||
#include "jsapi.h"
|
||||
#include "jsarray.h"
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include "xpcprivate.h"
|
||||
|
||||
#include "js/HashTable.h"
|
||||
#include "jshash.h"
|
||||
|
||||
/***************************************************************************/
|
||||
// static shared...
|
||||
|
@ -19,7 +19,7 @@
|
|||
static JSDHashNumber
|
||||
HashIIDPtrKey(JSDHashTable *table, const void *key)
|
||||
{
|
||||
return *((js::HashNumber*)key);
|
||||
return *((JSHashNumber*)key);
|
||||
}
|
||||
|
||||
static JSBool
|
||||
|
@ -56,7 +56,7 @@ HashNativeKey(JSDHashTable *table, const void *key)
|
|||
NS_ASSERTION(Addition, "bad key");
|
||||
// This would be an XOR like below.
|
||||
// But "0 ^ x == x". So it does not matter.
|
||||
h = (js::HashNumber) NS_PTR_TO_INT32(Addition) >> 2;
|
||||
h = (JSHashNumber) NS_PTR_TO_INT32(Addition) >> 2;
|
||||
} else {
|
||||
XPCNativeInterface** Current = Set->GetInterfaceArray();
|
||||
PRUint16 count = Set->GetInterfaceCount();
|
||||
|
@ -64,13 +64,13 @@ HashNativeKey(JSDHashTable *table, const void *key)
|
|||
count++;
|
||||
for (PRUint16 i = 0; i < count; i++) {
|
||||
if (i == Position)
|
||||
h ^= (js::HashNumber) NS_PTR_TO_INT32(Addition) >> 2;
|
||||
h ^= (JSHashNumber) NS_PTR_TO_INT32(Addition) >> 2;
|
||||
else
|
||||
h ^= (js::HashNumber) NS_PTR_TO_INT32(*(Current++)) >> 2;
|
||||
h ^= (JSHashNumber) NS_PTR_TO_INT32(*(Current++)) >> 2;
|
||||
}
|
||||
} else {
|
||||
for (PRUint16 i = 0; i < count; i++)
|
||||
h ^= (js::HashNumber) NS_PTR_TO_INT32(*(Current++)) >> 2;
|
||||
h ^= (JSHashNumber) NS_PTR_TO_INT32(*(Current++)) >> 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -179,14 +179,6 @@ AddToHash(uint32_t hash, A* a)
|
|||
return detail::AddUintptrToHash<sizeof(uintptr_t)>(hash, uintptr_t(a));
|
||||
}
|
||||
|
||||
template<>
|
||||
MOZ_WARN_UNUSED_RESULT
|
||||
inline uint32_t
|
||||
AddToHash(uint32_t hash, uintptr_t a)
|
||||
{
|
||||
return detail::AddUintptrToHash<sizeof(uintptr_t)>(hash, a);
|
||||
}
|
||||
|
||||
template<typename A, typename B>
|
||||
MOZ_WARN_UNUSED_RESULT
|
||||
uint32_t
|
||||
|
|
Загрузка…
Ссылка в новой задаче