mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 12:50:09 +00:00
Merge tracemonkey to mozilla-central.
This commit is contained in:
commit
7d362491de
22
configure.in
22
configure.in
@ -6601,14 +6601,6 @@ if test "$MOZ_MEMORY"; then
|
||||
AC_MSG_ERROR([--enable-jemalloc not supported on ${target}])
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_ARG_WITH([valgrind],
|
||||
[ --with-valgrind Enable valgrind integration hooks],
|
||||
[enable_valgrind="yes"], [enable_valgrind="no"])
|
||||
AC_CHECK_HEADER([valgrind/valgrind.h], [], [enable_valgrind="no"])
|
||||
if test "x$enable_valgrind" = "xyes" ; then
|
||||
AC_DEFINE(MOZ_VALGRIND)
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(MOZ_MEMORY)
|
||||
AC_SUBST(WIN32_CRT_SRC_DIR)
|
||||
@ -6640,6 +6632,20 @@ MOZ_ARG_WITH_STRING(wrap-malloc,
|
||||
[ --with-wrap-malloc=DIR Location of malloc wrapper library],
|
||||
WRAP_MALLOC_LIB=$withval)
|
||||
|
||||
dnl ========================================================
|
||||
dnl = Use Valgrind
|
||||
dnl ========================================================
|
||||
MOZ_ARG_ENABLE_BOOL(valgrind,
|
||||
[ --enable-valgrind Enable Valgrind integration hooks (default=no)],
|
||||
MOZ_VALGRIND=1,
|
||||
MOZ_VALGRIND= )
|
||||
if test -n "$MOZ_VALGRIND"; then
|
||||
AC_CHECK_HEADER([valgrind/valgrind.h], [],
|
||||
AC_MSG_ERROR(
|
||||
[--enable-valgrind specified but Valgrind is not installed]))
|
||||
AC_DEFINE(MOZ_VALGRIND)
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
dnl = Use Electric Fence
|
||||
dnl ========================================================
|
||||
|
@ -6369,7 +6369,7 @@ nsWindowSH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
||||
|
||||
if (!::JS_DefineUCProperty(cx, obj, ::JS_GetStringChars(str),
|
||||
::JS_GetStringLength(str),
|
||||
JSVAL_VOID, nsnull, nsnull,
|
||||
JSVAL_VOID, JS_PropertyStub, JS_PropertyStub,
|
||||
JSPROP_ENUMERATE)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
@ -354,6 +354,14 @@ check::
|
||||
$(check-sync-dirs) $(srcdir)/build $(MOZ_SYNC_BUILD_FILES)/build
|
||||
endif
|
||||
|
||||
# Temporarily disable - backout of bug 473989.
|
||||
#ifdef ENABLE_JIT
|
||||
#check::
|
||||
# $(wildcard $(RUN_TEST_PROGRAM)) ./js$(BIN_SUFFIX) -j -e \
|
||||
# "var gSrcdir='$(srcdir)'; var gSkipSlowTests=true; var gReportSummary=false;" \
|
||||
# $(srcdir)/trace-test.js
|
||||
#endif
|
||||
|
||||
# our build system doesn't handle subdir srcs very gracefully today
|
||||
export::
|
||||
mkdir -p nanojit
|
||||
|
@ -79,7 +79,6 @@ BUILTIN2(extern, DOUBLE, js_StringToNumber, CONTEXT, STRING,
|
||||
BUILTIN2(extern, INT32, js_StringToInt32, CONTEXT, STRING, 1, 1)
|
||||
BUILTIN2(FRIEND, BOOL, js_CloseIterator, CONTEXT, JSVAL, 0, 0)
|
||||
BUILTIN2(extern, SIDEEXIT, js_CallTree, INTERPSTATE, FRAGMENT, 0, 0)
|
||||
BUILTIN2(extern, OBJECT, js_FastNewObject, CONTEXT, OBJECT, 0, 0)
|
||||
BUILTIN3(extern, BOOL, js_AddProperty, CONTEXT, OBJECT, SCOPEPROP, 0, 0)
|
||||
BUILTIN3(extern, BOOL, js_HasNamedProperty, CONTEXT, OBJECT, STRING, 0, 0)
|
||||
BUILTIN3(extern, BOOL, js_HasNamedPropertyInt32, CONTEXT, OBJECT, INT32, 0, 0)
|
||||
|
@ -4272,14 +4272,6 @@ if test "$MOZ_MEMORY"; then
|
||||
AC_MSG_ERROR([--enable-jemalloc not supported on ${target}])
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_ARG_WITH([valgrind],
|
||||
[ --with-valgrind Enable valgrind integration hooks],
|
||||
[enable_valgrind="yes"], [enable_valgrind="no"])
|
||||
AC_CHECK_HEADER([valgrind/valgrind.h], [], [enable_valgrind="no"])
|
||||
if test "x$enable_valgrind" = "xyes" ; then
|
||||
AC_DEFINE(MOZ_VALGRIND)
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(MOZ_MEMORY)
|
||||
AC_SUBST(WIN32_CRT_SRC_DIR)
|
||||
@ -4311,6 +4303,20 @@ MOZ_ARG_WITH_STRING(wrap-malloc,
|
||||
[ --with-wrap-malloc=DIR Location of malloc wrapper library],
|
||||
WRAP_MALLOC_LIB=$withval)
|
||||
|
||||
dnl ========================================================
|
||||
dnl = Use Valgrind
|
||||
dnl ========================================================
|
||||
MOZ_ARG_ENABLE_BOOL(valgrind,
|
||||
[ --enable-valgrind Enable Valgrind integration hooks (default=no)],
|
||||
MOZ_VALGRIND=1,
|
||||
MOZ_VALGRIND= )
|
||||
if test -n "$MOZ_VALGRIND"; then
|
||||
AC_CHECK_HEADER([valgrind/valgrind.h], [],
|
||||
AC_MSG_ERROR(
|
||||
[--enable-valgrind specified but Valgrind is not installed]))
|
||||
AC_DEFINE(MOZ_VALGRIND)
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
dnl = Use Electric Fence
|
||||
dnl ========================================================
|
||||
|
139
js/src/jsapi.cpp
139
js/src/jsapi.cpp
@ -104,6 +104,14 @@
|
||||
#define CHECK_REQUEST(cx) ((void)0)
|
||||
#endif
|
||||
|
||||
/* Check that we can cast JSObject* as jsval without tag bit manipulations. */
|
||||
JS_STATIC_ASSERT(JSVAL_OBJECT == 0);
|
||||
|
||||
/* Check that JSVAL_TRACE_KIND works. */
|
||||
JS_STATIC_ASSERT(JSVAL_TRACE_KIND(JSVAL_OBJECT) == JSTRACE_OBJECT);
|
||||
JS_STATIC_ASSERT(JSVAL_TRACE_KIND(JSVAL_DOUBLE) == JSTRACE_DOUBLE);
|
||||
JS_STATIC_ASSERT(JSVAL_TRACE_KIND(JSVAL_STRING) == JSTRACE_STRING);
|
||||
|
||||
JS_PUBLIC_API(int64)
|
||||
JS_Now()
|
||||
{
|
||||
@ -2750,136 +2758,9 @@ JS_InitClass(JSContext *cx, JSObject *obj, JSObject *parent_proto,
|
||||
JSPropertySpec *ps, JSFunctionSpec *fs,
|
||||
JSPropertySpec *static_ps, JSFunctionSpec *static_fs)
|
||||
{
|
||||
JSAtom *atom;
|
||||
JSProtoKey key;
|
||||
JSObject *proto, *ctor;
|
||||
JSTempValueRooter tvr;
|
||||
jsval cval, rval;
|
||||
JSBool named;
|
||||
JSFunction *fun;
|
||||
|
||||
CHECK_REQUEST(cx);
|
||||
atom = js_Atomize(cx, clasp->name, strlen(clasp->name), 0);
|
||||
if (!atom)
|
||||
return NULL;
|
||||
|
||||
/*
|
||||
* When initializing a standard class, if no parent_proto (grand-proto of
|
||||
* instances of the class, parent-proto of the class's prototype object)
|
||||
* is given, we must use Object.prototype if it is available. Otherwise,
|
||||
* we could look up the wrong binding for a class name in obj. Example:
|
||||
*
|
||||
* String = Array;
|
||||
* print("hi there".join);
|
||||
*
|
||||
* should print undefined, not Array.prototype.join. This is required by
|
||||
* ECMA-262, alas. It might have been better to make String readonly and
|
||||
* permanent in the global object, instead -- but that's too big a change
|
||||
* to swallow at this point.
|
||||
*/
|
||||
key = JSCLASS_CACHED_PROTO_KEY(clasp);
|
||||
if (key != JSProto_Null &&
|
||||
!parent_proto &&
|
||||
!js_GetClassPrototype(cx, obj, INT_TO_JSID(JSProto_Object),
|
||||
&parent_proto)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Create a prototype object for this class. */
|
||||
proto = js_NewObject(cx, clasp, parent_proto, obj, 0);
|
||||
if (!proto)
|
||||
return NULL;
|
||||
|
||||
/* After this point, control must exit via label bad or out. */
|
||||
JS_PUSH_TEMP_ROOT_OBJECT(cx, proto, &tvr);
|
||||
|
||||
if (!constructor) {
|
||||
/*
|
||||
* Lacking a constructor, name the prototype (e.g., Math) unless this
|
||||
* class (a) is anonymous, i.e. for internal use only; (b) the class
|
||||
* of obj (the global object) is has a reserved slot indexed by key;
|
||||
* and (c) key is not the null key.
|
||||
*/
|
||||
if ((clasp->flags & JSCLASS_IS_ANONYMOUS) &&
|
||||
(OBJ_GET_CLASS(cx, obj)->flags & JSCLASS_IS_GLOBAL) &&
|
||||
key != JSProto_Null) {
|
||||
named = JS_FALSE;
|
||||
} else {
|
||||
named = OBJ_DEFINE_PROPERTY(cx, obj, ATOM_TO_JSID(atom),
|
||||
OBJECT_TO_JSVAL(proto),
|
||||
JS_PropertyStub, JS_PropertyStub,
|
||||
(clasp->flags & JSCLASS_IS_ANONYMOUS)
|
||||
? JSPROP_READONLY | JSPROP_PERMANENT
|
||||
: 0,
|
||||
NULL);
|
||||
if (!named)
|
||||
goto bad;
|
||||
}
|
||||
|
||||
ctor = proto;
|
||||
} else {
|
||||
/* Define the constructor function in obj's scope. */
|
||||
fun = js_DefineFunction(cx, obj, atom, constructor, nargs,
|
||||
JSFUN_STUB_GSOPS);
|
||||
named = (fun != NULL);
|
||||
if (!fun)
|
||||
goto bad;
|
||||
|
||||
/*
|
||||
* Remember the class this function is a constructor for so that
|
||||
* we know to create an object of this class when we call the
|
||||
* constructor.
|
||||
*/
|
||||
FUN_CLASP(fun) = clasp;
|
||||
|
||||
/*
|
||||
* Optionally construct the prototype object, before the class has
|
||||
* been fully initialized. Allow the ctor to replace proto with a
|
||||
* different object, as is done for operator new -- and as at least
|
||||
* XML support requires.
|
||||
*/
|
||||
ctor = FUN_OBJECT(fun);
|
||||
if (clasp->flags & JSCLASS_CONSTRUCT_PROTOTYPE) {
|
||||
cval = OBJECT_TO_JSVAL(ctor);
|
||||
if (!js_InternalConstruct(cx, proto, cval, 0, NULL, &rval))
|
||||
goto bad;
|
||||
if (!JSVAL_IS_PRIMITIVE(rval) && JSVAL_TO_OBJECT(rval) != proto)
|
||||
proto = JSVAL_TO_OBJECT(rval);
|
||||
}
|
||||
|
||||
/* Connect constructor and prototype by named properties. */
|
||||
if (!js_SetClassPrototype(cx, ctor, proto,
|
||||
JSPROP_READONLY | JSPROP_PERMANENT)) {
|
||||
goto bad;
|
||||
}
|
||||
|
||||
/* Bootstrap Function.prototype (see also JS_InitStandardClasses). */
|
||||
if (OBJ_GET_CLASS(cx, ctor) == clasp) {
|
||||
OBJ_SET_PROTO(cx, ctor, proto);
|
||||
}
|
||||
}
|
||||
|
||||
/* Add properties and methods to the prototype and the constructor. */
|
||||
if ((ps && !JS_DefineProperties(cx, proto, ps)) ||
|
||||
(fs && !JS_DefineFunctions(cx, proto, fs)) ||
|
||||
(static_ps && !JS_DefineProperties(cx, ctor, static_ps)) ||
|
||||
(static_fs && !JS_DefineFunctions(cx, ctor, static_fs))) {
|
||||
goto bad;
|
||||
}
|
||||
|
||||
/* If this is a standard class, cache its prototype. */
|
||||
if (key != JSProto_Null && !js_SetClassObject(cx, obj, key, ctor))
|
||||
goto bad;
|
||||
|
||||
out:
|
||||
JS_POP_TEMP_ROOT(cx, &tvr);
|
||||
return proto;
|
||||
|
||||
bad:
|
||||
if (named)
|
||||
(void) OBJ_DELETE_PROPERTY(cx, obj, ATOM_TO_JSID(atom), &rval);
|
||||
proto = NULL;
|
||||
goto out;
|
||||
return js_InitClass(cx, obj, parent_proto, clasp, constructor, nargs,
|
||||
ps, fs, static_ps, static_fs, NULL);
|
||||
}
|
||||
|
||||
#ifdef JS_THREADSAFE
|
||||
|
@ -115,7 +115,6 @@ JSVAL_TO_STRING(jsval v)
|
||||
static JS_ALWAYS_INLINE jsval
|
||||
OBJECT_TO_JSVAL(JSObject *obj)
|
||||
{
|
||||
JS_STATIC_ASSERT(JSVAL_OBJECT == 0);
|
||||
JS_ASSERT(((jsval) obj & JSVAL_TAGMASK) == JSVAL_OBJECT);
|
||||
return (jsval) obj;
|
||||
}
|
||||
@ -1016,10 +1015,6 @@ JS_MarkGCThing(JSContext *cx, void *thing, const char *name, void *arg);
|
||||
#define JSVAL_TO_TRACEABLE(v) (JSVAL_TO_GCTHING(v))
|
||||
#define JSVAL_TRACE_KIND(v) (JSVAL_TAG(v) >> 1)
|
||||
|
||||
JS_STATIC_ASSERT(JSVAL_TRACE_KIND(JSVAL_OBJECT) == JSTRACE_OBJECT);
|
||||
JS_STATIC_ASSERT(JSVAL_TRACE_KIND(JSVAL_DOUBLE) == JSTRACE_DOUBLE);
|
||||
JS_STATIC_ASSERT(JSVAL_TRACE_KIND(JSVAL_STRING) == JSTRACE_STRING);
|
||||
|
||||
struct JSTracer {
|
||||
JSContext *context;
|
||||
JSTraceCallback callback;
|
||||
|
@ -41,7 +41,7 @@
|
||||
/*
|
||||
* JS array class.
|
||||
*
|
||||
* Array objects begin as "dense" arrays, optimized for numeric-only property
|
||||
* Array objects begin as "dense" arrays, optimized for index-only property
|
||||
* access over a vector of slots (obj->dslots) with high load factor. Array
|
||||
* methods optimize for denseness by testing that the object's class is
|
||||
* &js_ArrayClass, and can then directly manipulate the slots for efficiency.
|
||||
@ -60,7 +60,7 @@
|
||||
* are met:
|
||||
* - the load factor (COUNT / capacity) is less than 0.25, and there are
|
||||
* more than MIN_SPARSE_INDEX slots total
|
||||
* - a property is set that is non-numeric (and not "length"); or
|
||||
* - a property is set that is not indexed (and not "length"); or
|
||||
* - a property is defined that has non-default property attributes.
|
||||
*
|
||||
* Dense arrays do not track property creation order, so unlike other native
|
||||
@ -822,6 +822,28 @@ array_setProperty(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
JSBool
|
||||
js_PrototypeHasIndexedProperties(JSContext *cx, JSObject *obj)
|
||||
{
|
||||
/*
|
||||
* Walk up the prototype chain and see if this indexed element already
|
||||
* exists. If we hit the end of the prototype chain, it's safe to set the
|
||||
* element on the original object.
|
||||
*/
|
||||
while ((obj = JSVAL_TO_OBJECT(obj->fslots[JSSLOT_PROTO])) != NULL) {
|
||||
/*
|
||||
* If the prototype is a non-native object (possibly a dense array), or
|
||||
* a native object (possibly a slow array) that has indexed properties,
|
||||
* return true.
|
||||
*/
|
||||
if (!OBJ_IS_NATIVE(obj))
|
||||
return JS_TRUE;
|
||||
if (SCOPE_HAS_INDEXED_PROPERTIES(OBJ_SCOPE(obj)))
|
||||
return JS_TRUE;
|
||||
}
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
#ifdef JS_TRACER
|
||||
JSBool FASTCALL
|
||||
js_Array_dense_setelem(JSContext* cx, JSObject* obj, jsint i, jsval v)
|
||||
@ -843,8 +865,9 @@ js_Array_dense_setelem(JSContext* cx, JSObject* obj, jsint i, jsval v)
|
||||
return JS_FALSE;
|
||||
|
||||
if (obj->dslots[u] == JSVAL_HOLE) {
|
||||
if (cx->runtime->anyArrayProtoHasElement)
|
||||
if (js_PrototypeHasIndexedProperties(cx, obj))
|
||||
return JS_FALSE;
|
||||
|
||||
if (u >= jsuint(obj->fslots[JSSLOT_ARRAY_LENGTH]))
|
||||
obj->fslots[JSSLOT_ARRAY_LENGTH] = u + 1;
|
||||
++obj->fslots[JSSLOT_ARRAY_COUNT];
|
||||
|
@ -63,6 +63,28 @@ extern JSClass js_ArrayClass, js_SlowArrayClass;
|
||||
#define OBJ_IS_ARRAY(cx,obj) (OBJ_IS_DENSE_ARRAY(cx, obj) || \
|
||||
OBJ_GET_CLASS(cx, obj) == &js_SlowArrayClass)
|
||||
|
||||
/*
|
||||
* Dense arrays are not native (OBJ_IS_NATIVE(cx, aobj) for a dense array aobj
|
||||
* results in false, meaning aobj->map does not point to a JSScope).
|
||||
*
|
||||
* But Array methods are called via aobj.sort(), e.g., and the interpreter and
|
||||
* the trace recorder must consult the property cache in order to perform well.
|
||||
* The cache works only for native objects.
|
||||
*
|
||||
* Therefore the interpreter (js_Interpret in JSOP_GETPROP and JSOP_CALLPROP)
|
||||
* and js_GetPropertyHelper use this inline function to skip up one link in the
|
||||
* prototype chain when obj is a dense array, in order to find a likely-native
|
||||
* object (to wit, Array.prototype) in which to probe for cached methods.
|
||||
*
|
||||
* Callers of js_GetProtoIfDenseArray must take care to use the original object
|
||||
* (obj) for the |this| value of a getter, setter, or method call (bug 476447).
|
||||
*/
|
||||
static JS_INLINE JSObject *
|
||||
js_GetProtoIfDenseArray(JSContext *cx, JSObject *obj)
|
||||
{
|
||||
return OBJ_IS_DENSE_ARRAY(cx, obj) ? OBJ_GET_PROTO(cx, obj) : obj;
|
||||
}
|
||||
|
||||
extern JSObject *
|
||||
js_InitArrayClass(JSContext *cx, JSObject *obj);
|
||||
|
||||
@ -198,6 +220,9 @@ JS_FRIEND_API(JSBool)
|
||||
js_ArrayToJSDoubleBuffer(JSContext *cx, JSObject *obj, jsuint offset, jsuint count,
|
||||
jsdouble *dest);
|
||||
|
||||
JSBool
|
||||
js_PrototypeHasIndexedProperties(JSContext *cx, JSObject *obj);
|
||||
|
||||
JS_END_EXTERN_C
|
||||
|
||||
#endif /* jsarray_h___ */
|
||||
|
@ -56,6 +56,28 @@
|
||||
#include "jsscan.h"
|
||||
#include "jsstr.h"
|
||||
|
||||
/*
|
||||
* 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);
|
||||
|
||||
/*
|
||||
* Start and limit offsets for atom pointers in JSAtomState must be aligned
|
||||
* on the word boundary.
|
||||
*/
|
||||
JS_STATIC_ASSERT(ATOM_OFFSET_START % sizeof(JSAtom *) == 0);
|
||||
JS_STATIC_ASSERT(ATOM_OFFSET_LIMIT % sizeof(JSAtom *) == 0);
|
||||
|
||||
/*
|
||||
* JS_BOOLEAN_STR and JS_TYPE_STR assume that boolean names starts from the
|
||||
* index 1 and type name starts from the index 1+2 atoms in JSAtomState.
|
||||
*/
|
||||
JS_STATIC_ASSERT(1 * sizeof(JSAtom *) ==
|
||||
offsetof(JSAtomState, booleanAtoms) - ATOM_OFFSET_START);
|
||||
JS_STATIC_ASSERT((1 + 2) * sizeof(JSAtom *) ==
|
||||
offsetof(JSAtomState, typeAtoms) - ATOM_OFFSET_START);
|
||||
|
||||
const char *
|
||||
js_AtomToPrintableString(JSContext *cx, JSAtom *atom)
|
||||
{
|
||||
|
@ -65,9 +65,6 @@ JS_BEGIN_EXTERN_C
|
||||
#define ATOM_IS_STRING(atom) JSVAL_IS_STRING(ATOM_KEY(atom))
|
||||
#define ATOM_TO_STRING(atom) JSVAL_TO_STRING(ATOM_KEY(atom))
|
||||
|
||||
JS_STATIC_ASSERT(sizeof(JSHashNumber) == 4);
|
||||
JS_STATIC_ASSERT(sizeof(JSAtom *) == JS_BYTES_PER_WORD);
|
||||
|
||||
#if JS_BYTES_PER_WORD == 4
|
||||
# define ATOM_HASH(atom) ((JSHashNumber)(atom) >> 2)
|
||||
#elif JS_BYTES_PER_WORD == 8
|
||||
@ -274,10 +271,6 @@ struct JSAtomState {
|
||||
((offsetof(JSAtomState, typeAtoms[type]) - ATOM_OFFSET_START) \
|
||||
/ sizeof(JSAtom*))
|
||||
|
||||
/* Start and limit offsets should correspond to atoms. */
|
||||
JS_STATIC_ASSERT(ATOM_OFFSET_START % sizeof(JSAtom *) == 0);
|
||||
JS_STATIC_ASSERT(ATOM_OFFSET_LIMIT % sizeof(JSAtom *) == 0);
|
||||
|
||||
#define ATOM_OFFSET(name) offsetof(JSAtomState, name##Atom)
|
||||
#define OFFSET_TO_ATOM(rt,off) (*(JSAtom **)((char*)&(rt)->atomState + (off)))
|
||||
#define CLASS_ATOM_OFFSET(name) offsetof(JSAtomState,classAtoms[JSProto_##name])
|
||||
@ -289,17 +282,11 @@ extern const char *const js_common_atom_names[];
|
||||
extern const size_t js_common_atom_count;
|
||||
|
||||
/*
|
||||
* Macros to access C strings for JSType and boolean literals together with
|
||||
* checks that boolean names start from index 1 and type names from 1+2.
|
||||
* Macros to access C strings for JSType and boolean literals.
|
||||
*/
|
||||
#define JS_BOOLEAN_STR(type) (js_common_atom_names[1 + (type)])
|
||||
#define JS_TYPE_STR(type) (js_common_atom_names[1 + 2 + (type)])
|
||||
|
||||
JS_STATIC_ASSERT(1 * sizeof(JSAtom *) ==
|
||||
offsetof(JSAtomState, booleanAtoms) - ATOM_OFFSET_START);
|
||||
JS_STATIC_ASSERT((1 + 2) * sizeof(JSAtom *) ==
|
||||
offsetof(JSAtomState, typeAtoms) - ATOM_OFFSET_START);
|
||||
|
||||
/* Well-known predefined C strings. */
|
||||
#define JS_PROTO(name,code,init) extern const char js_##name##_str[];
|
||||
#include "jsproto.tbl"
|
||||
|
@ -129,7 +129,6 @@ __BitScanReverse32(unsigned int val)
|
||||
*/
|
||||
# define JS_CEILING_LOG2(_log2,_n) \
|
||||
JS_BEGIN_MACRO \
|
||||
JS_STATIC_ASSERT(sizeof(unsigned int) == sizeof(JSUint32)); \
|
||||
unsigned int j_ = (unsigned int)(_n); \
|
||||
(_log2) = (j_ <= 1 ? 0 : 32 - js_bitscan_clz32(j_ - 1)); \
|
||||
JS_END_MACRO
|
||||
@ -167,7 +166,6 @@ __BitScanReverse32(unsigned int val)
|
||||
*/
|
||||
# define JS_FLOOR_LOG2(_log2,_n) \
|
||||
JS_BEGIN_MACRO \
|
||||
JS_STATIC_ASSERT(sizeof(unsigned int) == sizeof(JSUint32)); \
|
||||
(_log2) = 31 - js_bitscan_clz32(((unsigned int)(_n)) | 1); \
|
||||
JS_END_MACRO
|
||||
#else
|
||||
@ -207,7 +205,6 @@ __BitScanReverse32(unsigned int val)
|
||||
#if JS_BYTES_PER_WORD == 4
|
||||
|
||||
# ifdef JS_HAS_BUILTIN_BITSCAN32
|
||||
JS_STATIC_ASSERT(sizeof(unsigned) == sizeof(JSUword));
|
||||
# define js_FloorLog2wImpl(n) \
|
||||
((JSUword)(JS_BITS_PER_WORD - 1 - js_bitscan_clz32(n)))
|
||||
# else
|
||||
@ -217,7 +214,6 @@ JS_STATIC_ASSERT(sizeof(unsigned) == sizeof(JSUword));
|
||||
#elif JS_BYTES_PER_WORD == 8
|
||||
|
||||
# ifdef JS_HAS_BUILTIN_BITSCAN64
|
||||
JS_STATIC_ASSERT(sizeof(unsigned long long) == sizeof(JSUword));
|
||||
# define js_FloorLog2wImpl(n) \
|
||||
((JSUword)(JS_BITS_PER_WORD - 1 - js_bitscan_clz64(n)))
|
||||
# else
|
||||
|
@ -221,52 +221,6 @@ js_CallTree(InterpState* state, Fragment* f)
|
||||
return lr;
|
||||
}
|
||||
|
||||
JSObject* FASTCALL
|
||||
js_FastNewObject(JSContext* cx, JSObject* ctor)
|
||||
{
|
||||
JS_ASSERT(HAS_FUNCTION_CLASS(ctor));
|
||||
JSFunction* fun = GET_FUNCTION_PRIVATE(cx, ctor);
|
||||
JSClass* clasp = (FUN_INTERPRETED(fun) || (fun->flags & JSFUN_TRACEABLE))
|
||||
? &js_ObjectClass
|
||||
: FUN_CLASP(fun);
|
||||
JS_ASSERT(clasp != &js_ArrayClass);
|
||||
|
||||
JS_LOCK_OBJ(cx, ctor);
|
||||
JSScope *scope = OBJ_SCOPE(ctor);
|
||||
JS_ASSERT(scope->object == ctor);
|
||||
JSAtom* atom = cx->runtime->atomState.classPrototypeAtom;
|
||||
|
||||
JSScopeProperty *sprop = SCOPE_GET_PROPERTY(scope, ATOM_TO_JSID(atom));
|
||||
JS_ASSERT(SPROP_HAS_VALID_SLOT(sprop, scope));
|
||||
jsval v = LOCKED_OBJ_GET_SLOT(ctor, sprop->slot);
|
||||
JS_UNLOCK_SCOPE(cx, scope);
|
||||
|
||||
JSObject* proto;
|
||||
if (JSVAL_IS_PRIMITIVE(v)) {
|
||||
if (!js_GetClassPrototype(cx, JSVAL_TO_OBJECT(ctor->fslots[JSSLOT_PARENT]),
|
||||
INT_TO_JSID(JSProto_Object), &proto)) {
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
proto = JSVAL_TO_OBJECT(v);
|
||||
}
|
||||
|
||||
JS_ASSERT(JS_ON_TRACE(cx));
|
||||
JSObject* obj = (JSObject*) js_NewGCThing(cx, GCX_OBJECT, sizeof(JSObject));
|
||||
if (!obj)
|
||||
return NULL;
|
||||
|
||||
obj->classword = jsuword(clasp);
|
||||
obj->fslots[JSSLOT_PROTO] = OBJECT_TO_JSVAL(proto);
|
||||
obj->fslots[JSSLOT_PARENT] = ctor->fslots[JSSLOT_PARENT];
|
||||
for (unsigned i = JSSLOT_PRIVATE; i != JS_INITIAL_NSLOTS; ++i)
|
||||
obj->fslots[i] = JSVAL_VOID;
|
||||
|
||||
obj->map = js_HoldObjectMap(cx, proto->map);
|
||||
obj->dslots = NULL;
|
||||
return obj;
|
||||
}
|
||||
|
||||
JSBool FASTCALL
|
||||
js_AddProperty(JSContext* cx, JSObject* obj, JSScopeProperty* sprop)
|
||||
{
|
||||
|
@ -50,7 +50,8 @@
|
||||
#endif
|
||||
|
||||
enum JSTNErrType { INFALLIBLE, FAIL_STATUS, FAIL_NULL, FAIL_NEG, FAIL_VOID, FAIL_COOKIE };
|
||||
enum { JSTN_ERRTYPE_MASK = 0x07, JSTN_UNBOX_AFTER = 0x08, JSTN_MORE = 0x10 };
|
||||
enum { JSTN_ERRTYPE_MASK = 0x07, JSTN_UNBOX_AFTER = 0x08, JSTN_MORE = 0x10,
|
||||
JSTN_CONSTRUCTOR = 0x20 };
|
||||
|
||||
#define JSTN_ERRTYPE(jstn) ((jstn)->flags & JSTN_ERRTYPE_MASK)
|
||||
|
||||
@ -85,7 +86,8 @@ struct JSTraceableNative {
|
||||
const nanojit::CallInfo *builtin;
|
||||
const char *prefix;
|
||||
const char *argtypes;
|
||||
uintN flags; /* JSTNErrType | JSTN_UNBOX_AFTER | JSTN_MORE */
|
||||
uintN flags; /* JSTNErrType | JSTN_UNBOX_AFTER | JSTN_MORE |
|
||||
JSTN_CONSTRUCTOR */
|
||||
};
|
||||
|
||||
/*
|
||||
@ -177,6 +179,8 @@ struct JSTraceableNative {
|
||||
#define _JS_CTYPE_THIS _JS_CTYPE(JSObject *, _JS_PTR,"T", "", INFALLIBLE)
|
||||
#define _JS_CTYPE_THIS_DOUBLE _JS_CTYPE(jsdouble, _JS_F64,"D", "", INFALLIBLE)
|
||||
#define _JS_CTYPE_THIS_STRING _JS_CTYPE(JSString *, _JS_PTR,"S", "", INFALLIBLE)
|
||||
#define _JS_CTYPE_CALLEE _JS_CTYPE(JSObject *, _JS_PTR,"f","", INFALLIBLE)
|
||||
#define _JS_CTYPE_CALLEE_PROTOTYPE _JS_CTYPE(JSObject *, _JS_PTR,"p","", INFALLIBLE)
|
||||
#define _JS_CTYPE_PC _JS_CTYPE(jsbytecode *, _JS_PTR,"P", "", INFALLIBLE)
|
||||
#define _JS_CTYPE_JSVAL _JS_JSVAL_CTYPE( _JS_PTR, "","v", INFALLIBLE)
|
||||
#define _JS_CTYPE_JSVAL_RETRY _JS_JSVAL_CTYPE( _JS_PTR, --, --, FAIL_COOKIE)
|
||||
@ -192,8 +196,10 @@ struct JSTraceableNative {
|
||||
#define _JS_CTYPE_STRING_RETRY _JS_CTYPE(JSString *, _JS_PTR, --, --, FAIL_NULL)
|
||||
#define _JS_CTYPE_STRING_FAIL _JS_CTYPE(JSString *, _JS_PTR, --, --, FAIL_STATUS)
|
||||
#define _JS_CTYPE_OBJECT _JS_CTYPE(JSObject *, _JS_PTR, "","o", INFALLIBLE)
|
||||
#define _JS_CTYPE_OBJECT_RETRY_NULL _JS_CTYPE(JSObject *, _JS_PTR, --, --, FAIL_NULL)
|
||||
#define _JS_CTYPE_OBJECT_RETRY _JS_CTYPE(JSObject *, _JS_PTR, --, --, FAIL_NULL)
|
||||
#define _JS_CTYPE_OBJECT_FAIL _JS_CTYPE(JSObject *, _JS_PTR, --, --, FAIL_STATUS)
|
||||
#define _JS_CTYPE_CONSTRUCTOR_RETRY _JS_CTYPE(JSObject *, _JS_PTR, --, --, FAIL_NULL | \
|
||||
JSTN_CONSTRUCTOR)
|
||||
#define _JS_CTYPE_REGEXP _JS_CTYPE(JSObject *, _JS_PTR, "","r", INFALLIBLE)
|
||||
#define _JS_CTYPE_SCOPEPROP _JS_CTYPE(JSScopeProperty *, _JS_PTR, --, --, INFALLIBLE)
|
||||
#define _JS_CTYPE_SIDEEXIT _JS_CTYPE(SideExit *, _JS_PTR, --, --, INFALLIBLE)
|
||||
@ -315,15 +321,15 @@ struct JSTraceableNative {
|
||||
#define JS_DEFINE_TRCINFO_1(name, tn0) \
|
||||
_JS_DEFINE_CALLINFO_n tn0 \
|
||||
JSTraceableNative name##_trcinfo[] = { \
|
||||
{ name, _JS_TN_INIT_HELPER_n tn0 } \
|
||||
{ (JSFastNative)name, _JS_TN_INIT_HELPER_n tn0 } \
|
||||
};
|
||||
|
||||
#define JS_DEFINE_TRCINFO_2(name, tn0, tn1) \
|
||||
_JS_DEFINE_CALLINFO_n tn0 \
|
||||
_JS_DEFINE_CALLINFO_n tn1 \
|
||||
JSTraceableNative name##_trcinfo[] = { \
|
||||
{ name, _JS_TN_INIT_HELPER_n tn0 | JSTN_MORE }, \
|
||||
{ name, _JS_TN_INIT_HELPER_n tn1 } \
|
||||
{ (JSFastNative)name, _JS_TN_INIT_HELPER_n tn0 | JSTN_MORE }, \
|
||||
{ (JSFastNative)name, _JS_TN_INIT_HELPER_n tn1 } \
|
||||
};
|
||||
|
||||
#define JS_DEFINE_TRCINFO_3(name, tn0, tn1, tn2) \
|
||||
@ -331,9 +337,9 @@ struct JSTraceableNative {
|
||||
_JS_DEFINE_CALLINFO_n tn1 \
|
||||
_JS_DEFINE_CALLINFO_n tn2 \
|
||||
JSTraceableNative name##_trcinfo[] = { \
|
||||
{ name, _JS_TN_INIT_HELPER_n tn0 | JSTN_MORE }, \
|
||||
{ name, _JS_TN_INIT_HELPER_n tn1 | JSTN_MORE }, \
|
||||
{ name, _JS_TN_INIT_HELPER_n tn2 } \
|
||||
{ (JSFastNative)name, _JS_TN_INIT_HELPER_n tn0 | JSTN_MORE }, \
|
||||
{ (JSFastNative)name, _JS_TN_INIT_HELPER_n tn1 | JSTN_MORE }, \
|
||||
{ (JSFastNative)name, _JS_TN_INIT_HELPER_n tn2 } \
|
||||
};
|
||||
|
||||
#define JS_DEFINE_TRCINFO_4(name, tn0, tn1, tn2, tn3) \
|
||||
@ -342,10 +348,10 @@ struct JSTraceableNative {
|
||||
_JS_DEFINE_CALLINFO_n tn2 \
|
||||
_JS_DEFINE_CALLINFO_n tn3 \
|
||||
JSTraceableNative name##_trcinfo[] = { \
|
||||
{ name, _JS_TN_INIT_HELPER_n tn0 | JSTN_MORE }, \
|
||||
{ name, _JS_TN_INIT_HELPER_n tn1 | JSTN_MORE }, \
|
||||
{ name, _JS_TN_INIT_HELPER_n tn2 | JSTN_MORE }, \
|
||||
{ name, _JS_TN_INIT_HELPER_n tn3 } \
|
||||
{ (JSFastNative)name, _JS_TN_INIT_HELPER_n tn0 | JSTN_MORE }, \
|
||||
{ (JSFastNative)name, _JS_TN_INIT_HELPER_n tn1 | JSTN_MORE }, \
|
||||
{ (JSFastNative)name, _JS_TN_INIT_HELPER_n tn2 | JSTN_MORE }, \
|
||||
{ (JSFastNative)name, _JS_TN_INIT_HELPER_n tn3 } \
|
||||
};
|
||||
|
||||
#define _JS_DEFINE_CALLINFO_n(n, args) JS_DEFINE_CALLINFO_##n args
|
||||
@ -384,31 +390,32 @@ js_Int32ToId(JSContext* cx, int32 index, jsid* id)
|
||||
|
||||
#endif /* !JS_TRACER */
|
||||
|
||||
/* Defined in jsarray.cpp */
|
||||
/* Defined in jsobj.cpp. */
|
||||
JS_DECLARE_CALLINFO(js_Object_tn)
|
||||
JS_DECLARE_CALLINFO(js_NewInstance)
|
||||
|
||||
/* Defined in jsarray.cpp. */
|
||||
JS_DECLARE_CALLINFO(js_ArrayCompPush)
|
||||
JS_DECLARE_CALLINFO(js_Array_1str)
|
||||
JS_DECLARE_CALLINFO(js_Array_dense_setelem)
|
||||
JS_DECLARE_CALLINFO(js_FastNewArray)
|
||||
JS_DECLARE_CALLINFO(js_NewUninitializedArray)
|
||||
JS_DECLARE_CALLINFO(js_FastNewArrayWithLength)
|
||||
JS_DECLARE_CALLINFO(js_Array_1str)
|
||||
JS_DECLARE_CALLINFO(js_ArrayCompPush)
|
||||
JS_DECLARE_CALLINFO(js_NewUninitializedArray)
|
||||
|
||||
/* Defined in jsdate.cpp */
|
||||
JS_DECLARE_CALLINFO(js_FastNewDate)
|
||||
|
||||
/* Defined in jsnum.cpp */
|
||||
/* Defined in jsnum.cpp. */
|
||||
JS_DECLARE_CALLINFO(js_NumberToString)
|
||||
|
||||
/* Defined in jsstr.cpp */
|
||||
/* Defined in jsstr.cpp. */
|
||||
JS_DECLARE_CALLINFO(js_CompareStrings)
|
||||
JS_DECLARE_CALLINFO(js_ConcatStrings)
|
||||
JS_DECLARE_CALLINFO(js_EqualStrings)
|
||||
JS_DECLARE_CALLINFO(js_String_getelem)
|
||||
JS_DECLARE_CALLINFO(js_String_p_charCodeAt)
|
||||
JS_DECLARE_CALLINFO(js_String_p_charCodeAt0)
|
||||
JS_DECLARE_CALLINFO(js_String_p_charCodeAt0_int)
|
||||
JS_DECLARE_CALLINFO(js_String_p_charCodeAt)
|
||||
JS_DECLARE_CALLINFO(js_String_p_charCodeAt_int)
|
||||
JS_DECLARE_CALLINFO(js_EqualStrings)
|
||||
JS_DECLARE_CALLINFO(js_CompareStrings)
|
||||
|
||||
/* Defined in jsbuiltins.cpp */
|
||||
/* Defined in jsbuiltins.cpp. */
|
||||
#define BUILTIN1(linkage, rt, op, at0, cse, fold) JS_DECLARE_CALLINFO(op)
|
||||
#define BUILTIN2(linkage, rt, op, at0, at1, cse, fold) JS_DECLARE_CALLINFO(op)
|
||||
#define BUILTIN3(linkage, rt, op, at0, at1, at2, cse, fold) JS_DECLARE_CALLINFO(op)
|
||||
|
@ -576,15 +576,6 @@ struct JSRuntime {
|
||||
|
||||
jsuword nativeEnumCache[NATIVE_ENUM_CACHE_SIZE];
|
||||
|
||||
/*
|
||||
* Runtime-wide flag set to true when any Array prototype has an indexed
|
||||
* property defined on it, creating a hazard for code reading or writing
|
||||
* over a hole from a dense Array instance that is not prepared to look up
|
||||
* the proto chain (the writing case must involve a check for a read-only
|
||||
* element, which cannot be shadowed).
|
||||
*/
|
||||
JSBool anyArrayProtoHasElement;
|
||||
|
||||
/*
|
||||
* Various metering fields are defined at the end of JSRuntime. In this
|
||||
* way there is no need to recompile all the code that refers to other
|
||||
@ -778,12 +769,7 @@ typedef struct JSLocalRootStack {
|
||||
* bits. This is how, for example, js_GetGCThingTraceKind uses its |thing|
|
||||
* parameter -- it consults GC-thing flags stored separately from the thing to
|
||||
* decide the kind of thing.
|
||||
*
|
||||
* The following checks that this type-punning is possible.
|
||||
*/
|
||||
JS_STATIC_ASSERT(sizeof(JSTempValueUnion) == sizeof(jsval));
|
||||
JS_STATIC_ASSERT(sizeof(JSTempValueUnion) == sizeof(void *));
|
||||
|
||||
#define JS_PUSH_TEMP_ROOT_COMMON(cx,x,tvr,cnt,kind) \
|
||||
JS_BEGIN_MACRO \
|
||||
JS_ASSERT((cx)->tempValueRooters != (tvr)); \
|
||||
|
@ -2022,8 +2022,6 @@ date_valueOf(JSContext *cx, uintN argc, jsval *vp)
|
||||
return date_toString(cx, argc, vp);
|
||||
}
|
||||
|
||||
JS_DEFINE_CALLINFO_2(extern, OBJECT, js_FastNewDate, CONTEXT, OBJECT, 0, 0)
|
||||
|
||||
// Don't really need an argument here, but we don't support arg-less builtins
|
||||
JS_DEFINE_TRCINFO_1(date_now,
|
||||
(1, (static, DOUBLE, date_now_tn, CONTEXT, 0, 0)))
|
||||
@ -2172,36 +2170,33 @@ JS_STATIC_ASSERT(JSSLOT_PRIVATE == JSSLOT_UTC_TIME);
|
||||
JS_STATIC_ASSERT(JSSLOT_UTC_TIME + 1 == JSSLOT_LOCAL_TIME);
|
||||
|
||||
#ifdef JS_TRACER
|
||||
JSObject* FASTCALL
|
||||
js_FastNewDate(JSContext* cx, JSObject* proto)
|
||||
|
||||
static JSObject* FASTCALL
|
||||
Date_tn(JSContext* cx, JSObject* proto)
|
||||
{
|
||||
JS_ASSERT(JS_ON_TRACE(cx));
|
||||
JSObject* obj = (JSObject*) js_NewGCThing(cx, GCX_OBJECT, sizeof(JSObject));
|
||||
JSObject* obj = js_NewNativeObject(cx, &js_DateClass, proto, JSSLOT_LOCAL_TIME + 1);
|
||||
if (!obj)
|
||||
return NULL;
|
||||
|
||||
JSClass* clasp = &js_DateClass;
|
||||
obj->classword = jsuword(clasp);
|
||||
|
||||
obj->fslots[JSSLOT_PROTO] = OBJECT_TO_JSVAL(proto);
|
||||
obj->fslots[JSSLOT_PARENT] = proto->fslots[JSSLOT_PARENT];
|
||||
|
||||
jsdouble* date = js_NewWeaklyRootedDouble(cx, 0.0);
|
||||
if (!date)
|
||||
return NULL;
|
||||
*date = date_now_tn(cx);
|
||||
|
||||
obj->fslots[JSSLOT_UTC_TIME] = DOUBLE_TO_JSVAL(date);
|
||||
obj->fslots[JSSLOT_LOCAL_TIME] = DOUBLE_TO_JSVAL(cx->runtime->jsNaN);
|
||||
for (unsigned i = JSSLOT_LOCAL_TIME + 1; i != JS_INITIAL_NSLOTS; ++i)
|
||||
obj->fslots[i] = JSVAL_VOID;
|
||||
|
||||
JS_ASSERT(!clasp->getObjectOps);
|
||||
JS_ASSERT(proto->map->ops == &js_ObjectOps);
|
||||
obj->map = js_HoldObjectMap(cx, proto->map);
|
||||
obj->dslots = NULL;
|
||||
return obj;
|
||||
}
|
||||
#endif
|
||||
|
||||
JS_DEFINE_TRCINFO_1(js_Date,
|
||||
(2, (static, CONSTRUCTOR_RETRY, Date_tn, CONTEXT, CALLEE_PROTOTYPE, 0, 0)))
|
||||
|
||||
#else /* !JS_TRACER */
|
||||
|
||||
# define js_Date_trcinfo NULL
|
||||
|
||||
#endif /* !JS_TRACER */
|
||||
|
||||
JSObject *
|
||||
js_InitDateClass(JSContext *cx, JSObject *obj)
|
||||
@ -2211,8 +2206,9 @@ js_InitDateClass(JSContext *cx, JSObject *obj)
|
||||
|
||||
/* set static LocalTZA */
|
||||
LocalTZA = -(PRMJ_LocalGMTDifference() * msPerSecond);
|
||||
proto = JS_InitClass(cx, obj, NULL, &js_DateClass, js_Date, MAXARGS,
|
||||
NULL, date_methods, NULL, date_static_methods);
|
||||
proto = js_InitClass(cx, obj, NULL, &js_DateClass, js_Date, MAXARGS,
|
||||
NULL, date_methods, NULL, date_static_methods,
|
||||
js_Date_trcinfo);
|
||||
if (!proto)
|
||||
return NULL;
|
||||
|
||||
|
@ -2115,18 +2115,19 @@ js_NewFunction(JSContext *cx, JSObject *funobj, JSNative native, uintN nargs,
|
||||
} else {
|
||||
fun->u.n.extra = 0;
|
||||
fun->u.n.spare = 0;
|
||||
fun->u.n.clasp = NULL;
|
||||
if (flags & JSFUN_TRACEABLE) {
|
||||
#ifdef JS_TRACER
|
||||
JSTraceableNative *trcinfo =
|
||||
JS_FUNC_TO_DATA_PTR(JSTraceableNative *, native);
|
||||
fun->u.n.native = (JSNative) trcinfo->native;
|
||||
FUN_TRCINFO(fun) = trcinfo;
|
||||
fun->u.n.trcinfo = trcinfo;
|
||||
#else
|
||||
JS_ASSERT(0);
|
||||
fun->u.n.trcinfo = NULL;
|
||||
#endif
|
||||
} else {
|
||||
fun->u.n.native = native;
|
||||
FUN_CLASP(fun) = NULL;
|
||||
fun->u.n.trcinfo = NULL;
|
||||
}
|
||||
}
|
||||
fun->atom = atom;
|
||||
|
@ -73,12 +73,10 @@ struct JSFunction {
|
||||
uint16 extra; /* number of arg slots for local GC roots */
|
||||
uint16 spare; /* reserved for future use */
|
||||
JSNative native; /* native method pointer or null */
|
||||
union {
|
||||
JSClass *clasp; /* class of objects constructed
|
||||
by this function */
|
||||
JSTraceableNative *trcinfo; /* tracer metadata; can be first
|
||||
element of array */
|
||||
} u;
|
||||
JSClass *clasp; /* class of objects constructed
|
||||
by this function */
|
||||
JSTraceableNative *trcinfo; /* tracer metadata; can be first
|
||||
element of array */
|
||||
} n;
|
||||
struct {
|
||||
uint16 nvars; /* number of local variables */
|
||||
@ -111,11 +109,10 @@ struct JSFunction {
|
||||
? 0 \
|
||||
: (fun)->nargs)
|
||||
#define FUN_CLASP(fun) (JS_ASSERT(!FUN_INTERPRETED(fun)), \
|
||||
JS_ASSERT(!((fun)->flags & JSFUN_TRACEABLE)), \
|
||||
fun->u.n.u.clasp)
|
||||
fun->u.n.clasp)
|
||||
#define FUN_TRCINFO(fun) (JS_ASSERT(!FUN_INTERPRETED(fun)), \
|
||||
JS_ASSERT((fun)->flags & JSFUN_TRACEABLE), \
|
||||
fun->u.n.u.trcinfo)
|
||||
fun->u.n.trcinfo)
|
||||
|
||||
/*
|
||||
* Traceable native. This expands to a JSFunctionSpec initializer (like JS_FN
|
||||
|
@ -131,6 +131,47 @@ extern "C" {
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Check JSTempValueUnion has the size of jsval and void * so we can
|
||||
* reinterpret jsval as void* GC-thing pointer and use JSTVU_SINGLE for
|
||||
* different GC-things.
|
||||
*/
|
||||
JS_STATIC_ASSERT(sizeof(JSTempValueUnion) == sizeof(jsval));
|
||||
JS_STATIC_ASSERT(sizeof(JSTempValueUnion) == sizeof(void *));
|
||||
|
||||
|
||||
/*
|
||||
* Check that JSTRACE_XML follows JSTRACE_OBJECT, JSTRACE_DOUBLE and
|
||||
* JSTRACE_STRING.
|
||||
*/
|
||||
JS_STATIC_ASSERT(JSTRACE_OBJECT == 0);
|
||||
JS_STATIC_ASSERT(JSTRACE_DOUBLE == 1);
|
||||
JS_STATIC_ASSERT(JSTRACE_STRING == 2);
|
||||
JS_STATIC_ASSERT(JSTRACE_XML == 3);
|
||||
|
||||
/*
|
||||
* JS_IS_VALID_TRACE_KIND assumes that JSTRACE_STRING is the last non-xml
|
||||
* trace kind when JS_HAS_XML_SUPPORT is false.
|
||||
*/
|
||||
JS_STATIC_ASSERT(JSTRACE_STRING + 1 == JSTRACE_XML);
|
||||
|
||||
/*
|
||||
* The number of used GCX-types must stay within GCX_LIMIT.
|
||||
*/
|
||||
JS_STATIC_ASSERT(GCX_NTYPES <= GCX_LIMIT);
|
||||
|
||||
|
||||
/*
|
||||
* Check that we can reinterpret double as JSGCDoubleCell.
|
||||
*/
|
||||
JS_STATIC_ASSERT(sizeof(JSGCDoubleCell) == sizeof(double));
|
||||
|
||||
/*
|
||||
* Check that we can use memset(p, 0, ...) to implement JS_CLEAR_WEAK_ROOTS.
|
||||
*/
|
||||
JS_STATIC_ASSERT(JSVAL_NULL == 0);
|
||||
|
||||
|
||||
/*
|
||||
* A GC arena contains a fixed number of flag bits for each thing in its heap,
|
||||
* and supports O(1) lookup of a flag given its thing's address.
|
||||
|
@ -50,8 +50,6 @@
|
||||
|
||||
JS_BEGIN_EXTERN_C
|
||||
|
||||
JS_STATIC_ASSERT(JSTRACE_STRING == 2);
|
||||
|
||||
#define JSTRACE_XML 3
|
||||
|
||||
/*
|
||||
@ -70,18 +68,13 @@ JS_STATIC_ASSERT(JSTRACE_STRING == 2);
|
||||
#define GCX_EXTERNAL_STRING JSTRACE_LIMIT /* JSString with external
|
||||
chars */
|
||||
/*
|
||||
* The number of defined GC types.
|
||||
* The number of defined GC types and the maximum limit for the number of
|
||||
* possible GC types.
|
||||
*/
|
||||
#define GCX_NTYPES (GCX_EXTERNAL_STRING + 8)
|
||||
|
||||
/*
|
||||
* The maximum limit for the number of GC types.
|
||||
*/
|
||||
#define GCX_LIMIT_LOG2 4 /* type index bits */
|
||||
#define GCX_LIMIT JS_BIT(GCX_LIMIT_LOG2)
|
||||
|
||||
JS_STATIC_ASSERT(GCX_NTYPES <= GCX_LIMIT);
|
||||
|
||||
/* GC flag definitions, must fit in 8 bits (type index goes in the low bits). */
|
||||
#define GCF_TYPEMASK JS_BITMASK(GCX_LIMIT_LOG2)
|
||||
#define GCF_MARK JS_BIT(GCX_LIMIT_LOG2)
|
||||
@ -237,12 +230,6 @@ js_IsAboutToBeFinalized(JSContext *cx, void *thing);
|
||||
# define JS_IS_VALID_TRACE_KIND(kind) ((uint32)(kind) <= JSTRACE_STRING)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* JS_IS_VALID_TRACE_KIND assumes that JSTRACE_STRING is the last non-xml
|
||||
* trace kind when JS_HAS_XML_SUPPORT is false.
|
||||
*/
|
||||
JS_STATIC_ASSERT(JSTRACE_STRING + 1 == JSTRACE_XML);
|
||||
|
||||
/*
|
||||
* Trace jsval when JSVAL_IS_OBJECT(v) can be an arbitrary GC thing casted as
|
||||
* JSVAL_OBJECT and js_GetGCThingTraceKind has to be used to find the real
|
||||
@ -335,8 +322,6 @@ union JSGCDoubleCell {
|
||||
JSGCDoubleCell *link;
|
||||
};
|
||||
|
||||
JS_STATIC_ASSERT(sizeof(JSGCDoubleCell) == sizeof(double));
|
||||
|
||||
typedef struct JSGCDoubleArenaList {
|
||||
JSGCArenaInfo *first; /* first allocated GC arena */
|
||||
jsbitmap *nextDoubleFlags; /* bitmask with flags to check for free
|
||||
@ -366,7 +351,6 @@ struct JSWeakRoots {
|
||||
jsval lastInternalResult;
|
||||
};
|
||||
|
||||
JS_STATIC_ASSERT(JSVAL_NULL == 0);
|
||||
#define JS_CLEAR_WEAK_ROOTS(wr) (memset((wr), 0, sizeof(JSWeakRoots)))
|
||||
|
||||
/*
|
||||
|
@ -1788,11 +1788,8 @@ js_InvokeConstructor(JSContext *cx, uintN argc, JSBool clampReturn, jsval *vp)
|
||||
|
||||
if (OBJ_GET_CLASS(cx, obj2) == &js_FunctionClass) {
|
||||
fun2 = GET_FUNCTION_PRIVATE(cx, obj2);
|
||||
if (!FUN_INTERPRETED(fun2) &&
|
||||
!(fun2->flags & JSFUN_TRACEABLE) &&
|
||||
fun2->u.n.u.clasp) {
|
||||
clasp = fun2->u.n.u.clasp;
|
||||
}
|
||||
if (!FUN_INTERPRETED(fun2) && fun2->u.n.clasp)
|
||||
clasp = fun2->u.n.clasp;
|
||||
}
|
||||
}
|
||||
obj = js_NewObject(cx, clasp, proto, parent, 0);
|
||||
@ -4266,7 +4263,7 @@ js_Interpret(JSContext *cx)
|
||||
JSObject *aobj;
|
||||
JSPropCacheEntry *entry;
|
||||
|
||||
aobj = OBJ_IS_DENSE_ARRAY(cx, obj) ? OBJ_GET_PROTO(cx, obj) : obj;
|
||||
aobj = js_GetProtoIfDenseArray(cx, obj);
|
||||
if (JS_LIKELY(aobj->map->ops->getProperty == js_GetProperty)) {
|
||||
PROPERTY_CACHE_TEST(cx, regs.pc, aobj, obj2, entry, atom);
|
||||
if (!atom) {
|
||||
@ -4294,7 +4291,7 @@ js_Interpret(JSContext *cx)
|
||||
}
|
||||
id = ATOM_TO_JSID(atom);
|
||||
if (entry
|
||||
? !js_GetPropertyHelper(cx, aobj, id, &rval, &entry)
|
||||
? !js_GetPropertyHelper(cx, obj, id, &rval, &entry)
|
||||
: !OBJ_GET_PROPERTY(cx, obj, id, &rval)) {
|
||||
goto error;
|
||||
}
|
||||
@ -4357,7 +4354,7 @@ js_Interpret(JSContext *cx)
|
||||
goto error;
|
||||
}
|
||||
|
||||
aobj = OBJ_IS_DENSE_ARRAY(cx, obj) ? OBJ_GET_PROTO(cx, obj) : obj;
|
||||
aobj = js_GetProtoIfDenseArray(cx, obj);
|
||||
if (JS_LIKELY(aobj->map->ops->getProperty == js_GetProperty)) {
|
||||
PROPERTY_CACHE_TEST(cx, regs.pc, aobj, obj2, entry, atom);
|
||||
if (!atom) {
|
||||
@ -4402,7 +4399,7 @@ js_Interpret(JSContext *cx)
|
||||
} else
|
||||
#endif
|
||||
if (entry
|
||||
? !js_GetPropertyHelper(cx, aobj, id, &rval, &entry)
|
||||
? !js_GetPropertyHelper(cx, obj, id, &rval, &entry)
|
||||
: !OBJ_GET_PROPERTY(cx, obj, id, &rval)) {
|
||||
goto error;
|
||||
}
|
||||
@ -4592,6 +4589,15 @@ js_Interpret(JSContext *cx)
|
||||
rval);
|
||||
LOCKED_OBJ_SET_SLOT(obj, slot, rval);
|
||||
JS_UNLOCK_SCOPE(cx, scope);
|
||||
|
||||
/*
|
||||
* Purge the property cache of the id we may
|
||||
* have just shadowed in obj's scope and proto
|
||||
* chains. We do this after unlocking obj's
|
||||
* scope to avoid lock nesting.
|
||||
*/
|
||||
js_PurgeScopeChain(cx, obj, sprop->id);
|
||||
|
||||
TRACE_2(SetPropHit, entry, sprop);
|
||||
break;
|
||||
}
|
||||
@ -4725,7 +4731,7 @@ js_Interpret(JSContext *cx)
|
||||
i = JSID_TO_INT(id);
|
||||
if ((jsuint)i < length) {
|
||||
if (obj->dslots[i] == JSVAL_HOLE) {
|
||||
if (rt->anyArrayProtoHasElement)
|
||||
if (js_PrototypeHasIndexedProperties(cx, obj))
|
||||
break;
|
||||
if (i >= obj->fslots[JSSLOT_ARRAY_LENGTH])
|
||||
obj->fslots[JSSLOT_ARRAY_LENGTH] = i + 1;
|
||||
@ -6178,8 +6184,6 @@ js_Interpret(JSContext *cx)
|
||||
if (sprop->parent != scope->lastProp)
|
||||
goto do_initprop_miss;
|
||||
|
||||
TRACE_2(SetPropHit, entry, sprop);
|
||||
|
||||
/*
|
||||
* Otherwise this entry must be for a direct property of
|
||||
* obj, not a proto-property, and there cannot have been
|
||||
@ -6227,6 +6231,8 @@ js_Interpret(JSContext *cx)
|
||||
rval);
|
||||
LOCKED_OBJ_SET_SLOT(obj, slot, rval);
|
||||
JS_UNLOCK_SCOPE(cx, scope);
|
||||
|
||||
TRACE_2(SetPropHit, entry, sprop);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -56,6 +56,11 @@
|
||||
#include "jsscope.h"
|
||||
#include "jsstr.h"
|
||||
|
||||
/*
|
||||
* Check that we can cast the data after JSObjectMap as JSTitle.
|
||||
*/
|
||||
JS_STATIC_ASSERT(offsetof(JSScope, title) == sizeof(JSObjectMap));
|
||||
|
||||
#define ReadWord(W) (W)
|
||||
|
||||
/* Implement NativeCompareAndSwap. */
|
||||
|
@ -40,9 +40,25 @@
|
||||
#include "jsutil.h"
|
||||
|
||||
/*
|
||||
** Compute the log of the least power of 2 greater than or equal to n
|
||||
*/
|
||||
JS_PUBLIC_API(JSIntn) JS_CeilingLog2(JSUint32 n)
|
||||
* Check that we can use js_bitscan_clz32 to implement JS_FLOOR_LOG2 and
|
||||
* JS_FLOOR_LOG2W and js_bitscan_clz64 to implement JS_FLOOR_LOG2W on 64-bit
|
||||
* systems.
|
||||
*/
|
||||
#ifdef JS_HAS_BUILTIN_BITSCAN32
|
||||
JS_STATIC_ASSERT(sizeof(unsigned int) == sizeof(JSUint32));
|
||||
JS_STATIC_ASSERT_IF(JS_BYTES_PER_WORD == 4,
|
||||
sizeof(unsigned int) == sizeof(JSUword));
|
||||
#endif
|
||||
#ifdef JS_HAS_BUILTIN_BITSCAN64
|
||||
JS_STATIC_ASSERT_IF(JS_BYTES_PER_WORD == 8,
|
||||
sizeof(unsigned long long) == sizeof(JSUword));
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Compute the log of the least power of 2 greater than or equal to n
|
||||
*/
|
||||
JS_PUBLIC_API(JSIntn)
|
||||
JS_CeilingLog2(JSUint32 n)
|
||||
{
|
||||
JSIntn log2;
|
||||
|
||||
@ -51,10 +67,11 @@ JS_PUBLIC_API(JSIntn) JS_CeilingLog2(JSUint32 n)
|
||||
}
|
||||
|
||||
/*
|
||||
** Compute the log of the greatest power of 2 less than or equal to n.
|
||||
** This really just finds the highest set bit in the word.
|
||||
*/
|
||||
JS_PUBLIC_API(JSIntn) JS_FloorLog2(JSUint32 n)
|
||||
* Compute the log of the greatest power of 2 less than or equal to n.
|
||||
* This really just finds the highest set bit in the word.
|
||||
*/
|
||||
JS_PUBLIC_API(JSIntn)
|
||||
JS_FloorLog2(JSUint32 n)
|
||||
{
|
||||
JSIntn log2;
|
||||
|
||||
|
305
js/src/jsobj.cpp
305
js/src/jsobj.cpp
@ -321,23 +321,6 @@ js_SetProtoOrParent(JSContext *cx, JSObject *obj, uint32 slot, JSObject *pobj)
|
||||
}
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Maintain the "any Array prototype has indexed properties hazard" flag by
|
||||
* conservatively setting it. We simply don't know what pobj has in the way
|
||||
* of indexed properties, either directly or along its prototype chain, and
|
||||
* we won't expend effort here to find out. We do know that if obj is not
|
||||
* an array or a prototype (delegate), then we're ok. And, of course, pobj
|
||||
* must be non-null.
|
||||
*
|
||||
* This pessimistic approach could be improved, but setting __proto__ is
|
||||
* quite rare and arguably deserving of deoptimization.
|
||||
*/
|
||||
if (slot == JSSLOT_PROTO &&
|
||||
pobj &&
|
||||
(OBJ_IS_ARRAY(cx, obj) || OBJ_IS_DELEGATE(cx, obj))) {
|
||||
rt->anyArrayProtoHasElement = JS_TRUE;
|
||||
}
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
@ -2021,6 +2004,91 @@ js_Object(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
#ifdef JS_TRACER
|
||||
|
||||
static inline JSObject*
|
||||
NewNativeObject(JSContext* cx, JSObject* proto, JSObject *parent)
|
||||
{
|
||||
JS_ASSERT(JS_ON_TRACE(cx));
|
||||
JSObject* obj = (JSObject*) js_NewGCThing(cx, GCX_OBJECT, sizeof(JSObject));
|
||||
if (!obj)
|
||||
return NULL;
|
||||
|
||||
obj->classword = jsuword(&js_ObjectClass);
|
||||
obj->fslots[JSSLOT_PROTO] = OBJECT_TO_JSVAL(proto);
|
||||
obj->fslots[JSSLOT_PARENT] = OBJECT_TO_JSVAL(parent);
|
||||
for (unsigned i = JSSLOT_PRIVATE; i < JS_INITIAL_NSLOTS; ++i)
|
||||
obj->fslots[i] = JSVAL_VOID;
|
||||
|
||||
JS_ASSERT(!OBJ_GET_CLASS(cx, proto)->getObjectOps);
|
||||
JS_ASSERT(proto->map->ops == &js_ObjectOps);
|
||||
obj->map = js_HoldObjectMap(cx, proto->map);
|
||||
obj->dslots = NULL;
|
||||
return obj;
|
||||
}
|
||||
|
||||
JSObject* FASTCALL
|
||||
js_Object_tn(JSContext* cx, JSObject* proto)
|
||||
{
|
||||
return NewNativeObject(cx, proto, JSVAL_TO_OBJECT(proto->fslots[JSSLOT_PARENT]));
|
||||
}
|
||||
|
||||
JS_DEFINE_TRCINFO_1(js_Object,
|
||||
(2, (extern, CONSTRUCTOR_RETRY, js_Object_tn, CONTEXT, CALLEE_PROTOTYPE, 0, 0)))
|
||||
|
||||
JSObject* FASTCALL
|
||||
js_NewInstance(JSContext* cx, JSObject *ctor)
|
||||
{
|
||||
JS_ASSERT(HAS_FUNCTION_CLASS(ctor));
|
||||
#ifdef DEBUG
|
||||
JSFunction* fun = GET_FUNCTION_PRIVATE(cx, ctor);
|
||||
JS_ASSERT(FUN_INTERPRETED(fun));
|
||||
#endif
|
||||
|
||||
JSAtom* atom = cx->runtime->atomState.classPrototypeAtom;
|
||||
|
||||
JS_LOCK_OBJ(cx, ctor);
|
||||
JSScope *scope = OBJ_SCOPE(ctor);
|
||||
if (scope->object != ctor) {
|
||||
scope = js_GetMutableScope(cx, ctor);
|
||||
if (!scope)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
JSScopeProperty* sprop = SCOPE_GET_PROPERTY(scope, ATOM_TO_JSID(atom));
|
||||
jsval pval = sprop ? LOCKED_OBJ_GET_SLOT(ctor, sprop->slot) : JSVAL_HOLE;
|
||||
JS_UNLOCK_SCOPE(cx, scope);
|
||||
|
||||
JSObject* proto;
|
||||
if (!JSVAL_IS_PRIMITIVE(pval)) {
|
||||
/* An object in ctor.prototype, let's use it as the new instance's proto. */
|
||||
proto = JSVAL_TO_OBJECT(pval);
|
||||
} else if (pval == JSVAL_HOLE) {
|
||||
/* No ctor.prototype yet, inline and optimize fun_resolve's prototype code. */
|
||||
proto = js_NewObject(cx, &js_ObjectClass, NULL, OBJ_GET_PARENT(cx, ctor), 0);
|
||||
if (!proto)
|
||||
return NULL;
|
||||
if (!js_SetClassPrototype(cx, ctor, proto, JSPROP_ENUMERATE | JSPROP_PERMANENT))
|
||||
return NULL;
|
||||
} else {
|
||||
/* Primitive value in .prototype means we use Object.prototype for proto. */
|
||||
if (!js_GetClassPrototype(cx, JSVAL_TO_OBJECT(ctor->fslots[JSSLOT_PARENT]),
|
||||
INT_TO_JSID(JSProto_Object), &proto)) {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return NewNativeObject(cx, proto, JSVAL_TO_OBJECT(ctor->fslots[JSSLOT_PARENT]));
|
||||
}
|
||||
|
||||
JS_DEFINE_CALLINFO_2(extern, CONSTRUCTOR_RETRY, js_NewInstance, CONTEXT, CALLEE_PROTOTYPE, 0, 0)
|
||||
|
||||
#else /* !JS_TRACER */
|
||||
|
||||
# define js_Object_trcinfo NULL
|
||||
|
||||
#endif /* !JS_TRACER */
|
||||
|
||||
/*
|
||||
* Given pc pointing after a property accessing bytecode, return true if the
|
||||
* access is "object-detecting" in the sense used by web scripts, e.g., when
|
||||
@ -2593,9 +2661,157 @@ js_InitEval(JSContext *cx, JSObject *obj)
|
||||
JSObject *
|
||||
js_InitObjectClass(JSContext *cx, JSObject *obj)
|
||||
{
|
||||
return JS_InitClass(cx, obj, NULL, &js_ObjectClass, js_Object, 1,
|
||||
object_props, object_methods, NULL,
|
||||
object_static_methods);
|
||||
return js_InitClass(cx, obj, NULL, &js_ObjectClass, js_Object, 1,
|
||||
object_props, object_methods, NULL, object_static_methods,
|
||||
js_Object_trcinfo);
|
||||
}
|
||||
|
||||
JSObject *
|
||||
js_InitClass(JSContext *cx, JSObject *obj, JSObject *parent_proto,
|
||||
JSClass *clasp, JSNative constructor, uintN nargs,
|
||||
JSPropertySpec *ps, JSFunctionSpec *fs,
|
||||
JSPropertySpec *static_ps, JSFunctionSpec *static_fs,
|
||||
JSTraceableNative *trcinfo)
|
||||
{
|
||||
JSAtom *atom;
|
||||
JSProtoKey key;
|
||||
JSObject *proto, *ctor;
|
||||
JSTempValueRooter tvr;
|
||||
jsval cval, rval;
|
||||
JSBool named;
|
||||
JSFunction *fun;
|
||||
|
||||
atom = js_Atomize(cx, clasp->name, strlen(clasp->name), 0);
|
||||
if (!atom)
|
||||
return NULL;
|
||||
|
||||
/*
|
||||
* When initializing a standard class, if no parent_proto (grand-proto of
|
||||
* instances of the class, parent-proto of the class's prototype object)
|
||||
* is given, we must use Object.prototype if it is available. Otherwise,
|
||||
* we could look up the wrong binding for a class name in obj. Example:
|
||||
*
|
||||
* String = Array;
|
||||
* print("hi there".join);
|
||||
*
|
||||
* should print undefined, not Array.prototype.join. This is required by
|
||||
* ECMA-262, alas. It might have been better to make String readonly and
|
||||
* permanent in the global object, instead -- but that's too big a change
|
||||
* to swallow at this point.
|
||||
*/
|
||||
key = JSCLASS_CACHED_PROTO_KEY(clasp);
|
||||
if (key != JSProto_Null &&
|
||||
!parent_proto &&
|
||||
!js_GetClassPrototype(cx, obj, INT_TO_JSID(JSProto_Object),
|
||||
&parent_proto)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Create a prototype object for this class. */
|
||||
proto = js_NewObject(cx, clasp, parent_proto, obj, 0);
|
||||
if (!proto)
|
||||
return NULL;
|
||||
|
||||
/* After this point, control must exit via label bad or out. */
|
||||
JS_PUSH_TEMP_ROOT_OBJECT(cx, proto, &tvr);
|
||||
|
||||
if (!constructor) {
|
||||
JS_ASSERT(!trcinfo);
|
||||
|
||||
/*
|
||||
* Lacking a constructor, name the prototype (e.g., Math) unless this
|
||||
* class (a) is anonymous, i.e. for internal use only; (b) the class
|
||||
* of obj (the global object) is has a reserved slot indexed by key;
|
||||
* and (c) key is not the null key.
|
||||
*/
|
||||
if ((clasp->flags & JSCLASS_IS_ANONYMOUS) &&
|
||||
(OBJ_GET_CLASS(cx, obj)->flags & JSCLASS_IS_GLOBAL) &&
|
||||
key != JSProto_Null) {
|
||||
named = JS_FALSE;
|
||||
} else {
|
||||
named = OBJ_DEFINE_PROPERTY(cx, obj, ATOM_TO_JSID(atom),
|
||||
OBJECT_TO_JSVAL(proto),
|
||||
JS_PropertyStub, JS_PropertyStub,
|
||||
(clasp->flags & JSCLASS_IS_ANONYMOUS)
|
||||
? JSPROP_READONLY | JSPROP_PERMANENT
|
||||
: 0,
|
||||
NULL);
|
||||
if (!named)
|
||||
goto bad;
|
||||
}
|
||||
|
||||
ctor = proto;
|
||||
} else {
|
||||
/* Define the constructor function in obj's scope. */
|
||||
fun = js_DefineFunction(cx, obj, atom, constructor, nargs,
|
||||
JSFUN_STUB_GSOPS);
|
||||
named = (fun != NULL);
|
||||
if (!fun)
|
||||
goto bad;
|
||||
|
||||
/*
|
||||
* Remember the class this function is a constructor for so that
|
||||
* we know to create an object of this class when we call the
|
||||
* constructor.
|
||||
*/
|
||||
FUN_CLASP(fun) = clasp;
|
||||
|
||||
/*
|
||||
* If we have a traceable native constructor, update the function to
|
||||
* point at the given trcinfo and flag it.
|
||||
*/
|
||||
if (trcinfo) {
|
||||
fun->u.n.trcinfo = trcinfo;
|
||||
fun->flags |= JSFUN_TRACEABLE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Optionally construct the prototype object, before the class has
|
||||
* been fully initialized. Allow the ctor to replace proto with a
|
||||
* different object, as is done for operator new -- and as at least
|
||||
* XML support requires.
|
||||
*/
|
||||
ctor = FUN_OBJECT(fun);
|
||||
if (clasp->flags & JSCLASS_CONSTRUCT_PROTOTYPE) {
|
||||
cval = OBJECT_TO_JSVAL(ctor);
|
||||
if (!js_InternalConstruct(cx, proto, cval, 0, NULL, &rval))
|
||||
goto bad;
|
||||
if (!JSVAL_IS_PRIMITIVE(rval) && JSVAL_TO_OBJECT(rval) != proto)
|
||||
proto = JSVAL_TO_OBJECT(rval);
|
||||
}
|
||||
|
||||
/* Connect constructor and prototype by named properties. */
|
||||
if (!js_SetClassPrototype(cx, ctor, proto,
|
||||
JSPROP_READONLY | JSPROP_PERMANENT)) {
|
||||
goto bad;
|
||||
}
|
||||
|
||||
/* Bootstrap Function.prototype (see also JS_InitStandardClasses). */
|
||||
if (OBJ_GET_CLASS(cx, ctor) == clasp)
|
||||
OBJ_SET_PROTO(cx, ctor, proto);
|
||||
}
|
||||
|
||||
/* Add properties and methods to the prototype and the constructor. */
|
||||
if ((ps && !JS_DefineProperties(cx, proto, ps)) ||
|
||||
(fs && !JS_DefineFunctions(cx, proto, fs)) ||
|
||||
(static_ps && !JS_DefineProperties(cx, ctor, static_ps)) ||
|
||||
(static_fs && !JS_DefineFunctions(cx, ctor, static_fs))) {
|
||||
goto bad;
|
||||
}
|
||||
|
||||
/* If this is a standard class, cache its prototype. */
|
||||
if (key != JSProto_Null && !js_SetClassObject(cx, obj, key, ctor))
|
||||
goto bad;
|
||||
|
||||
out:
|
||||
JS_POP_TEMP_ROOT(cx, &tvr);
|
||||
return proto;
|
||||
|
||||
bad:
|
||||
if (named)
|
||||
(void) OBJ_DELETE_PROPERTY(cx, obj, ATOM_TO_JSID(atom), &rval);
|
||||
proto = NULL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
void
|
||||
@ -2877,7 +3093,7 @@ js_NewObjectWithGivenProto(JSContext *cx, JSClass *clasp, JSObject *proto,
|
||||
STOBJ_SET_PARENT(obj, parent);
|
||||
|
||||
/* Initialize the remaining fixed slots. */
|
||||
for (i = JSSLOT_PRIVATE; i != JS_INITIAL_NSLOTS; ++i)
|
||||
for (i = JSSLOT_PRIVATE; i < JS_INITIAL_NSLOTS; ++i)
|
||||
obj->fslots[i] = JSVAL_VOID;
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -2971,6 +3187,28 @@ earlybad:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
JSObject*
|
||||
js_NewNativeObject(JSContext *cx, JSClass *clasp, JSObject *proto, uint32 slot)
|
||||
{
|
||||
JSObject* obj = (JSObject*) js_NewGCThing(cx, GCX_OBJECT, sizeof(JSObject));
|
||||
if (!obj)
|
||||
return NULL;
|
||||
|
||||
obj->classword = jsuword(clasp);
|
||||
obj->fslots[JSSLOT_PROTO] = OBJECT_TO_JSVAL(proto);
|
||||
obj->fslots[JSSLOT_PARENT] = proto->fslots[JSSLOT_PARENT];
|
||||
|
||||
JS_ASSERT(slot > JSSLOT_PARENT);
|
||||
while (slot < JS_INITIAL_NSLOTS)
|
||||
obj->fslots[slot++] = JSVAL_VOID;
|
||||
|
||||
JS_ASSERT(!clasp->getObjectOps);
|
||||
JS_ASSERT(proto->map->ops == &js_ObjectOps);
|
||||
obj->map = js_HoldObjectMap(cx, proto->map);
|
||||
obj->dslots = NULL;
|
||||
return obj;
|
||||
}
|
||||
|
||||
JS_BEGIN_EXTERN_C
|
||||
|
||||
static JSObject *
|
||||
@ -3343,11 +3581,10 @@ PurgeProtoChain(JSContext *cx, JSObject *obj, jsid id)
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
PurgeScopeChain(JSContext *cx, JSObject *obj, jsid id)
|
||||
void
|
||||
js_PurgeScopeChainHelper(JSContext *cx, JSObject *obj, jsid id)
|
||||
{
|
||||
if (!OBJ_IS_DELEGATE(cx, obj))
|
||||
return;
|
||||
JS_ASSERT(OBJ_IS_DELEGATE(cx, obj));
|
||||
|
||||
/*
|
||||
* All scope chains end in a global object, so this will change the global
|
||||
@ -3376,7 +3613,7 @@ js_AddNativeProperty(JSContext *cx, JSObject *obj, jsid id,
|
||||
* this optimistically (assuming no failure below) before locking obj, so
|
||||
* we can lock the shadowed scope.
|
||||
*/
|
||||
PurgeScopeChain(cx, obj, id);
|
||||
js_PurgeScopeChain(cx, obj, id);
|
||||
|
||||
JS_LOCK_OBJ(cx, obj);
|
||||
scope = js_GetMutableScope(cx, obj);
|
||||
@ -3441,8 +3678,6 @@ js_DefineProperty(JSContext *cx, JSObject *obj, jsid id, jsval value,
|
||||
LOCKED_OBJ_WRITE_BARRIER(cx, obj, (sprop)->slot, *(vp)); \
|
||||
} \
|
||||
} \
|
||||
if (STOBJ_IS_DELEGATE(obj) && JSID_IS_INT(sprop->id)) \
|
||||
cx->runtime->anyArrayProtoHasElement = JS_TRUE; \
|
||||
JS_END_MACRO
|
||||
|
||||
JSBool
|
||||
@ -3510,7 +3745,7 @@ js_DefineNativeProperty(JSContext *cx, JSObject *obj, jsid id, jsval value,
|
||||
* Purge the property cache of now-shadowed id in obj's scope chain.
|
||||
* Do this early, before locking obj to avoid nesting locks.
|
||||
*/
|
||||
PurgeScopeChain(cx, obj, id);
|
||||
js_PurgeScopeChain(cx, obj, id);
|
||||
|
||||
/* Lock if object locking is required by this implementation. */
|
||||
JS_LOCK_OBJ(cx, obj);
|
||||
@ -3985,9 +4220,9 @@ JSBool
|
||||
js_GetPropertyHelper(JSContext *cx, JSObject *obj, jsid id, jsval *vp,
|
||||
JSPropCacheEntry **entryp)
|
||||
{
|
||||
JSObject *aobj, *obj2;
|
||||
uint32 shape;
|
||||
int protoIndex;
|
||||
JSObject *obj2;
|
||||
JSProperty *prop;
|
||||
JSScopeProperty *sprop;
|
||||
|
||||
@ -3995,8 +4230,9 @@ js_GetPropertyHelper(JSContext *cx, JSObject *obj, jsid id, jsval *vp,
|
||||
/* Convert string indices to integers if appropriate. */
|
||||
CHECK_FOR_STRING_INDEX(id);
|
||||
|
||||
shape = OBJ_SHAPE(obj);
|
||||
protoIndex = js_LookupPropertyWithFlags(cx, obj, id, cx->resolveFlags,
|
||||
aobj = js_GetProtoIfDenseArray(cx, obj);
|
||||
shape = OBJ_SHAPE(aobj);
|
||||
protoIndex = js_LookupPropertyWithFlags(cx, aobj, id, cx->resolveFlags,
|
||||
&obj2, &prop);
|
||||
if (protoIndex < 0)
|
||||
return JS_FALSE;
|
||||
@ -4074,7 +4310,7 @@ js_GetPropertyHelper(JSContext *cx, JSObject *obj, jsid id, jsval *vp,
|
||||
|
||||
if (entryp) {
|
||||
JS_ASSERT_NOT_ON_TRACE(cx);
|
||||
js_FillPropertyCache(cx, obj, shape, 0, protoIndex, obj2, sprop, entryp);
|
||||
js_FillPropertyCache(cx, aobj, shape, 0, protoIndex, obj2, sprop, entryp);
|
||||
}
|
||||
JS_UNLOCK_OBJ(cx, obj2);
|
||||
return JS_TRUE;
|
||||
@ -4241,7 +4477,7 @@ js_SetPropertyHelper(JSContext *cx, JSObject *obj, jsid id, jsval *vp,
|
||||
* Purge the property cache of now-shadowed id in obj's scope chain.
|
||||
* Do this early, before locking obj to avoid nesting locks.
|
||||
*/
|
||||
PurgeScopeChain(cx, obj, id);
|
||||
js_PurgeScopeChain(cx, obj, id);
|
||||
|
||||
/* Find or make a property descriptor with the right heritage. */
|
||||
JS_LOCK_OBJ(cx, obj);
|
||||
@ -5592,6 +5828,7 @@ js_SetRequiredSlot(JSContext *cx, JSObject *obj, uint32 slot, jsval v)
|
||||
scope->map.freeslot = slot + 1;
|
||||
|
||||
STOBJ_SET_SLOT(obj, slot, v);
|
||||
GC_POKE(cx, JS_NULL);
|
||||
JS_UNLOCK_SCOPE(cx, scope);
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
@ -438,6 +438,13 @@ js_InitEval(JSContext *cx, JSObject *obj);
|
||||
extern JSObject *
|
||||
js_InitObjectClass(JSContext *cx, JSObject *obj);
|
||||
|
||||
extern JSObject *
|
||||
js_InitClass(JSContext *cx, JSObject *obj, JSObject *parent_proto,
|
||||
JSClass *clasp, JSNative constructor, uintN nargs,
|
||||
JSPropertySpec *ps, JSFunctionSpec *fs,
|
||||
JSPropertySpec *static_ps, JSFunctionSpec *static_fs,
|
||||
JSTraceableNative *trcinfo);
|
||||
|
||||
/*
|
||||
* Select Object.prototype method names shared between jsapi.cpp and jsobj.cpp.
|
||||
*/
|
||||
@ -485,6 +492,19 @@ extern JSObject *
|
||||
js_NewObjectWithGivenProto(JSContext *cx, JSClass *clasp, JSObject *proto,
|
||||
JSObject *parent, uintN objectSize);
|
||||
|
||||
/*
|
||||
* Allocate a new native object and initialize all fslots with JSVAL_VOID
|
||||
* starting with the specified slot. The parent slot is set to the value of
|
||||
* proto's parent slot.
|
||||
*
|
||||
* Note that this is the correct global object for native class instances, but
|
||||
* not for user-defined functions called as constructors. Functions used as
|
||||
* constructors must create instances parented by the parent of the function
|
||||
* object, not by the parent of its .prototype object value.
|
||||
*/
|
||||
extern JSObject*
|
||||
js_NewNativeObject(JSContext *cx, JSClass *clasp, JSObject *proto, uint32 slot);
|
||||
|
||||
/*
|
||||
* Fast access to immutable standard objects (constructors and prototypes).
|
||||
*/
|
||||
@ -540,6 +560,22 @@ extern jsid
|
||||
js_CheckForStringIndex(jsid id, const jschar *cp, const jschar *end,
|
||||
JSBool negative);
|
||||
|
||||
/*
|
||||
* js_PurgeScopeChain does nothing if obj is not itself a prototype or parent
|
||||
* scope, else it reshapes the scope and prototype chains it links. It calls
|
||||
* js_PurgeScopeChainHelper, which asserts that obj is flagged as a delegate
|
||||
* (i.e., obj has ever been on a prototype or parent chain).
|
||||
*/
|
||||
extern void
|
||||
js_PurgeScopeChainHelper(JSContext *cx, JSObject *obj, jsid id);
|
||||
|
||||
static JS_INLINE void
|
||||
js_PurgeScopeChain(JSContext *cx, JSObject *obj, jsid id)
|
||||
{
|
||||
if (OBJ_IS_DELEGATE(cx, obj))
|
||||
js_PurgeScopeChainHelper(cx, obj, id);
|
||||
}
|
||||
|
||||
/*
|
||||
* Find or create a property named by id in obj's scope, with the given getter
|
||||
* and setter, slot, attributes, and other members.
|
||||
|
@ -75,6 +75,11 @@
|
||||
|
||||
#include "jsautooplen.h"
|
||||
|
||||
/*
|
||||
* Index limit must stay within 32 bits.
|
||||
*/
|
||||
JS_STATIC_ASSERT(sizeof(uint32) * JS_BITS_PER_BYTE >= INDEX_LIMIT_LOG2 + 1);
|
||||
|
||||
/* Verify JSOP_XXX_LENGTH constant definitions. */
|
||||
#define OPDEF(op,val,name,token,length,nuses,ndefs,prec,format) \
|
||||
JS_STATIC_ASSERT(op##_LENGTH == length);
|
||||
|
@ -225,8 +225,6 @@ typedef enum JSOp {
|
||||
#define INDEX_LIMIT_LOG2 23
|
||||
#define INDEX_LIMIT ((uint32)1 << INDEX_LIMIT_LOG2)
|
||||
|
||||
JS_STATIC_ASSERT(sizeof(uint32) * JS_BITS_PER_BYTE >= INDEX_LIMIT_LOG2 + 1);
|
||||
|
||||
/* Actual argument count operand format helpers. */
|
||||
#define ARGC_HI(argc) UINT16_HI(argc)
|
||||
#define ARGC_LO(argc) UINT16_LO(argc)
|
||||
|
@ -261,19 +261,4 @@ struct JSTempValueRooter {
|
||||
extern JSBool js_CStringsAreUTF8;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Helper macros to convert between function and data pointers assuming that
|
||||
* they have the same size.
|
||||
*/
|
||||
JS_STATIC_ASSERT(sizeof(void *) == sizeof(void (*)()));
|
||||
|
||||
#ifdef __GNUC__
|
||||
# define JS_FUNC_TO_DATA_PTR(type, fun) (__extension__ (type) (fun))
|
||||
# define JS_DATA_TO_FUNC_PTR(type, ptr) (__extension__ (type) (ptr))
|
||||
#else
|
||||
/* Use an extra (void *) cast for MSVC. */
|
||||
# define JS_FUNC_TO_DATA_PTR(type, fun) ((type) (void *) (fun))
|
||||
# define JS_DATA_TO_FUNC_PTR(type, ptr) ((type) (void *) (ptr))
|
||||
#endif
|
||||
|
||||
#endif /* jsprvtd_h___ */
|
||||
|
@ -2149,7 +2149,7 @@ class RegExpNativeCompiler {
|
||||
}
|
||||
}
|
||||
|
||||
LIns* to_fail = lir->insBranch(LIR_jf, lir->ins2(LIR_lt, pos, cpend), 0);
|
||||
LIns* to_fail = lir->insBranch(LIR_jf, lir->ins2(LIR_lt, pos, lir->ins2(LIR_sub, cpend, lir->insImm(2))), 0);
|
||||
fails.add(to_fail);
|
||||
LIns* text_word = lir->insLoad(LIR_ld, pos, lir->insImm(0));
|
||||
LIns* comp_word = useFastCI ?
|
||||
@ -4950,35 +4950,80 @@ RegExp(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
return regexp_compile_sub(cx, obj, argc, argv, rval);
|
||||
}
|
||||
|
||||
#ifdef JS_TRACER
|
||||
|
||||
static JSObject* FASTCALL
|
||||
RegExp_tn1(JSContext *cx, JSObject *proto, JSString *str)
|
||||
{
|
||||
JSObject* obj = js_NewNativeObject(cx, &js_RegExpClass, proto, JSSLOT_PRIVATE);
|
||||
if (!obj)
|
||||
return NULL;
|
||||
|
||||
jsval argv[] = { JSVAL_NULL, OBJECT_TO_JSVAL(obj), STRING_TO_JSVAL(str) };
|
||||
jsval rval;
|
||||
|
||||
if (!regexp_compile_sub(cx, obj, 1, argv + 2, &rval))
|
||||
return NULL;
|
||||
|
||||
JS_ASSERT(JSVAL_IS_OBJECT(rval));
|
||||
return JSVAL_TO_OBJECT(rval);
|
||||
}
|
||||
|
||||
static JSObject* FASTCALL
|
||||
RegExp_tn2(JSContext *cx, JSObject *proto, JSString *str, JSString *opt)
|
||||
{
|
||||
JSObject* obj = js_NewNativeObject(cx, &js_RegExpClass, proto, JSSLOT_PRIVATE);
|
||||
if (!obj)
|
||||
return NULL;
|
||||
|
||||
jsval argv[] = { JSVAL_NULL, OBJECT_TO_JSVAL(obj), STRING_TO_JSVAL(str), STRING_TO_JSVAL(opt) };
|
||||
jsval rval;
|
||||
|
||||
if (!regexp_compile_sub(cx, obj, 2, argv + 2, &rval))
|
||||
return NULL;
|
||||
|
||||
JS_ASSERT(JSVAL_IS_OBJECT(rval));
|
||||
return JSVAL_TO_OBJECT(rval);
|
||||
}
|
||||
|
||||
JS_DEFINE_TRCINFO_2(RegExp,
|
||||
(3, (extern, CONSTRUCTOR_RETRY, RegExp_tn1, CONTEXT, CALLEE_PROTOTYPE, STRING, 0, 0)),
|
||||
(4, (extern, CONSTRUCTOR_RETRY, RegExp_tn2, CONTEXT, CALLEE_PROTOTYPE, STRING, STRING, 0, 0)))
|
||||
|
||||
#else /* !JS_TRACER */
|
||||
|
||||
# define RegExp_trcinfo NULL
|
||||
|
||||
#endif /* !JS_TRACER */
|
||||
|
||||
JSObject *
|
||||
js_InitRegExpClass(JSContext *cx, JSObject *obj)
|
||||
{
|
||||
JSObject *proto, *ctor;
|
||||
jsval rval;
|
||||
JSObject *proto = js_InitClass(cx, obj, NULL, &js_RegExpClass, RegExp, 1,
|
||||
regexp_props, regexp_methods,
|
||||
regexp_static_props, NULL,
|
||||
RegExp_trcinfo);
|
||||
|
||||
proto = JS_InitClass(cx, obj, NULL, &js_RegExpClass, RegExp, 1,
|
||||
regexp_props, regexp_methods,
|
||||
regexp_static_props, NULL);
|
||||
|
||||
if (!proto || !(ctor = JS_GetConstructor(cx, proto)))
|
||||
if (!proto)
|
||||
return NULL;
|
||||
|
||||
JSObject *ctor = JS_GetConstructor(cx, proto);
|
||||
if (!ctor)
|
||||
return NULL;
|
||||
|
||||
/* Give RegExp.prototype private data so it matches the empty string. */
|
||||
jsval rval;
|
||||
if (!JS_AliasProperty(cx, ctor, "input", "$_") ||
|
||||
!JS_AliasProperty(cx, ctor, "multiline", "$*") ||
|
||||
!JS_AliasProperty(cx, ctor, "lastMatch", "$&") ||
|
||||
!JS_AliasProperty(cx, ctor, "lastParen", "$+") ||
|
||||
!JS_AliasProperty(cx, ctor, "leftContext", "$`") ||
|
||||
!JS_AliasProperty(cx, ctor, "rightContext", "$'")) {
|
||||
goto bad;
|
||||
!JS_AliasProperty(cx, ctor, "rightContext", "$'") ||
|
||||
!regexp_compile_sub(cx, proto, 0, NULL, &rval)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Give RegExp.prototype private data so it matches the empty string. */
|
||||
if (!regexp_compile_sub(cx, proto, 0, NULL, &rval))
|
||||
goto bad;
|
||||
return proto;
|
||||
|
||||
bad:
|
||||
JS_DeleteProperty(cx, obj, js_RegExpClass.name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
JSObject *
|
||||
|
@ -57,6 +57,7 @@
|
||||
#include "jsnum.h"
|
||||
#include "jsscope.h"
|
||||
#include "jsstr.h"
|
||||
#include "jsarray.h"
|
||||
|
||||
JSScope *
|
||||
js_GetMutableScope(JSContext *cx, JSObject *obj)
|
||||
@ -1304,6 +1305,10 @@ js_AddScopeProperty(JSContext *cx, JSScope *scope, jsid id,
|
||||
(void) CreateScopeTable(cx, scope, JS_FALSE);
|
||||
}
|
||||
|
||||
jsuint index;
|
||||
if (js_IdIsIndex(sprop->id, &index))
|
||||
SCOPE_SET_INDEXED_PROPERTIES(scope);
|
||||
|
||||
METER(adds);
|
||||
return sprop;
|
||||
|
||||
|
@ -211,10 +211,6 @@ struct JSScope {
|
||||
JSScopeProperty *lastProp; /* pointer to last property added */
|
||||
};
|
||||
|
||||
#ifdef JS_THREADSAFE
|
||||
JS_STATIC_ASSERT(offsetof(JSScope, title) == sizeof(JSObjectMap));
|
||||
#endif
|
||||
|
||||
#define JS_IS_SCOPE_LOCKED(cx, scope) JS_IS_TITLE_LOCKED(cx, &(scope)->title)
|
||||
|
||||
#define OBJ_SCOPE(obj) ((JSScope *)(obj)->map)
|
||||
@ -240,10 +236,13 @@ JS_STATIC_ASSERT(offsetof(JSScope, title) == sizeof(JSObjectMap));
|
||||
#define SCOPE_MIDDLE_DELETE 0x0001
|
||||
#define SCOPE_SEALED 0x0002
|
||||
#define SCOPE_BRANDED 0x0004
|
||||
#define SCOPE_INDEXED_PROPERTIES 0x0008
|
||||
|
||||
#define SCOPE_HAD_MIDDLE_DELETE(scope) ((scope)->flags & SCOPE_MIDDLE_DELETE)
|
||||
#define SCOPE_SET_MIDDLE_DELETE(scope) ((scope)->flags |= SCOPE_MIDDLE_DELETE)
|
||||
#define SCOPE_CLR_MIDDLE_DELETE(scope) ((scope)->flags &= ~SCOPE_MIDDLE_DELETE)
|
||||
#define SCOPE_HAS_INDEXED_PROPERTIES(scope) ((scope)->flags & SCOPE_INDEXED_PROPERTIES)
|
||||
#define SCOPE_SET_INDEXED_PROPERTIES(scope) ((scope)->flags |= SCOPE_INDEXED_PROPERTIES)
|
||||
|
||||
#define SCOPE_IS_SEALED(scope) ((scope)->flags & SCOPE_SEALED)
|
||||
#define SCOPE_SET_SEALED(scope) ((scope)->flags |= SCOPE_SEALED)
|
||||
|
@ -2556,7 +2556,7 @@ JS_DEFINE_TRCINFO_3(str_replace,
|
||||
(4, (static, STRING_RETRY, String_p_replace_str2, CONTEXT, THIS_STRING, STRING, STRING, 1, 1)),
|
||||
(5, (static, STRING_RETRY, String_p_replace_str3, CONTEXT, THIS_STRING, STRING, STRING, STRING, 1, 1)))
|
||||
JS_DEFINE_TRCINFO_1(str_split,
|
||||
(3, (static, OBJECT_RETRY_NULL, String_p_split, CONTEXT, THIS_STRING, STRING, 0, 0)))
|
||||
(3, (static, OBJECT_RETRY, String_p_split, CONTEXT, THIS_STRING, STRING, 0, 0)))
|
||||
JS_DEFINE_TRCINFO_1(str_toLowerCase,
|
||||
(2, (extern, STRING_RETRY, js_toLowerCase, CONTEXT, THIS_STRING, 1, 1)))
|
||||
JS_DEFINE_TRCINFO_1(str_toUpperCase,
|
||||
|
@ -97,7 +97,7 @@ static const char tagChar[] = "OIDISIBI";
|
||||
#define HOTLOOP 2
|
||||
|
||||
/* Attempt recording this many times before blacklisting permanently. */
|
||||
#define BL_ATTEMPTS 6
|
||||
#define BL_ATTEMPTS 2
|
||||
|
||||
/* Skip this many future hits before allowing recording again after blacklisting. */
|
||||
#define BL_BACKOFF 32
|
||||
@ -241,6 +241,7 @@ static bool did_we_check_sse2 = false;
|
||||
|
||||
#ifdef JS_JIT_SPEW
|
||||
bool js_verboseDebug = getenv("TRACEMONKEY") && strstr(getenv("TRACEMONKEY"), "verbose");
|
||||
bool js_verboseStats = getenv("TRACEMONKEY") && strstr(getenv("TRACEMONKEY"), "stats");
|
||||
#endif
|
||||
|
||||
/* The entire VM shares one oracle. Collisions and concurrent updates are tolerated and worst
|
||||
@ -474,13 +475,6 @@ js_Backoff(Fragment* tree, const jsbytecode* where)
|
||||
tree->hits() -= BL_BACKOFF;
|
||||
}
|
||||
|
||||
static void
|
||||
js_AttemptCompilation(Fragment* tree)
|
||||
{
|
||||
--tree->recordAttempts;
|
||||
tree->hits() = 0;
|
||||
}
|
||||
|
||||
static inline size_t
|
||||
fragmentHash(const void *ip, uint32 globalShape)
|
||||
{
|
||||
@ -549,6 +543,25 @@ getAnchor(JSTraceMonitor* tm, const void *ip, uint32 globalShape)
|
||||
return f;
|
||||
}
|
||||
|
||||
static void
|
||||
js_AttemptCompilation(JSTraceMonitor* tm, JSObject* globalObj, jsbytecode* pc)
|
||||
{
|
||||
Fragment* f = getLoop(tm, pc, OBJ_SHAPE(globalObj));
|
||||
JS_ASSERT(f->root == f);
|
||||
/*
|
||||
* Breath new live into all peer fragments at the designated loop header. If we already
|
||||
* permanently blacklisted the location, undo that.
|
||||
*/
|
||||
f = f->first;
|
||||
while (f) {
|
||||
JS_ASSERT(f->root == f);
|
||||
JS_ASSERT(*(jsbytecode*)f->ip == JSOP_NOP || *(jsbytecode*)f->ip == JSOP_LOOP);
|
||||
*(jsbytecode*)f->ip = JSOP_LOOP;
|
||||
--f->recordAttempts;
|
||||
f->hits() = HOTLOOP;
|
||||
f = f->peer;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NJ_SOFTFLOAT)
|
||||
JS_DEFINE_CALLINFO_1(static, DOUBLE, i2f, INT32, 1, 1)
|
||||
@ -1183,7 +1196,7 @@ js_TrashTree(JSContext* cx, Fragment* f);
|
||||
JS_REQUIRES_STACK
|
||||
TraceRecorder::TraceRecorder(JSContext* cx, VMSideExit* _anchor, Fragment* _fragment,
|
||||
TreeInfo* ti, unsigned stackSlots, unsigned ngslots, uint8* typeMap,
|
||||
VMSideExit* innermostNestedGuard, Fragment* outer)
|
||||
VMSideExit* innermostNestedGuard, jsbytecode* outer)
|
||||
{
|
||||
JS_ASSERT(!_fragment->vmprivate && ti);
|
||||
|
||||
@ -1812,6 +1825,27 @@ TraceRecorder::import(TreeInfo* treeInfo, LIns* sp, unsigned stackSlots, unsigne
|
||||
);
|
||||
}
|
||||
|
||||
JS_REQUIRES_STACK bool
|
||||
TraceRecorder::isValidSlot(JSScope* scope, JSScopeProperty* sprop)
|
||||
{
|
||||
uint32 setflags = (js_CodeSpec[*cx->fp->regs->pc].format & (JOF_SET | JOF_INCDEC | JOF_FOR));
|
||||
|
||||
if (setflags) {
|
||||
if (!SPROP_HAS_STUB_SETTER(sprop))
|
||||
ABORT_TRACE("non-stub setter");
|
||||
if (sprop->attrs & JSPROP_READONLY)
|
||||
ABORT_TRACE("writing to a read-only property");
|
||||
}
|
||||
/* This check applies even when setflags == 0. */
|
||||
if (setflags != JOF_SET && !SPROP_HAS_STUB_GETTER(sprop))
|
||||
ABORT_TRACE("non-stub getter");
|
||||
|
||||
if (!SPROP_HAS_VALID_SLOT(sprop, scope))
|
||||
ABORT_TRACE("slotless obj property");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Lazily import a global slot if we don't already have it in the tracker. */
|
||||
JS_REQUIRES_STACK bool
|
||||
TraceRecorder::lazilyImportGlobalSlot(unsigned slot)
|
||||
@ -2457,7 +2491,7 @@ TraceRecorder::compile(JSTraceMonitor* tm)
|
||||
Fragmento* fragmento = tm->fragmento;
|
||||
if (treeInfo->maxNativeStackSlots >= MAX_NATIVE_STACK_SLOTS) {
|
||||
debug_only_v(printf("Blacklist: excessive stack use.\n"));
|
||||
js_Blacklist(fragment);
|
||||
js_Blacklist(fragment->root);
|
||||
return;
|
||||
}
|
||||
if (anchor && anchor->exitType != CASE_EXIT)
|
||||
@ -2471,7 +2505,7 @@ TraceRecorder::compile(JSTraceMonitor* tm)
|
||||
return;
|
||||
if (fragmento->assm()->error() != nanojit::None) {
|
||||
debug_only_v(printf("Blacklisted: error during compilation\n");)
|
||||
js_Blacklist(fragment);
|
||||
js_Blacklist(fragment->root);
|
||||
return;
|
||||
}
|
||||
if (anchor) {
|
||||
@ -2535,7 +2569,7 @@ TraceRecorder::closeLoop(JSTraceMonitor* tm, bool& demote)
|
||||
|
||||
if (callDepth != 0) {
|
||||
debug_only_v(printf("Blacklisted: stack depth mismatch, possible recursion.\n");)
|
||||
js_Blacklist(fragment);
|
||||
js_Blacklist(fragment->root);
|
||||
trashSelf = true;
|
||||
return false;
|
||||
}
|
||||
@ -2619,8 +2653,8 @@ TraceRecorder::closeLoop(JSTraceMonitor* tm, bool& demote)
|
||||
* If this is a newly formed tree, and the outer tree has not been compiled yet, we
|
||||
* should try to compile the outer tree again.
|
||||
*/
|
||||
if (outer && fragment == fragment->root)
|
||||
js_AttemptCompilation(outer);
|
||||
if (outer)
|
||||
js_AttemptCompilation(tm, globalObj, outer);
|
||||
|
||||
debug_only_v(printf("recording completed at %s:%u@%u via closeLoop\n",
|
||||
cx->fp->script->filename,
|
||||
@ -2716,7 +2750,7 @@ TraceRecorder::endLoop(JSTraceMonitor* tm)
|
||||
|
||||
if (callDepth != 0) {
|
||||
debug_only_v(printf("Blacklisted: stack depth mismatch, possible recursion.\n");)
|
||||
js_Blacklist(fragment);
|
||||
js_Blacklist(fragment->root);
|
||||
trashSelf = true;
|
||||
return;
|
||||
}
|
||||
@ -2739,8 +2773,8 @@ TraceRecorder::endLoop(JSTraceMonitor* tm)
|
||||
* If this is a newly formed tree, and the outer tree has not been compiled yet, we
|
||||
* should try to compile the outer tree again.
|
||||
*/
|
||||
if (outer && fragment == fragment->root)
|
||||
js_AttemptCompilation(outer);
|
||||
if (outer)
|
||||
js_AttemptCompilation(tm, globalObj, outer);
|
||||
|
||||
debug_only_v(printf("recording completed at %s:%u@%u via endLoop\n",
|
||||
cx->fp->script->filename,
|
||||
@ -3001,7 +3035,7 @@ js_CheckGlobalObjectShape(JSContext* cx, JSTraceMonitor* tm, JSObject* globalObj
|
||||
AUDIT(globalShapeMismatchAtEntry);
|
||||
debug_only_v(printf("Global shape mismatch (%u vs. %u), flushing cache.\n",
|
||||
globalShape, ti->globalShape);)
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
if (shape)
|
||||
*shape = globalShape;
|
||||
@ -3012,7 +3046,6 @@ js_CheckGlobalObjectShape(JSContext* cx, JSTraceMonitor* tm, JSObject* globalObj
|
||||
|
||||
/* No recorder, search for a tracked global-state (or allocate one). */
|
||||
for (size_t i = 0; i < MONITOR_N_GLOBAL_STATES; ++i) {
|
||||
|
||||
GlobalState &state = tm->globalStates[i];
|
||||
|
||||
if (state.globalShape == (uint32) -1) {
|
||||
@ -3040,7 +3073,7 @@ js_CheckGlobalObjectShape(JSContext* cx, JSTraceMonitor* tm, JSObject* globalObj
|
||||
static JS_REQUIRES_STACK bool
|
||||
js_StartRecorder(JSContext* cx, VMSideExit* anchor, Fragment* f, TreeInfo* ti,
|
||||
unsigned stackSlots, unsigned ngslots, uint8* typeMap,
|
||||
VMSideExit* expectedInnerExit, Fragment* outer)
|
||||
VMSideExit* expectedInnerExit, jsbytecode* outer)
|
||||
{
|
||||
JSTraceMonitor* tm = &JS_TRACE_MONITOR(cx);
|
||||
JS_ASSERT(f->root != f || !cx->fp->imacpc);
|
||||
@ -3266,7 +3299,7 @@ js_SynthesizeFrame(JSContext* cx, const FrameInfo& fi)
|
||||
}
|
||||
|
||||
JS_REQUIRES_STACK bool
|
||||
js_RecordTree(JSContext* cx, JSTraceMonitor* tm, Fragment* f, Fragment* outer,
|
||||
js_RecordTree(JSContext* cx, JSTraceMonitor* tm, Fragment* f, jsbytecode* outer,
|
||||
uint32 globalShape, SlotList* globalSlots)
|
||||
{
|
||||
JS_ASSERT(f->root == f);
|
||||
@ -3356,7 +3389,7 @@ isSlotUndemotable(JSContext* cx, TreeInfo* ti, unsigned slot)
|
||||
}
|
||||
|
||||
JS_REQUIRES_STACK static bool
|
||||
js_AttemptToStabilizeTree(JSContext* cx, VMSideExit* exit, Fragment* outer)
|
||||
js_AttemptToStabilizeTree(JSContext* cx, VMSideExit* exit, jsbytecode* outer)
|
||||
{
|
||||
JSTraceMonitor* tm = &JS_TRACE_MONITOR(cx);
|
||||
Fragment* from = exit->from->root;
|
||||
@ -3453,7 +3486,7 @@ js_AttemptToStabilizeTree(JSContext* cx, VMSideExit* exit, Fragment* outer)
|
||||
}
|
||||
|
||||
static JS_REQUIRES_STACK bool
|
||||
js_AttemptToExtendTree(JSContext* cx, VMSideExit* anchor, VMSideExit* exitedFrom, Fragment* outer)
|
||||
js_AttemptToExtendTree(JSContext* cx, VMSideExit* anchor, VMSideExit* exitedFrom, jsbytecode* outer)
|
||||
{
|
||||
Fragment* f = anchor->from->root;
|
||||
JS_ASSERT(f->vmprivate);
|
||||
@ -3475,7 +3508,7 @@ js_AttemptToExtendTree(JSContext* cx, VMSideExit* anchor, VMSideExit* exitedFrom
|
||||
debug_only_v(printf("trying to attach another branch to the tree (hits = %d)\n", c->hits());)
|
||||
|
||||
int32_t& hits = c->hits();
|
||||
if (hits++ >= HOTEXIT && hits <= HOTEXIT+MAXEXIT) {
|
||||
if (outer || hits++ >= HOTEXIT && hits <= HOTEXIT+MAXEXIT) {
|
||||
/* start tracing secondary trace from this point */
|
||||
c->lirbuf = f->lirbuf;
|
||||
unsigned stackSlots;
|
||||
@ -3571,6 +3604,13 @@ js_RecordLoopEdge(JSContext* cx, TraceRecorder* r, uintN& inlineCallCount)
|
||||
Fragment* f = getLoop(&JS_TRACE_MONITOR(cx), cx->fp->regs->pc, ti->globalShape);
|
||||
if (nesting_enabled && f) {
|
||||
|
||||
/* Cannot handle treecalls with callDepth > 0 and argc > nargs, see bug 480244. */
|
||||
if (r->getCallDepth() > 0 &&
|
||||
cx->fp->argc > cx->fp->fun->nargs) {
|
||||
js_AbortRecording(cx, "Can't call inner tree with extra args in pending frame");
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Make sure inner tree call will not run into an out-of-memory condition. */
|
||||
if (tm->reservedDoublePoolPtr < (tm->reservedDoublePool + MAX_NATIVE_STACK_SLOTS) &&
|
||||
!js_ReplenishReservedPool(cx, tm)) {
|
||||
@ -3603,11 +3643,8 @@ js_RecordLoopEdge(JSContext* cx, TraceRecorder* r, uintN& inlineCallCount)
|
||||
|
||||
if (!success) {
|
||||
AUDIT(noCompatInnerTrees);
|
||||
debug_only_v(printf("No compatible inner tree (%p).\n", (void*)f);)
|
||||
|
||||
Fragment* old = getLoop(tm, tm->recorder->getFragment()->root->ip, ti->globalShape);
|
||||
if (old == NULL)
|
||||
old = tm->recorder->getFragment();
|
||||
jsbytecode* outer = (jsbytecode*)tm->recorder->getFragment()->root->ip;
|
||||
js_AbortRecording(cx, "No compatible inner tree");
|
||||
|
||||
f = empty;
|
||||
@ -3618,7 +3655,7 @@ js_RecordLoopEdge(JSContext* cx, TraceRecorder* r, uintN& inlineCallCount)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return js_RecordTree(cx, tm, f, old, globalShape, globalSlots);
|
||||
return js_RecordTree(cx, tm, f, outer, globalShape, globalSlots);
|
||||
}
|
||||
|
||||
r->prepareTreeCall(f);
|
||||
@ -3629,27 +3666,26 @@ js_RecordLoopEdge(JSContext* cx, TraceRecorder* r, uintN& inlineCallCount)
|
||||
js_AbortRecording(cx, "Couldn't call inner tree");
|
||||
return false;
|
||||
}
|
||||
Fragment* old;
|
||||
jsbytecode* outer = (jsbytecode*)tm->recorder->getFragment()->root->ip;
|
||||
switch (lr->exitType) {
|
||||
case LOOP_EXIT:
|
||||
/* If the inner tree exited on an unknown loop exit, grow the tree around it. */
|
||||
if (innermostNestedGuard) {
|
||||
js_AbortRecording(cx, "Inner tree took different side exit, abort recording");
|
||||
return js_AttemptToExtendTree(cx, innermostNestedGuard, lr, NULL);
|
||||
js_AbortRecording(cx, "Inner tree took different side exit, abort current "
|
||||
"recording and grow nesting tree");
|
||||
return js_AttemptToExtendTree(cx, innermostNestedGuard, lr, outer);
|
||||
}
|
||||
/* emit a call to the inner tree and continue recording the outer tree trace */
|
||||
r->emitTreeCall(f, lr);
|
||||
return true;
|
||||
case UNSTABLE_LOOP_EXIT:
|
||||
/* abort recording so the inner loop can become type stable. */
|
||||
old = getLoop(tm, tm->recorder->getFragment()->root->ip, ti->globalShape);
|
||||
js_AbortRecording(cx, "Inner tree is trying to stabilize, abort outer recording");
|
||||
return js_AttemptToStabilizeTree(cx, lr, old);
|
||||
return js_AttemptToStabilizeTree(cx, lr, outer);
|
||||
case BRANCH_EXIT:
|
||||
/* abort recording the outer tree, extend the inner tree */
|
||||
old = getLoop(tm, tm->recorder->getFragment()->root->ip, ti->globalShape);
|
||||
js_AbortRecording(cx, "Inner tree is trying to grow, abort outer recording");
|
||||
return js_AttemptToExtendTree(cx, lr, NULL, old);
|
||||
return js_AttemptToExtendTree(cx, lr, NULL, outer);
|
||||
default:
|
||||
debug_only_v(printf("exit_type=%d\n", lr->exitType);)
|
||||
js_AbortRecording(cx, "Inner tree not suitable for calling");
|
||||
@ -4262,7 +4298,7 @@ js_MonitorLoopEdge(JSContext* cx, uintN& inlineCallCount)
|
||||
/* If we hit the max peers ceiling, don't try to lookup fragments all the time. Thats
|
||||
expensive. This must be a rather type-unstable loop. */
|
||||
debug_only_v(printf("Blacklisted: too many peer trees.\n");)
|
||||
js_Blacklist(f);
|
||||
js_Blacklist(f->root);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -4480,7 +4516,7 @@ js_CheckForSSE2()
|
||||
}
|
||||
#endif
|
||||
|
||||
extern void
|
||||
void
|
||||
js_InitJIT(JSTraceMonitor *tm)
|
||||
{
|
||||
#if defined NANOJIT_IA32
|
||||
@ -4518,11 +4554,11 @@ js_InitJIT(JSTraceMonitor *tm)
|
||||
#endif
|
||||
}
|
||||
|
||||
extern void
|
||||
void
|
||||
js_FinishJIT(JSTraceMonitor *tm)
|
||||
{
|
||||
#ifdef JS_JIT_SPEW
|
||||
if (jitstats.recorderStarted) {
|
||||
if (js_verboseStats && jitstats.recorderStarted) {
|
||||
printf("recorder: started(%llu), aborted(%llu), completed(%llu), different header(%llu), "
|
||||
"trees trashed(%llu), slot promoted(%llu), unstable loop variable(%llu), "
|
||||
"breaks(%llu), returns(%llu), unstableInnerCalls(%llu)\n",
|
||||
@ -4591,7 +4627,7 @@ TraceRecorder::popAbortStack()
|
||||
nextRecorderToAbort = NULL;
|
||||
}
|
||||
|
||||
extern void
|
||||
void
|
||||
js_FlushJITOracle(JSContext* cx)
|
||||
{
|
||||
if (!TRACING_ENABLED(cx))
|
||||
@ -4599,7 +4635,7 @@ js_FlushJITOracle(JSContext* cx)
|
||||
oracle.clear();
|
||||
}
|
||||
|
||||
extern JS_REQUIRES_STACK void
|
||||
JS_REQUIRES_STACK void
|
||||
js_FlushScriptFragments(JSContext* cx, JSScript* script)
|
||||
{
|
||||
if (!TRACING_ENABLED(cx))
|
||||
@ -4625,7 +4661,7 @@ js_FlushScriptFragments(JSContext* cx, JSScript* script)
|
||||
}
|
||||
}
|
||||
|
||||
extern JS_REQUIRES_STACK void
|
||||
JS_REQUIRES_STACK void
|
||||
js_FlushJITCache(JSContext* cx)
|
||||
{
|
||||
if (!TRACING_ENABLED(cx))
|
||||
@ -4742,21 +4778,21 @@ TraceRecorder::activeCallOrGlobalSlot(JSObject* obj, jsval*& vp)
|
||||
if (js_FindProperty(cx, ATOM_TO_JSID(atom), &obj, &obj2, &prop) < 0 || !prop)
|
||||
ABORT_TRACE("failed to find name in non-global scope chain");
|
||||
|
||||
uint32 setflags = (js_CodeSpec[*cx->fp->regs->pc].format & (JOF_SET | JOF_INCDEC | JOF_FOR));
|
||||
|
||||
if (obj == globalObj) {
|
||||
JSScopeProperty* sprop = (JSScopeProperty*) prop;
|
||||
|
||||
if (setflags && (sprop->attrs & JSPROP_READONLY))
|
||||
ABORT_TRACE("writing to a readonly property");
|
||||
|
||||
if (obj2 != obj || !SPROP_HAS_VALID_SLOT(sprop, OBJ_SCOPE(obj))) {
|
||||
if (obj2 != obj) {
|
||||
OBJ_DROP_PROPERTY(cx, obj2, prop);
|
||||
ABORT_TRACE("prototype or slotless globalObj property");
|
||||
ABORT_TRACE("prototype property");
|
||||
}
|
||||
if (!isValidSlot(OBJ_SCOPE(obj), sprop)) {
|
||||
OBJ_DROP_PROPERTY(cx, obj2, prop);
|
||||
return false;
|
||||
}
|
||||
if (!lazilyImportGlobalSlot(sprop->slot)) {
|
||||
OBJ_DROP_PROPERTY(cx, obj2, prop);
|
||||
ABORT_TRACE("lazy import of global slot failed");
|
||||
}
|
||||
|
||||
if (!lazilyImportGlobalSlot(sprop->slot))
|
||||
ABORT_TRACE("lazy import of global slot failed");
|
||||
vp = &STOBJ_GET_SLOT(obj, sprop->slot);
|
||||
OBJ_DROP_PROPERTY(cx, obj2, prop);
|
||||
return true;
|
||||
@ -4771,9 +4807,6 @@ TraceRecorder::activeCallOrGlobalSlot(JSObject* obj, jsval*& vp)
|
||||
JSScopeProperty* sprop = (JSScopeProperty*) prop;
|
||||
uintN slot = sprop->shortid;
|
||||
|
||||
if (setflags && (sprop->attrs & JSPROP_READONLY))
|
||||
ABORT_TRACE("writing to a readonly property");
|
||||
|
||||
vp = NULL;
|
||||
if (sprop->getter == js_GetCallArg) {
|
||||
JS_ASSERT(slot < cfp->fun->nargs);
|
||||
@ -5775,15 +5808,9 @@ TraceRecorder::test_property_cache_direct_slot(JSObject* obj, LIns* obj_ins, uin
|
||||
if (PCVAL_IS_SPROP(pcval)) {
|
||||
JSScopeProperty* sprop = PCVAL_TO_SPROP(pcval);
|
||||
|
||||
uint32 setflags = (js_CodeSpec[*cx->fp->regs->pc].format & (JOF_SET | JOF_INCDEC | JOF_FOR));
|
||||
if (setflags && !SPROP_HAS_STUB_SETTER(sprop))
|
||||
ABORT_TRACE("non-stub setter");
|
||||
if (setflags != JOF_SET && !SPROP_HAS_STUB_GETTER(sprop))
|
||||
ABORT_TRACE("non-stub getter");
|
||||
if (!SPROP_HAS_VALID_SLOT(sprop, OBJ_SCOPE(obj)))
|
||||
ABORT_TRACE("no valid slot");
|
||||
if (setflags && (sprop->attrs & JSPROP_READONLY))
|
||||
ABORT_TRACE("writing to a readonly property");
|
||||
if (!isValidSlot(OBJ_SCOPE(obj), sprop))
|
||||
return false;
|
||||
|
||||
slot = sprop->slot;
|
||||
} else {
|
||||
if (!PCVAL_IS_SLOT(pcval))
|
||||
@ -5948,7 +5975,7 @@ TraceRecorder::getThis(LIns*& this_ins)
|
||||
}
|
||||
|
||||
JS_REQUIRES_STACK bool
|
||||
TraceRecorder::guardClass(JSObject* obj, LIns* obj_ins, JSClass* clasp, ExitType exitType)
|
||||
TraceRecorder::guardClass(JSObject* obj, LIns* obj_ins, JSClass* clasp, LIns* exit)
|
||||
{
|
||||
bool cond = STOBJ_GET_CLASS(obj) == clasp;
|
||||
|
||||
@ -5957,14 +5984,14 @@ TraceRecorder::guardClass(JSObject* obj, LIns* obj_ins, JSClass* clasp, ExitType
|
||||
|
||||
char namebuf[32];
|
||||
JS_snprintf(namebuf, sizeof namebuf, "guard(class is %s)", clasp->name);
|
||||
guard(cond, addName(lir->ins2(LIR_eq, class_ins, INS_CONSTPTR(clasp)), namebuf), exitType);
|
||||
guard(cond, addName(lir->ins2(LIR_eq, class_ins, INS_CONSTPTR(clasp)), namebuf), exit);
|
||||
return cond;
|
||||
}
|
||||
|
||||
JS_REQUIRES_STACK bool
|
||||
TraceRecorder::guardDenseArray(JSObject* obj, LIns* obj_ins, ExitType exitType)
|
||||
{
|
||||
return guardClass(obj, obj_ins, &js_ArrayClass, exitType);
|
||||
return guardClass(obj, obj_ins, &js_ArrayClass, snapshot(exitType));
|
||||
}
|
||||
|
||||
JS_REQUIRES_STACK bool
|
||||
@ -6577,6 +6604,14 @@ TraceRecorder::getClassPrototype(JSObject* ctor, LIns*& proto_ins)
|
||||
}
|
||||
if (JSVAL_TAG(pval) != JSVAL_OBJECT)
|
||||
ABORT_TRACE("got primitive prototype from constructor");
|
||||
#ifdef DEBUG
|
||||
JSBool ok, found;
|
||||
uintN attrs;
|
||||
ok = JS_GetPropertyAttributes(cx, ctor, js_class_prototype_str, &attrs, &found);
|
||||
JS_ASSERT(ok);
|
||||
JS_ASSERT(found);
|
||||
JS_ASSERT((~attrs & (JSPROP_READONLY | JSPROP_PERMANENT)) == 0);
|
||||
#endif
|
||||
proto_ins = INS_CONSTPTR(JSVAL_TO_OBJECT(pval));
|
||||
return true;
|
||||
}
|
||||
@ -6657,25 +6692,25 @@ TraceRecorder::functionCall(bool constructing, uintN argc)
|
||||
if (FUN_INTERPRETED(fun)) {
|
||||
if (constructing) {
|
||||
LIns* args[] = { get(&fval), cx_ins };
|
||||
LIns* tv_ins = lir->insCall(&js_FastNewObject_ci, args);
|
||||
LIns* tv_ins = lir->insCall(&js_NewInstance_ci, args);
|
||||
guard(false, lir->ins_eq0(tv_ins), OOM_EXIT);
|
||||
set(&tval, tv_ins);
|
||||
}
|
||||
return interpretedFunctionCall(fval, fun, argc, constructing);
|
||||
}
|
||||
|
||||
if (!constructing && !(fun->flags & JSFUN_TRACEABLE))
|
||||
if (FUN_SLOW_NATIVE(fun) && fun->u.n.native == js_Array)
|
||||
return newArray(FUN_OBJECT(fun), argc, &tval + 1, &fval);
|
||||
|
||||
if (!(fun->flags & JSFUN_TRACEABLE))
|
||||
ABORT_TRACE("untraceable native");
|
||||
|
||||
static JSTraceableNative knownNatives[] = {
|
||||
{ (JSFastNative)js_Object, &js_FastNewObject_ci, "fC", "", FAIL_NULL | JSTN_MORE },
|
||||
{ (JSFastNative)js_Date, &js_FastNewDate_ci, "pC", "", FAIL_NULL },
|
||||
};
|
||||
JSTraceableNative* known = FUN_TRCINFO(fun);
|
||||
JS_ASSERT(known && (JSFastNative)fun->u.n.native == known->native);
|
||||
|
||||
LIns* args[5];
|
||||
JSTraceableNative* known = constructing ? knownNatives : FUN_TRCINFO(fun);
|
||||
do {
|
||||
if (constructing && (JSFastNative)fun->u.n.native != known->native)
|
||||
if (((known->flags & JSTN_CONSTRUCTOR) != 0) != constructing)
|
||||
continue;
|
||||
|
||||
uintN knownargc = strlen(known->argtypes);
|
||||
@ -6762,9 +6797,6 @@ TraceRecorder::functionCall(bool constructing, uintN argc)
|
||||
next_specialization:;
|
||||
} while ((known++)->flags & JSTN_MORE);
|
||||
|
||||
if (FUN_SLOW_NATIVE(fun) && fun->u.n.native == js_Array)
|
||||
return newArray(FUN_OBJECT(fun), argc, &tval + 1, &fval);
|
||||
|
||||
if (!constructing)
|
||||
ABORT_TRACE("unknown native");
|
||||
if (!(fun->flags & JSFUN_TRACEABLE) && FUN_CLASP(fun))
|
||||
@ -6992,9 +7024,6 @@ TraceRecorder::record_JSOP_SETPROP()
|
||||
JS_REQUIRES_STACK bool
|
||||
TraceRecorder::record_SetPropHit(JSPropCacheEntry* entry, JSScopeProperty* sprop)
|
||||
{
|
||||
if (sprop->setter == js_watch_set)
|
||||
ABORT_TRACE("watchpoint detected");
|
||||
|
||||
jsbytecode* pc = cx->fp->regs->pc;
|
||||
jsval& r = stackval(-1);
|
||||
jsval& l = stackval(-2);
|
||||
@ -7003,8 +7032,8 @@ TraceRecorder::record_SetPropHit(JSPropCacheEntry* entry, JSScopeProperty* sprop
|
||||
JSObject* obj = JSVAL_TO_OBJECT(l);
|
||||
LIns* obj_ins = get(&l);
|
||||
|
||||
if (sprop->attrs & JSPROP_READONLY)
|
||||
ABORT_TRACE("SetPropHit on readonly prop");
|
||||
if (!isValidSlot(OBJ_SCOPE(obj), sprop))
|
||||
return false;
|
||||
|
||||
if (obj == globalObj) {
|
||||
JS_ASSERT(SPROP_HAS_VALID_SLOT(sprop, OBJ_SCOPE(obj)));
|
||||
@ -7013,7 +7042,25 @@ TraceRecorder::record_SetPropHit(JSPropCacheEntry* entry, JSScopeProperty* sprop
|
||||
ABORT_TRACE("lazy import of global slot failed");
|
||||
|
||||
LIns* r_ins = get(&r);
|
||||
set(&STOBJ_GET_SLOT(obj, slot), r_ins);
|
||||
|
||||
if (JSVAL_IS_OBJECT(r)) {
|
||||
/*
|
||||
* Writing a function into the global object might rebrand it. We don't trace
|
||||
* that case.
|
||||
*/
|
||||
if (VALUE_IS_FUNCTION(cx, r))
|
||||
ABORT_TRACE("potential rebranding of the global object");
|
||||
|
||||
/*
|
||||
* If a regular object was written, we have to guard that it's not a function
|
||||
* at execution time either. FIXME: We should split function and object into
|
||||
* separate types when on trace (bug 481273).
|
||||
*/
|
||||
guardClass(obj, obj_ins, &js_FunctionClass, snapshot(MISMATCH_EXIT));
|
||||
set(&STOBJ_GET_SLOT(obj, slot), r_ins);
|
||||
} else {
|
||||
set(&STOBJ_GET_SLOT(obj, slot), r_ins);
|
||||
}
|
||||
|
||||
JS_ASSERT(*pc != JSOP_INITPROP);
|
||||
if (pc[JSOP_SETPROP_LENGTH] != JSOP_POP)
|
||||
@ -7675,6 +7722,7 @@ TraceRecorder::prop(JSObject* obj, LIns* obj_ins, uint32& slot, LIns*& v_ins)
|
||||
* This trace will be valid as long as neither the object nor any object
|
||||
* on its prototype chain change shape.
|
||||
*/
|
||||
LIns* exit = snapshot(BRANCH_EXIT);
|
||||
for (;;) {
|
||||
LIns* map_ins = lir->insLoad(LIR_ldp, obj_ins, (int)offsetof(JSObject, map));
|
||||
LIns* ops_ins;
|
||||
@ -7683,7 +7731,7 @@ TraceRecorder::prop(JSObject* obj, LIns* obj_ins, uint32& slot, LIns*& v_ins)
|
||||
"shape");
|
||||
guard(true,
|
||||
addName(lir->ins2i(LIR_eq, shape_ins, OBJ_SHAPE(obj)), "guard(shape)"),
|
||||
BRANCH_EXIT);
|
||||
exit);
|
||||
} else if (!guardDenseArray(obj, obj_ins, BRANCH_EXIT))
|
||||
ABORT_TRACE("non-native object involved in undefined property access");
|
||||
|
||||
@ -7779,11 +7827,28 @@ TraceRecorder::elem(jsval& oval, jsval& idx, jsval*& vp, LIns*& v_ins, LIns*& ad
|
||||
|
||||
LIns* dslots_ins = lir->insLoad(LIR_ldp, obj_ins, offsetof(JSObject, dslots));
|
||||
if (!guardDenseArrayIndex(obj, i, obj_ins, dslots_ins, idx_ins, BRANCH_EXIT)) {
|
||||
LIns* rt_ins = lir->insLoad(LIR_ldp, cx_ins, offsetof(JSContext, runtime));
|
||||
guard(true,
|
||||
lir->ins_eq0(lir->insLoad(LIR_ldp, rt_ins,
|
||||
offsetof(JSRuntime, anyArrayProtoHasElement))),
|
||||
MISMATCH_EXIT);
|
||||
/*
|
||||
* If we read a hole, make sure at recording time and at runtime that nothing along
|
||||
* the prototype has numeric properties.
|
||||
*/
|
||||
if (js_PrototypeHasIndexedProperties(cx, obj))
|
||||
return false;
|
||||
|
||||
LIns* exit = snapshot(BRANCH_EXIT);
|
||||
while ((obj = JSVAL_TO_OBJECT(obj->fslots[JSSLOT_PROTO])) != NULL) {
|
||||
obj_ins = stobj_get_fslot(obj_ins, JSSLOT_PROTO);
|
||||
LIns* map_ins = lir->insLoad(LIR_ldp, obj_ins, (int)offsetof(JSObject, map));
|
||||
LIns* ops_ins;
|
||||
if (!map_is_native(obj->map, map_ins, ops_ins))
|
||||
ABORT_TRACE("non-native object involved along prototype chain");
|
||||
|
||||
LIns* shape_ins = addName(lir->insLoad(LIR_ld, map_ins, offsetof(JSScope, shape)),
|
||||
"shape");
|
||||
guard(true,
|
||||
addName(lir->ins2i(LIR_eq, shape_ins, OBJ_SHAPE(obj)), "guard(shape)"),
|
||||
exit);
|
||||
}
|
||||
|
||||
// Return undefined and indicate that we didn't actually read this (addr_ins).
|
||||
v_ins = lir->insImm(JSVAL_TO_PSEUDO_BOOLEAN(JSVAL_VOID));
|
||||
addr_ins = NULL;
|
||||
@ -8034,7 +8099,7 @@ TraceRecorder::record_JSOP_NEWINIT()
|
||||
if (JSVAL_IS_PRIMITIVE(v_obj))
|
||||
ABORT_TRACE("primitive Object value");
|
||||
obj = JSVAL_TO_OBJECT(v_obj);
|
||||
ci = &js_FastNewObject_ci;
|
||||
ci = &js_Object_tn_ci;
|
||||
}
|
||||
LIns* args[] = { INS_CONSTPTR(obj), cx_ins };
|
||||
LIns* v_ins = lir->insCall(ci, args);
|
||||
@ -8164,8 +8229,10 @@ TraceRecorder::record_JSOP_NEXTITER()
|
||||
ABORT_TRACE("for-in on a primitive value");
|
||||
|
||||
LIns* iterobj_ins = get(&iterobj_val);
|
||||
if (guardClass(JSVAL_TO_OBJECT(iterobj_val), iterobj_ins, &js_IteratorClass, BRANCH_EXIT))
|
||||
if (guardClass(JSVAL_TO_OBJECT(iterobj_val), iterobj_ins, &js_IteratorClass,
|
||||
snapshot(BRANCH_EXIT))) {
|
||||
return call_imacro(nextiter_imacros.native_iter_next);
|
||||
}
|
||||
return call_imacro(nextiter_imacros.custom_iter_next);
|
||||
}
|
||||
|
||||
@ -9403,13 +9470,6 @@ TraceRecorder::record_JSOP_NEWARRAY()
|
||||
LIns* v_ins = lir->insCall(ci, args);
|
||||
guard(false, lir->ins_eq0(v_ins), OOM_EXIT);
|
||||
|
||||
// De-optimize when we might have setters on Array.prototype.
|
||||
LIns* rt_ins = lir->insLoad(LIR_ldp, cx_ins, offsetof(JSContext, runtime));
|
||||
guard(true,
|
||||
lir->ins_eq0(lir->insLoad(LIR_ldp, rt_ins,
|
||||
offsetof(JSRuntime, anyArrayProtoHasElement))),
|
||||
MISMATCH_EXIT);
|
||||
|
||||
LIns* dslots_ins = NULL;
|
||||
for (uint32 i = 0; i < len; i++) {
|
||||
jsval& v = stackval(int(i) - int(len));
|
||||
|
@ -418,7 +418,7 @@ class TraceRecorder : public avmplus::GCObject {
|
||||
jsbytecode* terminate_imacpc;
|
||||
TraceRecorder* nextRecorderToAbort;
|
||||
bool wasRootFragment;
|
||||
nanojit::Fragment* outer;
|
||||
jsbytecode* outer;
|
||||
|
||||
bool isGlobal(jsval* p) const;
|
||||
ptrdiff_t nativeGlobalOffset(jsval* p) const;
|
||||
@ -429,6 +429,7 @@ class TraceRecorder : public avmplus::GCObject {
|
||||
unsigned callDepth, unsigned ngslots, uint8* typeMap);
|
||||
void trackNativeStackUse(unsigned slots);
|
||||
|
||||
JS_REQUIRES_STACK bool isValidSlot(JSScope* scope, JSScopeProperty* sprop);
|
||||
JS_REQUIRES_STACK bool lazilyImportGlobalSlot(unsigned slot);
|
||||
|
||||
JS_REQUIRES_STACK nanojit::LIns* guard(bool expected, nanojit::LIns* cond,
|
||||
@ -529,7 +530,7 @@ class TraceRecorder : public avmplus::GCObject {
|
||||
JS_REQUIRES_STACK void box_jsval(jsval v, nanojit::LIns*& v_ins);
|
||||
JS_REQUIRES_STACK void unbox_jsval(jsval v, nanojit::LIns*& v_ins);
|
||||
JS_REQUIRES_STACK bool guardClass(JSObject* obj, nanojit::LIns* obj_ins, JSClass* clasp,
|
||||
ExitType exitType = MISMATCH_EXIT);
|
||||
nanojit::LIns* exit);
|
||||
JS_REQUIRES_STACK bool guardDenseArray(JSObject* obj, nanojit::LIns* obj_ins,
|
||||
ExitType exitType = MISMATCH_EXIT);
|
||||
JS_REQUIRES_STACK bool guardDenseArrayIndex(JSObject* obj, jsint idx, nanojit::LIns* obj_ins,
|
||||
@ -556,7 +557,7 @@ public:
|
||||
JS_REQUIRES_STACK
|
||||
TraceRecorder(JSContext* cx, VMSideExit*, nanojit::Fragment*, TreeInfo*,
|
||||
unsigned stackSlots, unsigned ngslots, uint8* typeMap,
|
||||
VMSideExit* expectedInnerExit, nanojit::Fragment* outerTree);
|
||||
VMSideExit* expectedInnerExit, jsbytecode* outerTree);
|
||||
~TraceRecorder();
|
||||
|
||||
static JS_REQUIRES_STACK JSMonitorRecordingStatus monitorRecording(JSContext* cx, TraceRecorder* tr, JSOp op);
|
||||
|
@ -451,6 +451,31 @@ typedef uintptr_t JSUword;
|
||||
#define JS_BITS_PER_WORD (JS_BITS_PER_BYTE * JS_BYTES_PER_WORD)
|
||||
#define JS_BITS_PER_DOUBLE (JS_BITS_PER_BYTE * JS_BYTES_PER_DOUBLE)
|
||||
|
||||
/***********************************************************************
|
||||
** MACROS: JS_FUNC_TO_DATA_PTR
|
||||
** JS_DATA_TO_FUNC_PTR
|
||||
** DESCRIPTION:
|
||||
** Macros to convert between function and data pointers assuming that
|
||||
** they have the same size. Use them like this:
|
||||
**
|
||||
** JSPropertyOp nativeGetter;
|
||||
** JSObject *scriptedGetter;
|
||||
** ...
|
||||
** scriptedGetter = JS_FUNC_TO_DATA_PTR(JSObject *, nativeGetter);
|
||||
** ...
|
||||
** nativeGetter = JS_DATA_TO_FUNC_PTR(JSPropertyOp, scriptedGetter);
|
||||
**
|
||||
***********************************************************************/
|
||||
|
||||
#ifdef __GNUC__
|
||||
# define JS_FUNC_TO_DATA_PTR(type, fun) (__extension__ (type) (fun))
|
||||
# define JS_DATA_TO_FUNC_PTR(type, ptr) (__extension__ (type) (ptr))
|
||||
#else
|
||||
/* Use an extra (void *) cast for MSVC. */
|
||||
# define JS_FUNC_TO_DATA_PTR(type, fun) ((type) (void *) (fun))
|
||||
# define JS_DATA_TO_FUNC_PTR(type, ptr) ((type) (void *) (ptr))
|
||||
#endif
|
||||
|
||||
JS_END_EXTERN_C
|
||||
|
||||
#endif /* jstypes_h___ */
|
||||
|
@ -50,6 +50,12 @@
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Checks the assumption that JS_FUNC_TO_DATA_PTR and JS_DATA_TO_FUNC_PTR
|
||||
* macros uses to implement casts between function and data pointers.
|
||||
*/
|
||||
JS_STATIC_ASSERT(sizeof(void *) == sizeof(void (*)()));
|
||||
|
||||
JS_PUBLIC_API(void) JS_Assert(const char *s, const char *file, JSIntn ln)
|
||||
{
|
||||
fprintf(stderr, "Assertion failure: %s, at %s:%d\n", s, file, ln);
|
||||
|
@ -46,11 +46,15 @@
|
||||
|
||||
JS_BEGIN_EXTERN_C
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
/*
|
||||
* JS_Assert is present even in release builds, for the benefit of applications
|
||||
* that build DEBUG and link against a non-DEBUG SpiderMonkey library.
|
||||
*/
|
||||
extern JS_PUBLIC_API(void)
|
||||
JS_Assert(const char *s, const char *file, JSIntn ln);
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
#define JS_ASSERT(expr) \
|
||||
((expr) ? (void)0 : JS_Assert(#expr, __FILE__, __LINE__))
|
||||
|
||||
@ -93,6 +97,8 @@ JS_Assert(const char *s, const char *file, JSIntn ln);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define JS_STATIC_ASSERT_IF(cond, expr) JS_STATIC_ASSERT(!(cond) || (expr))
|
||||
|
||||
/*
|
||||
* Abort the process in a non-graceful manner. This will cause a core file,
|
||||
* call to the debugger or other moral equivalent as well as causing the
|
||||
|
@ -931,6 +931,11 @@ namespace nanojit
|
||||
NanoAssert( !_branchStateMap || _branchStateMap->isEmpty());
|
||||
_branchStateMap = 0;
|
||||
|
||||
// Tell Valgrind that new code has been generated, and it must flush
|
||||
// any translations it has for the memory range generated into.
|
||||
VALGRIND_DISCARD_TRANSLATIONS(pageTop(_nIns-1), NJ_PAGE_SIZE);
|
||||
VALGRIND_DISCARD_TRANSLATIONS(pageTop(_nExitIns-1), NJ_PAGE_SIZE);
|
||||
|
||||
#ifdef AVMPLUS_ARM
|
||||
// If we've modified the code, we need to flush so we don't end up trying
|
||||
// to execute junk
|
||||
|
@ -407,6 +407,7 @@ Assembler::nPatchBranch(NIns* at, NIns* target)
|
||||
at[0] = (NIns)( COND_AL | (0x51<<20) | (PC<<16) | (PC<<12) | (4) );
|
||||
at[1] = (NIns)(target);
|
||||
}
|
||||
VALGRIND_DISCARD_TRANSLATIONS(at, 2*sizeof(NIns));
|
||||
|
||||
#if defined(UNDER_CE)
|
||||
// we changed the code, so we need to do this (sadly)
|
||||
|
@ -416,9 +416,11 @@ namespace nanojit
|
||||
if (branch[0] == JMP32) {
|
||||
was = branch + *(int32_t*)&branch[1] + 5;
|
||||
*(int32_t*)&branch[1] = offset - 5;
|
||||
VALGRIND_DISCARD_TRANSLATIONS(&branch[1], sizeof(int32_t));
|
||||
} else if (branch[0] == JCC32) {
|
||||
was = branch + *(int32_t*)&branch[2] + 6;
|
||||
*(int32_t*)&branch[2] = offset - 6;
|
||||
VALGRIND_DISCARD_TRANSLATIONS(&branch[2], sizeof(int32_t));
|
||||
} else
|
||||
NanoAssertMsg(0, "Unknown branch type in nPatchBranch");
|
||||
#else
|
||||
@ -427,6 +429,7 @@ namespace nanojit
|
||||
mem = &branch[6] + *(int32_t *)&branch[2];
|
||||
was = *(intptr_t*)mem;
|
||||
*(intptr_t *)mem = intptr_t(targ);
|
||||
VALGRIND_DISCARD_TRANSLATIONS(mem, sizeof(intptr_t));
|
||||
} else {
|
||||
NanoAssertMsg(0, "Unknown branch type in nPatchBranch");
|
||||
}
|
||||
@ -2098,6 +2101,9 @@ namespace nanojit
|
||||
Page *p = (Page*)pageTop(eip-1);
|
||||
NIns *top = (NIns*) &p->code[0];
|
||||
if (eip - n < top) {
|
||||
// We are done with the current page. Tell Valgrind that new code
|
||||
// has been generated.
|
||||
VALGRIND_DISCARD_TRANSLATIONS(pageTop(p), NJ_PAGE_SIZE);
|
||||
_nIns = pageAlloc(_inExit);
|
||||
JMP(eip);
|
||||
}
|
||||
|
@ -98,6 +98,16 @@
|
||||
#define NJ_DELETE(obj) do { delete obj; } while (0)
|
||||
#endif
|
||||
|
||||
// Embed no-op macros that let Valgrind work with the JIT.
|
||||
#ifdef MOZ_VALGRIND
|
||||
# define JS_VALGRIND
|
||||
#endif
|
||||
#ifdef JS_VALGRIND
|
||||
# include <valgrind/valgrind.h>
|
||||
#else
|
||||
# define VALGRIND_DISCARD_TRANSLATIONS(addr, szB)
|
||||
#endif
|
||||
|
||||
namespace nanojit
|
||||
{
|
||||
/**
|
||||
|
@ -19,6 +19,12 @@ if ("gSkipSlowTests" in this && gSkipSlowTests) {
|
||||
gDoMandelbrotTest = false;
|
||||
}
|
||||
|
||||
if (!('gSrcdir' in this))
|
||||
gSrcdir = '.';
|
||||
|
||||
if (!('gReportSummary' in this))
|
||||
gReportSummary = true;
|
||||
|
||||
var testName = null;
|
||||
if ("arguments" in this && arguments.length > 0)
|
||||
testName = arguments[0];
|
||||
@ -139,7 +145,7 @@ function check(desc, actual, expected, oldJITstats, expectedJITstats)
|
||||
});
|
||||
if (pass) {
|
||||
passes.push(desc);
|
||||
return print(desc, ": passed");
|
||||
return print("TEST-PASS | trace-test.js |", desc);
|
||||
}
|
||||
}
|
||||
fails.push(desc);
|
||||
@ -164,7 +170,7 @@ function check(desc, actual, expected, oldJITstats, expectedJITstats)
|
||||
}
|
||||
});
|
||||
}
|
||||
print(desc, ": FAILED: expected", typeof(expected),
|
||||
print("TEST-UNEXPECTED-FAIL | trace-test.js |", desc, ": expected", typeof(expected),
|
||||
"(", uneval(expected), ")",
|
||||
(expectedStats ? " [" + expectedStats + "] " : ""),
|
||||
"!= actual",
|
||||
@ -1660,8 +1666,8 @@ function testNestedExitStackOuter() {
|
||||
testNestedExitStackOuter.expected = 81;
|
||||
testNestedExitStackOuter.jitstats = {
|
||||
recorderStarted: 5,
|
||||
recorderAborted: 2,
|
||||
traceTriggered: 11
|
||||
recorderAborted: 1,
|
||||
traceTriggered: 10
|
||||
};
|
||||
test(testNestedExitStackOuter);
|
||||
|
||||
@ -2566,9 +2572,9 @@ function testWeirdDateParse() {
|
||||
}
|
||||
testWeirdDateParse.expected = "11,17,2008,11,17,2008,11,17,2008,11,17,2008,11,17,2008";
|
||||
testWeirdDateParse.jitstats = {
|
||||
recorderStarted: 7,
|
||||
recorderStarted: 8,
|
||||
recorderAborted: 1,
|
||||
traceCompleted: 6,
|
||||
traceCompleted: 7,
|
||||
traceTriggered: 14,
|
||||
unstableLoopVariable: 3,
|
||||
noCompatInnerTrees: 1
|
||||
@ -4420,6 +4426,48 @@ testUndefinedPropertyAccess.jitstats = {
|
||||
};
|
||||
test(testUndefinedPropertyAccess);
|
||||
|
||||
q = "";
|
||||
function g() { q += "g"; }
|
||||
function h() { q += "h"; }
|
||||
a = [g, g, g, g, h];
|
||||
for (i=0; i<5; i++) { f = a[i]; f(); }
|
||||
|
||||
function testRebranding() {
|
||||
return q;
|
||||
}
|
||||
testRebranding.expected = "ggggh";
|
||||
test(testRebranding);
|
||||
delete q;
|
||||
delete g;
|
||||
delete h;
|
||||
delete a;
|
||||
delete f;
|
||||
|
||||
function testLambdaCtor() {
|
||||
var a = [];
|
||||
for (var x = 0; x < RUNLOOP; ++x) {
|
||||
var f = function(){};
|
||||
a[a.length] = new f;
|
||||
}
|
||||
|
||||
// This prints false until the upvar2 bug is fixed:
|
||||
// print(a[HOTLOOP].__proto__ !== a[HOTLOOP-1].__proto__);
|
||||
|
||||
// Assert that the last f was properly constructed.
|
||||
return a[RUNLOOP-1].__proto__ === f.prototype;
|
||||
}
|
||||
testLambdaCtor.expected = true;
|
||||
test(testLambdaCtor);
|
||||
|
||||
function testNonStubGetter() {
|
||||
let ([] = false) { (this.watch("x", /a/g)); };
|
||||
(function () { (eval("(function(){for each (x in [1, 2, 2]);});"))(); })();
|
||||
this.unwatch("x");
|
||||
return "ok";
|
||||
}
|
||||
testNonStubGetter.expected = "ok";
|
||||
test(testNonStubGetter);
|
||||
|
||||
/*****************************************************************************
|
||||
* *
|
||||
* _____ _ _ _____ ______ _____ _______ *
|
||||
@ -4447,14 +4495,14 @@ test(testUndefinedPropertyAccess);
|
||||
* *
|
||||
*****************************************************************************/
|
||||
|
||||
load("math-trace-tests.js");
|
||||
load(gSrcdir + "/math-trace-tests.js");
|
||||
|
||||
// BEGIN MANDELBROT STUFF
|
||||
// XXXbz I would dearly like to wrap it up into a function to avoid polluting
|
||||
// the global scope, but the function ends up heavyweight, and then we lose on
|
||||
// the jit.
|
||||
if (gDoMandelbrotTest) {
|
||||
load("mandelbrot-results.js");
|
||||
load(gSrcdir + "/mandelbrot-results.js");
|
||||
//function testMandelbrotAll() {
|
||||
// Configuration options that affect which codepaths we follow.
|
||||
var doImageData = true;
|
||||
@ -4729,5 +4777,7 @@ testGlobalProtoAccess.expected = "ok";
|
||||
test(testGlobalProtoAccess);
|
||||
|
||||
/* Keep these at the end so that we can see the summary after the trace-debug spew. */
|
||||
print("\npassed:", passes.length && passes.join(","));
|
||||
print("\nFAILED:", fails.length && fails.join(","));
|
||||
if (gReportSummary) {
|
||||
print("\npassed:", passes.length && passes.join(","));
|
||||
print("\nFAILED:", fails.length && fails.join(","));
|
||||
}
|
||||
|
@ -1,384 +0,0 @@
|
||||
js_MarkGCThing ; 5893956
|
||||
JS_GetPrivate ; 2090130
|
||||
JS_HashTableRawLookup ; 1709984
|
||||
js_Mark ; 1547496
|
||||
js_GetToken ; 1406677
|
||||
js_UngetToken ; 1154416
|
||||
js_MarkAtom ; 992874
|
||||
js_MatchToken ; 980277
|
||||
js_CompareStrings ; 662772
|
||||
js_Lock ; 628184
|
||||
js_Unlock ; 628184
|
||||
js_HashString ; 611102
|
||||
js_DropScopeProperty ; 546476
|
||||
JS_malloc ; 484350
|
||||
js_InflateStringToBuffer ; 460739
|
||||
js_HoldScopeProperty ; 442612
|
||||
JS_free ; 382991
|
||||
js_MarkScript ; 376942
|
||||
js_HashId ; 365238
|
||||
JS_CompareValues ; 352366
|
||||
js_IdToValue ; 337594
|
||||
JS_GetClass ; 325296
|
||||
js_LookupProperty ; 324680
|
||||
js_GetAtom ; 244669
|
||||
js_DropProperty ; 223217
|
||||
JS_GetParent ; 209680
|
||||
js_LiveContext ; 205767
|
||||
js_PeekToken ; 200646
|
||||
js_GetSlotThreadSafe ; 198839
|
||||
JS_GetStringChars ; 190862
|
||||
JS_HashTableRawAdd ; 179156
|
||||
js_FoldConstants ; 162626
|
||||
js_EmitTree ; 145634
|
||||
JS_EnumerateStub ; 140640
|
||||
js_NewSrcNote ; 136983
|
||||
js_GetProperty ; 135639
|
||||
js_NewScopeProperty ; 135057
|
||||
js_MutateScope ; 135057
|
||||
js_GetMutableScope ; 135057
|
||||
js_AllocSlot ; 132401
|
||||
JS_GetRuntime ; 127316
|
||||
JS_FrameIterator ; 121963
|
||||
JS_GetFrameFunctionObject ; 120567
|
||||
js_AllocGCThing ; 119828
|
||||
js_DestroyScopeProperty ; 115989
|
||||
js_Emit3 ; 109135
|
||||
JS_HashTableLookup ; 107154
|
||||
JS_InstanceOf ; 103905
|
||||
js_DefineProperty ; 99514
|
||||
js_strncpy ; 88276
|
||||
js_PeekTokenSameLine ; 87197
|
||||
js_HoldObjectMap ; 79084
|
||||
js_DropObjectMap ; 77824
|
||||
js_NewObject ; 72421
|
||||
js_ValueToString ; 72143
|
||||
js_GetClassPrototype ; 66235
|
||||
js_UnlockRuntime ; 64699
|
||||
js_LockRuntime ; 64699
|
||||
js_ContextIterator ; 64586
|
||||
JS_ClearWatchPointsForObject ; 64155
|
||||
js_FinalizeObject ; 63925
|
||||
js_IndexAtom ; 63789
|
||||
JS_SetPrivate ; 63702
|
||||
JS_GetGlobalObject ; 63546
|
||||
js_Emit1 ; 63012
|
||||
JS_ContextIterator ; 57847
|
||||
JS_GetInstancePrivate ; 57817
|
||||
JS_HashTableRawRemove ; 57057
|
||||
js_Invoke ; 53568
|
||||
js_FindProperty ; 53150
|
||||
JS_GetFrameScript ; 51395
|
||||
js_LinkFunctionObject ; 50651
|
||||
js_SetSrcNoteOffset ; 47735
|
||||
js_InWithStatement ; 47346
|
||||
js_NewFunction ; 47074
|
||||
js_NewSrcNote2 ; 46165
|
||||
JS_HashTableAdd ; 45503
|
||||
JS_HashTableRemove ; 45213
|
||||
js_InCatchBlock ; 42198
|
||||
js_AddRootRT ; 40587
|
||||
js_AddRoot ; 40587
|
||||
js_SetProperty ; 40558
|
||||
JS_AddNamedRoot ; 40462
|
||||
js_RemoveRoot ; 40384
|
||||
JS_RemoveRootRT ; 38129
|
||||
js_NewString ; 37471
|
||||
js_DefineFunction ; 36629
|
||||
JS_GetContextThread ; 36498
|
||||
JS_LookupProperty ; 35137
|
||||
JS_ValueToString ; 34072
|
||||
JS_realloc ; 33776
|
||||
JS_DefineFunction ; 33268
|
||||
JS_SetErrorReporter ; 32851
|
||||
js_FinalizeString ; 30311
|
||||
js_FinalizeStringRT ; 30311
|
||||
JS_ArenaAllocate ; 30099
|
||||
JS_BeginRequest ; 29323
|
||||
JS_EndRequest ; 29323
|
||||
JS_GetContextPrivate ; 29189
|
||||
JS_CompactArenaPool ; 28874
|
||||
js_ValueToStringAtom ; 27934
|
||||
JS_ValueToId ; 26517
|
||||
js_ValueToBoolean ; 25908
|
||||
JS_InternString ; 25467
|
||||
js_PopStatement ; 24364
|
||||
js_PushStatement ; 24364
|
||||
js_NewStringCopyN ; 23911
|
||||
js_FlushPropertyCacheByProp ; 23883
|
||||
js_GetStringBytes ; 23421
|
||||
JS_ArenaRelease ; 23267
|
||||
JS_GetStringBytes ; 23106
|
||||
js_FreeStack ; 22399
|
||||
js_AllocStack ; 22399
|
||||
JS_SetProperty ; 21240
|
||||
js_InitObjectMap ; 19991
|
||||
js_NewScope ; 19991
|
||||
js_strlen ; 19070
|
||||
JS_GetScriptPrincipals ; 18063
|
||||
js_SrcNoteLength ; 17369
|
||||
js_DestroyObjectMap ; 17198
|
||||
js_DestroyScope ; 17198
|
||||
JS_GetStringLength ; 16306
|
||||
js_PopStatementCG ; 15418
|
||||
JS_GetFrameAnnotation ; 14949
|
||||
js_Interpret ; 14032
|
||||
js_TransferScopeLock ; 13899
|
||||
JS_ResolveStandardClass ; 13645
|
||||
JS_ResumeRequest ; 12837
|
||||
JS_SuspendRequest ; 12837
|
||||
JS_GetProperty ; 12488
|
||||
JS_NewObject ; 11660
|
||||
js_AllocTryNotes ; 11418
|
||||
js_NewNumberValue ; 10859
|
||||
js_InternalInvoke ; 10051
|
||||
js_NewDouble ; 9936
|
||||
js_SetJumpOffset ; 9886
|
||||
js_SkipWhiteSpace ; 9299
|
||||
js_NewDoubleValue ; 7474
|
||||
JS_GetPendingException ; 7404
|
||||
js_NewObjectMap ; 7236
|
||||
JS_ClearPendingException ; 7092
|
||||
JS_strtod ; 7053
|
||||
js_strtod ; 7053
|
||||
js_InflateString ; 7004
|
||||
JS_GetFunctionName ; 6808
|
||||
JS_NewHashTable ; 6794
|
||||
JS_NewFunction ; 6575
|
||||
js_FreeSlot ; 6476
|
||||
js_LockScope ; 6332
|
||||
JS_HashTableEnumerateEntries ; 6285
|
||||
js_GetLengthProperty ; 6162
|
||||
js_LockObj ; 6149
|
||||
JS_NewUCStringCopyN ; 5994
|
||||
JS_NewNumberValue ; 5904
|
||||
js_NewStringCopyZ ; 5809
|
||||
JS_NewUCStringCopyZ ; 5809
|
||||
js_DeflateString ; 5612
|
||||
js_ValueToNumber ; 5456
|
||||
JS_SetOptions ; 5322
|
||||
js_NewScript ; 4941
|
||||
js_InitCodeGenerator ; 4810
|
||||
js_FinishTakingSrcNotes ; 4810
|
||||
js_NewScriptFromParams ; 4810
|
||||
js_FinishTakingTryNotes ; 4810
|
||||
js_NewScriptFromCG ; 4810
|
||||
js_FinishCodeGenerator ; 4810
|
||||
JS_strdup ; 4534
|
||||
JS_HashTableDestroy ; 4119
|
||||
js_CheckRedeclaration ; 3965
|
||||
JS_DefineFunctions ; 3808
|
||||
js_EmitFunctionBody ; 3739
|
||||
js_TryMethod ; 3685
|
||||
js_DefaultValue ; 3610
|
||||
js_CloneFunctionObject ; 3577
|
||||
JS_InitClass ; 3546
|
||||
js_SetClassPrototype ; 3377
|
||||
JS_GetPrototype ; 3268
|
||||
JS_DefineProperties ; 3115
|
||||
js_FindVariable ; 3093
|
||||
js_DestroyScript ; 3041
|
||||
JS_ClearScriptTraps ; 3041
|
||||
js_FreeAtomMap ; 3041
|
||||
JS_NewStringCopyZ ; 2953
|
||||
js_AtomizeObject ; 2709
|
||||
JS_ValueToBoolean ; 2643
|
||||
js_SetLengthProperty ; 2637
|
||||
JS_GetOptions ; 2593
|
||||
js_ValueToObject ; 2522
|
||||
js_ValueToNonNullObject ; 2510
|
||||
js_StringToObject ; 2482
|
||||
JS_SetElement ; 2448
|
||||
js_NumberToString ; 2407
|
||||
JS_TypeOfValue ; 2275
|
||||
js_NewBufferTokenStream ; 2253
|
||||
js_NewTokenStream ; 2253
|
||||
js_CloseTokenStream ; 2253
|
||||
JS_RemoveRoot ; 2148
|
||||
JS_NewDouble ; 2129
|
||||
JS_vsnprintf ; 1937
|
||||
JS_snprintf ; 1937
|
||||
JS_CallFunctionValue ; 1844
|
||||
JS_DHashVoidPtrKeyStub ; 1840
|
||||
JS_DHashTableOperate ; 1840
|
||||
js_SetProtoOrParent ; 1758
|
||||
js_DoubleToInteger ; 1729
|
||||
JS_SetVersion ; 1531
|
||||
js_ValueToFunction ; 1476
|
||||
JS_SetPrototype ; 1408
|
||||
JS_CeilingLog2 ; 1317
|
||||
js_Execute ; 1199
|
||||
js_CompileFunctionBody ; 1182
|
||||
JS_CompileUCFunctionForPrincipals ; 1182
|
||||
js_GetSrcNoteOffset ; 1139
|
||||
JS_DHashMatchEntryStub ; 1094
|
||||
JS_VersionToString ; 1090
|
||||
JS_CompileUCScriptForPrincipals ; 1071
|
||||
js_CompileTokenStream ; 1071
|
||||
js_CurrentThreadId ; 1058
|
||||
JS_IdToValue ; 1046
|
||||
js_ConstructObject ; 974
|
||||
JS_DestroyScript ; 967
|
||||
js_PCToLineNumber ; 967
|
||||
JS_DefineProperty ; 930
|
||||
JS_GetScriptFilename ; 924
|
||||
JS_GetFramePC ; 899
|
||||
JS_EvaluateUCScriptForPrincipals ; 892
|
||||
JS_PCToLineNumber ; 848
|
||||
JS_StringToVersion ; 761
|
||||
js_ExecuteRegExp ; 755
|
||||
JS_MaybeGC ; 717
|
||||
JS_ValueToNumber ; 698
|
||||
JS_GetVersion ; 698
|
||||
JS_AliasProperty ; 693
|
||||
js_AtomizeValue ; 664
|
||||
js_BooleanToString ; 664
|
||||
js_SetSlotThreadSafe ; 596
|
||||
JS_DHashClearEntryStub ; 584
|
||||
JS_DHashTableRawRemove ; 584
|
||||
JS_DefineObject ; 557
|
||||
js_PutCallObject ; 516
|
||||
js_GetCallObject ; 516
|
||||
js_strchr ; 511
|
||||
JS_DefineUCProperty ; 480
|
||||
JS_dtostr ; 475
|
||||
JS_ValueToInt32 ; 464
|
||||
js_ValueToInt32 ; 464
|
||||
JS_FinishArenaPool ; 453
|
||||
js_NewTryNote ; 441
|
||||
js_strtointeger ; 437
|
||||
JS_vsmprintf ; 428
|
||||
JS_DHashTableInit ; 423
|
||||
JS_DHashAllocTable ; 423
|
||||
JS_DHashGetStubOps ; 423
|
||||
JS_NewDHashTable ; 423
|
||||
JS_DHashTableDestroy ; 423
|
||||
JS_DHashFreeTable ; 423
|
||||
JS_DHashTableFinish ; 423
|
||||
js_EmitBreak ; 412
|
||||
js_GetAttributes ; 412
|
||||
JS_DefineConstDoubles ; 407
|
||||
JS_ArenaGrow ; 374
|
||||
js_AtomizeInt ; 372
|
||||
JS_SetParent ; 345
|
||||
JS_CloneFunctionObject ; 343
|
||||
JS_IsNativeFrame ; 343
|
||||
JS_ReportErrorNumber ; 340
|
||||
js_ErrorToException ; 340
|
||||
js_ReportErrorNumberVA ; 340
|
||||
js_GetErrorMessage ; 340
|
||||
js_ExpandErrorArguments ; 340
|
||||
js_ReportUncaughtException ; 315
|
||||
JS_IsExceptionPending ; 315
|
||||
js_ReportErrorAgain ; 315
|
||||
js_ErrorFromException ; 315
|
||||
JS_LookupUCProperty ; 307
|
||||
JS_InitArenaPool ; 293
|
||||
PRMJ_Now ; 262
|
||||
DllMain@12 ; 235
|
||||
JS_ExecuteScript ; 232
|
||||
JS_GetFrameFunction ; 226
|
||||
PRMJ_LocalGMTDifference ; 175
|
||||
JS_GetConstructor ; 175
|
||||
JS_SetGlobalObject ; 164
|
||||
js_LockGCThing ; 155
|
||||
js_NewRegExpObject ; 152
|
||||
js_NewRegExp ; 152
|
||||
js_InitObjectClass ; 131
|
||||
js_InitFunctionClass ; 131
|
||||
js_EmitN ; 128
|
||||
JS_ArenaFinish ; 124
|
||||
js_GC ; 124
|
||||
js_SweepAtomState ; 124
|
||||
js_MarkAtomState ; 124
|
||||
JS_ArenaRealloc ; 124
|
||||
js_ForceGC ; 124
|
||||
js_FlushPropertyCache ; 122
|
||||
js_InitNumberClass ; 114
|
||||
JS_smprintf ; 112
|
||||
js_DoubleToECMAInt32 ; 112
|
||||
js_ValueToECMAInt32 ; 111
|
||||
JS_ValueToECMAInt32 ; 111
|
||||
JS_SetContextPrivate ; 109
|
||||
PRMJ_DSTOffset ; 108
|
||||
js_Clear ; 105
|
||||
JS_ClearScope ; 105
|
||||
JS_NewScriptObject ; 104
|
||||
JS_smprintf_free ; 104
|
||||
JS_ConvertValue ; 99
|
||||
js_GetSrcNote ; 98
|
||||
JS_ValueToECMAUint32 ; 93
|
||||
js_ValueToECMAUint32 ; 93
|
||||
js_printf ; 93
|
||||
js_DoubleToECMAUint32 ; 93
|
||||
js_DestroyRegExp ; 89
|
||||
js_UnlockGCThing ; 89
|
||||
js_TryValueOf ; 87
|
||||
js_NewSrcNote3 ; 86
|
||||
JS_ConvertStub ; 81
|
||||
JS_SetPendingException ; 80
|
||||
js_InitStringClass ; 79
|
||||
JS_GC ; 78
|
||||
js_InitArrayClass ; 74
|
||||
js_InitDateClass ; 67
|
||||
JS_NewContext ; 64
|
||||
JS_AddArgumentFormatter ; 64
|
||||
js_InitContextForLocking ; 64
|
||||
js_NewContext ; 64
|
||||
JS_SetBranchCallback ; 64
|
||||
JS_ClearRegExpStatics ; 64
|
||||
js_InitRegExpStatics ; 64
|
||||
js_InitCallClass ; 63
|
||||
js_InitRegExpClass ; 61
|
||||
js_Enumerate ; 58
|
||||
JS_DestroyContext ; 46
|
||||
js_DestroyContext ; 46
|
||||
js_FreeRegExpStatics ; 46
|
||||
js_InitScanner ; 39
|
||||
js_NewPrinter ; 36
|
||||
js_DestroyPrinter ; 36
|
||||
js_GetPrinterOutput ; 36
|
||||
JS_FreeArenaPool ; 36
|
||||
js_DecompileCode ; 34
|
||||
js_EmitContinue ; 33
|
||||
js_CheckAccess ; 30
|
||||
js_DecompileValueGenerator ; 28
|
||||
js_InitMathClass ; 27
|
||||
js_InitExceptionClasses ; 25
|
||||
js_NewArrayObject ; 24
|
||||
js_InitArgumentsClass ; 21
|
||||
js_puts ; 20
|
||||
js_InitBooleanClass ; 19
|
||||
JS_InitStandardClasses ; 19
|
||||
js_InitScriptClass ; 19
|
||||
js_obj_toString ; 15
|
||||
js_GetArgsValue ; 14
|
||||
js_GetArgsObject ; 14
|
||||
JS_DestroyIdArray ; 11
|
||||
js_NewIdArray ; 11
|
||||
JS_GetElement ; 11
|
||||
JS_EvaluateScript ; 9
|
||||
JS_EvaluateUCScript ; 9
|
||||
JS_DecompileFunction ; 8
|
||||
js_DecompileFunction ; 8
|
||||
JS_NewString ; 8
|
||||
js_SetStringBytes ; 8
|
||||
JS_GetArrayLength ; 7
|
||||
JS_NewArrayObject ; 7
|
||||
JS_IsArrayObject ; 7
|
||||
JS_ValueToObject ; 7
|
||||
JS_DefineElement ; 6
|
||||
js_DecompileScript ; 6
|
||||
JS_PushArguments ; 4
|
||||
JS_PopArguments ; 4
|
||||
JS_PushArgumentsVA ; 4
|
||||
js_PutArgsObject ; 2
|
||||
JS_SetGCCallbackRT ; 2
|
||||
JS_Init ; 1
|
||||
js_SetupLocks ; 1
|
||||
js_InitRuntimeNumberState ; 1
|
||||
js_InitRuntimeStringState ; 1
|
||||
js_InitLock ; 1
|
||||
js_InitGC ; 1
|
||||
js_InitAtomState ; 1
|
||||
js_InitStringGlobals ; 1
|
66
js/tests/e4x/Regress/regress-473709.js
Executable file
66
js/tests/e4x/Regress/regress-473709.js
Executable file
@ -0,0 +1,66 @@
|
||||
/* -*- Mode: java; tab-width:8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Gary Kwong
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
gTestfile = 'regress-473709.js';
|
||||
|
||||
var summary = 'Do not assert: cursor == (uint8 *)copy->messageArgs[0] + argsCopySize';
|
||||
var BUGNUMBER = 473709;
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
printBugNumber(BUGNUMBER);
|
||||
START(summary);
|
||||
|
||||
function f() { eval("(function() { switch(x, x) { default: for(x2; <x><y/></x>;) (function(){}) <x><y/></x>;break; case (+<><x><y/></x></>): break; }; })()"); }
|
||||
|
||||
if (typeof gczeal == 'function')
|
||||
{
|
||||
gczeal(2);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
f();
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
}
|
||||
|
||||
TEST(1, expect, actual);
|
||||
|
||||
END();
|
98
js/tests/js1_5/Regress/regress-449666.js
Normal file
98
js/tests/js1_5/Regress/regress-449666.js
Normal file
@ -0,0 +1,98 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Robert Sayre
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-449666.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 449666;
|
||||
var summary = 'Do not assert: JSSTRING_IS_FLAT(str_)';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
var global;
|
||||
|
||||
jit(true);
|
||||
|
||||
if (typeof window == 'undefined') {
|
||||
global = this;
|
||||
}
|
||||
else {
|
||||
global = window;
|
||||
}
|
||||
|
||||
if (!global['g']) {
|
||||
global['g'] = {};
|
||||
}
|
||||
|
||||
if (!global['g']['l']) {
|
||||
global['g']['l'] = {};
|
||||
(function() {
|
||||
function k(a,b){
|
||||
var c=a.split(/\./);
|
||||
var d=global;
|
||||
for(var e=0;e<c.length-1;e++){
|
||||
if(!d[c[e]]){
|
||||
d[c[e]]={};
|
||||
}
|
||||
d=d[c[e]];
|
||||
}
|
||||
d[c[c.length-1]]=b;
|
||||
print("hi");
|
||||
}
|
||||
|
||||
function T(a){return "hmm"}
|
||||
k("g.l.loaded",T);
|
||||
})();
|
||||
|
||||
}
|
||||
|
||||
jit(false);
|
||||
|
||||
reportCompare(expect, actual, summary);
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
61
js/tests/js1_5/Regress/regress-479353.js
Normal file
61
js/tests/js1_5/Regress/regress-479353.js
Normal file
@ -0,0 +1,61 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Gary Kwong
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-479353.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 479353;
|
||||
var summary = 'Do not assert: (uint32)(index_) < atoms_->length';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
(new Function("({}), arguments;"))();
|
||||
|
||||
reportCompare(expect, actual, summary);
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
@ -60,7 +60,7 @@ function test()
|
||||
else {
|
||||
expect = 'PASSED';
|
||||
|
||||
f = eval("(function (a) function () a * a)()");
|
||||
f = eval("(function (a) {return (function () { return a * a;}); })()");
|
||||
g = clone(f, {a: 3});
|
||||
f = null;
|
||||
gc();
|
92
js/tests/js1_5/extensions/regress-449657.js
Normal file
92
js/tests/js1_5/extensions/regress-449657.js
Normal file
@ -0,0 +1,92 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Christopher Lenz
|
||||
* ash_mozilla
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-449657.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 449657;
|
||||
var summary = 'JS_SealObject on Arrays';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
if (typeof seal != 'function')
|
||||
{
|
||||
expect = actual = 'JS_SealObject not supported, test skipped.';
|
||||
reportCompare(expect, actual, summary);
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
var a= [1, 2, 3];
|
||||
seal(a);
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
actual = ex + '';
|
||||
}
|
||||
reportCompare(expect, actual, summary + ': 1');
|
||||
|
||||
expect = 'Error: a.length is read-only';
|
||||
actual = '';
|
||||
try
|
||||
{
|
||||
a = [1,2,3];
|
||||
a[4] = 2;
|
||||
seal(a);
|
||||
a.length = 5;
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
actual = ex + '';
|
||||
}
|
||||
reportCompare(expect, actual, summary + ': 2');
|
||||
}
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
67
js/tests/js1_5/extensions/regress-469625.js
Normal file
67
js/tests/js1_5/extensions/regress-469625.js
Normal file
@ -0,0 +1,67 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Gary Kwong
|
||||
* Jesse Ruderman
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-469625.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 469625;
|
||||
var summary = 'TM: Do not crash @ js_String_getelem';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
jit(true);
|
||||
|
||||
[].__proto__[0] = 'a';
|
||||
for (var j = 0; j < 3; ++j) [[, ]] = [];
|
||||
|
||||
jit(false);
|
||||
|
||||
reportCompare(expect, actual, summary);
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
66
js/tests/js1_5/extensions/regress-469761.js
Normal file
66
js/tests/js1_5/extensions/regress-469761.js
Normal file
@ -0,0 +1,66 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Jesse Ruderman
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-469761.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 469761;
|
||||
var summary = 'TM: Do not assert: JSVAL_IS_INT(STOBJ_GET_SLOT(callee_obj, JSSLOT_PRIVATE))';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
jit(true);
|
||||
|
||||
var o = { __proto__: function(){} };
|
||||
for (var j = 0; j < 3; ++j) { try { o.call(3); } catch (e) { } }
|
||||
|
||||
jit(false);
|
||||
|
||||
reportCompare(expect, actual, summary);
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
57
js/tests/js1_5/extensions/regress-472787.js
Executable file
57
js/tests/js1_5/extensions/regress-472787.js
Executable file
@ -0,0 +1,57 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Gary Kwong
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-472787.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 472787;
|
||||
var summary = 'Do not hang with gczeal, watch and concat';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
this.__defineSetter__("x", Math.sin);
|
||||
this.watch("x", '' .concat);
|
||||
|
||||
if (typeof gczeal == 'function')
|
||||
{
|
||||
gczeal(2);
|
||||
}
|
||||
x = 1;
|
||||
|
||||
reportCompare(expect, actual, summary);
|
68
js/tests/js1_6/Regress/regress-475469.js
Normal file
68
js/tests/js1_6/Regress/regress-475469.js
Normal file
@ -0,0 +1,68 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Jesse Ruderman
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-475469.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 475469;
|
||||
var summary = 'TM: Do not crash @ FramePCOffset';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
// print('Note this test originally required jit enabled with the environment ');
|
||||
// print('variable TRACEMONKEY=verbose defined. Note that the calls to enable ');
|
||||
// print('jit are necessary for the crash.');
|
||||
|
||||
jit(true);
|
||||
[1,2,3].map(/a/gi);
|
||||
jit(false);
|
||||
|
||||
reportCompare(expect, actual, summary);
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
||||
|
57
js/tests/js1_6/extensions/regress-457521.js
Executable file
57
js/tests/js1_6/extensions/regress-457521.js
Executable file
@ -0,0 +1,57 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Gary Kwong
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-457521.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 457521;
|
||||
var summary = 'Do not crash @ js_DecompileValueGenerator';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
try
|
||||
{
|
||||
this.__defineSetter__("x", [,,,].map);
|
||||
this.watch("x", (new Function("var y, eval")));
|
||||
x = true;
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
}
|
||||
reportCompare(expect, actual, summary);
|
59
js/tests/js1_6/extensions/regress-472508.js
Normal file
59
js/tests/js1_6/extensions/regress-472508.js
Normal file
@ -0,0 +1,59 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Gary Kwong
|
||||
* Jesse Ruderman
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-472508.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 472508;
|
||||
var summary = 'TM: Do not crash @ TraceRecorder::emitTreeCall';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
jit(true);
|
||||
|
||||
for (var x in this) { }
|
||||
var a = [false, false, false];
|
||||
a.__defineGetter__("q", function() { });
|
||||
a.__defineGetter__("r", function() { });
|
||||
for (var i = 0; i < 2; ++i) for each (var e in a) { }
|
||||
|
||||
jit(false);
|
||||
|
||||
reportCompare(expect, actual, summary);
|
58
js/tests/js1_6/extensions/regress-475144.js
Normal file
58
js/tests/js1_6/extensions/regress-475144.js
Normal file
@ -0,0 +1,58 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Gary Kwong
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-475144.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 475144;
|
||||
var summary = 'TM: Do not assert: !JS_ON_TRACE(cx)';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
jit(true);
|
||||
|
||||
function a() {}
|
||||
function b() {}
|
||||
function c() {}
|
||||
eval("this.__defineGetter__(\"\", function(){ return new Function } )");
|
||||
[[].some for each (x in this) for each (y in /x/g)];
|
||||
|
||||
jit(false);
|
||||
|
||||
reportCompare(expect, actual, summary);
|
65
js/tests/js1_7/extensions/regress-469234.js
Normal file
65
js/tests/js1_7/extensions/regress-469234.js
Normal file
@ -0,0 +1,65 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Jesse Ruderman
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-469234.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 469234;
|
||||
var summary = 'TM: Do not assert: !JS_ON_TRACE(cx)';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
jit(true);
|
||||
|
||||
for(var j=0;j<3;++j)({__proto__:[]}).__defineSetter__('x',function(){});
|
||||
|
||||
jit(false);
|
||||
|
||||
reportCompare(expect, actual, summary);
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
67
js/tests/js1_7/extensions/regress-474771-01.js
Normal file
67
js/tests/js1_7/extensions/regress-474771-01.js
Normal file
@ -0,0 +1,67 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Jesse Ruderman
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-474771-01.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 474771;
|
||||
var summary = 'TM: do not assert: jumpTable == interruptJumpTable';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
jit(true);
|
||||
|
||||
var o = {};
|
||||
o.__defineSetter__('x', function(){});
|
||||
for (let j = 0; j < 4; ++j) o.x = 3;
|
||||
|
||||
jit(false);
|
||||
|
||||
reportCompare(expect, actual, summary);
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
55
js/tests/js1_7/extensions/regress-474771-02.js
Normal file
55
js/tests/js1_7/extensions/regress-474771-02.js
Normal file
@ -0,0 +1,55 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Jesse Ruderman
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-474771-02.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 474771;
|
||||
var summary = 'TM: do not assert: jumpTable == interruptJumpTable';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
jit(true);
|
||||
|
||||
this.__defineSetter__('x', function(){});
|
||||
for (var j = 0; j < 5; ++j) { x = 3; }
|
||||
|
||||
jit(false);
|
||||
|
||||
reportCompare(expect, actual, summary);
|
71
js/tests/js1_7/regress/regress-469239-01.js
Normal file
71
js/tests/js1_7/regress/regress-469239-01.js
Normal file
@ -0,0 +1,71 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Jesse Ruderman
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-469239-01.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 469239;
|
||||
var summary = 'TM: Do not assert: entry->kpc == (jsbytecode*) atoms[index]';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
jit(true);
|
||||
|
||||
for (let b=0;b<9;++b) {
|
||||
for each (let h in ['', 3, /x/]) {
|
||||
for each (c in [[], [], [], /x/]) {
|
||||
'' + c;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
jit(false);
|
||||
|
||||
reportCompare(expect, actual, summary);
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
71
js/tests/js1_7/regress/regress-469239-02.js
Normal file
71
js/tests/js1_7/regress/regress-469239-02.js
Normal file
@ -0,0 +1,71 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Jesse Ruderman
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-469239-02.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 469239;
|
||||
var summary = 'TM: Do not assert: ATOM_IS_STRING(atom)';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
jit(true);
|
||||
|
||||
for (let b=0;b<9;++b) {
|
||||
for each (let h in [33, 3, /x/]) {
|
||||
for each (c in [[], [], [], /x/]) {
|
||||
'' + c;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
jit(false);
|
||||
|
||||
reportCompare(expect, actual, summary);
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
73
js/tests/js1_7/regress/regress-474771.js
Normal file
73
js/tests/js1_7/regress/regress-474771.js
Normal file
@ -0,0 +1,73 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Jesse Ruderman
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-474771.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 474771;
|
||||
var summary = 'TM: do not halt execution with gczeal, prototype mangling, for..in';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
expect = 'PASS';
|
||||
jit(true);
|
||||
|
||||
if (typeof gczeal != 'undefined')
|
||||
{
|
||||
gczeal(2);
|
||||
}
|
||||
Object.prototype.q = 3;
|
||||
for each (let x in [6, 7]) { } print(actual = "PASS");
|
||||
|
||||
jit(false);
|
||||
|
||||
delete Object.prototype.q;
|
||||
|
||||
reportCompare(expect, actual, summary);
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
62
js/tests/js1_8/decompilation/regress-346749.js
Normal file
62
js/tests/js1_8/decompilation/regress-346749.js
Normal file
@ -0,0 +1,62 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Blake Kaplan
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-346749.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 346749;
|
||||
var summary = 'let declarations at function level should turn into var declarations';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
expect = 'function () { var k; }';
|
||||
var f = (function () { let k; });
|
||||
actual = f + '';
|
||||
compareSource(expect, actual, summary);
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
63
js/tests/js1_8/decompilation/regress-381963-01.js
Normal file
63
js/tests/js1_8/decompilation/regress-381963-01.js
Normal file
@ -0,0 +1,63 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Jesse Ruderman
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-381963-01.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 381963;
|
||||
var summary = 'Decompilation of genexp in |while|';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
expect = 'function() { while(1, (2 for (x in []))) { break; } }';
|
||||
var f = function() { while(1, (2 for (x in []))) break; };
|
||||
actual = f + '';
|
||||
|
||||
compareSource(expect, actual, summary);
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
65
js/tests/js1_8/decompilation/regress-381963-02.js
Normal file
65
js/tests/js1_8/decompilation/regress-381963-02.js
Normal file
@ -0,0 +1,65 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Aiko
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-381963-02.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 381963;
|
||||
var summary = 'Decompilation of genexp in |while|';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
expect = 'function f() { while (false) { print(2); } }';
|
||||
|
||||
function f() { while (0 && (b for (x in 3))) print(2) }
|
||||
|
||||
actual = f + '';
|
||||
|
||||
compareSource(expect, actual, summary);
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
75
js/tests/js1_8/extensions/regress-469625.js
Normal file
75
js/tests/js1_8/extensions/regress-469625.js
Normal file
@ -0,0 +1,75 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Jason Orendorff
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-469625.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 469625;
|
||||
var summary = 'TM: Array prototype and expression closures';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
expect = 'TypeError: [] is not a function';
|
||||
|
||||
jit(true);
|
||||
|
||||
Array.prototype.__proto__ = function () 3;
|
||||
|
||||
try
|
||||
{
|
||||
[].__proto__();
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
print(actual = ex + '');
|
||||
}
|
||||
jit(false);
|
||||
|
||||
reportCompare(expect, actual, summary);
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
67
js/tests/js1_8/extensions/regress-472450-03.js
Normal file
67
js/tests/js1_8/extensions/regress-472450-03.js
Normal file
@ -0,0 +1,67 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Gary Kwong
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-472450-03.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 472450;
|
||||
var summary = 'TM: Do not assert: StackBase(fp) + blockDepth == regs.sp';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
jit(true);
|
||||
|
||||
({__proto__: #1=[#1#]})
|
||||
for (var y = 0; y < 3; ++y) { for each (let z in ['', function(){}]) { let x =
|
||||
1, c = []; } }
|
||||
|
||||
jit(false);
|
||||
|
||||
reportCompare(expect, actual, summary);
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
69
js/tests/js1_8/extensions/regress-472450-04.js
Normal file
69
js/tests/js1_8/extensions/regress-472450-04.js
Normal file
@ -0,0 +1,69 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Gary Kwong
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-472450-04.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 472450;
|
||||
var summary = 'TM: Do not assert: StackBase(fp) + blockDepth == regs.sp';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
jit(true);
|
||||
|
||||
({__proto__: #1=[#1#]});
|
||||
function f(){
|
||||
eval("for (var y = 0; y < 1; ++y) { for each (let z in [null, function(){}, null, '', null, '', null]) { let x = 1, c = []; } }");
|
||||
}
|
||||
f();
|
||||
|
||||
jit(false);
|
||||
|
||||
reportCompare(expect, actual, summary);
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
@ -225,6 +225,8 @@ function search(values) {
|
||||
hard = '4.....8.5.3..........7......2.....6.....8.4......1.......6.3.7.5..2.....1.4......'
|
||||
|
||||
print_board(search(parse_grid(hard)))
|
||||
|
||||
delete Object.prototype.copy;
|
||||
|
||||
reportCompare(expect, actual, summary);
|
||||
|
||||
|
69
js/tests/js1_8/regress/regress-384758.js
Normal file
69
js/tests/js1_8/regress/regress-384758.js
Normal file
@ -0,0 +1,69 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Jesse Ruderman
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-384758.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 384758;
|
||||
var summary = 'Statement can not follow expression closure with out intervening ;';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
expect = 'SyntaxError: missing ; before statement';
|
||||
try
|
||||
{
|
||||
eval('(function() { if(t) function x() foo() bar(); })');
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
actual = ex + '';
|
||||
}
|
||||
|
||||
reportCompare(expect, actual, summary);
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
61
js/tests/js1_8/regress/regress-464092-01.js
Normal file
61
js/tests/js1_8/regress/regress-464092-01.js
Normal file
@ -0,0 +1,61 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Jesse Ruderman
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-464092-01.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 464092;
|
||||
var summary = 'Do not assert: OBJ_IS_CLONED_BLOCK(obj)';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
let (a) 'b'.replace(/b/g, function() { c = this; }); c.d = 3; c.d;
|
||||
|
||||
reportCompare(expect, actual, summary);
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
68
js/tests/js1_8/regress/regress-464092-02.js
Normal file
68
js/tests/js1_8/regress/regress-464092-02.js
Normal file
@ -0,0 +1,68 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Jesse Ruderman
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-464092-02.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 464092;
|
||||
var summary = 'Censor block objects';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
try
|
||||
{
|
||||
let (a) 'b'.replace(/b/g, function() c = this );
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
actual = ex + '';
|
||||
}
|
||||
|
||||
reportCompare(expect, actual, summary);
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
67
js/tests/js1_8/regress/regress-464096.js
Normal file
67
js/tests/js1_8/regress/regress-464096.js
Normal file
@ -0,0 +1,67 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Jesse Ruderman
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-464096.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 464096;
|
||||
var summary = 'TM: Do not assert: tm->recoveryDoublePoolPtr > tm->recoveryDoublePool';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
jit(true);
|
||||
|
||||
for (let f in [1,1]);
|
||||
Object.prototype.__defineGetter__('x', function() gc());
|
||||
(function() { for each (let j in [1,1,1,1,1]) { var y = .2; } })();
|
||||
|
||||
jit(false);
|
||||
|
||||
reportCompare(expect, actual, summary);
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
64
js/tests/js1_8/regress/regress-465567-01.js
Normal file
64
js/tests/js1_8/regress/regress-465567-01.js
Normal file
@ -0,0 +1,64 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Jesse Ruderman
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-465567-01.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 465567;
|
||||
var summary = 'TM: Weirdness with var, let, multiple assignments';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
expect = '99999';
|
||||
|
||||
jit(true);
|
||||
|
||||
for (let j = 0; j < 5; ++j) {
|
||||
e = 9;
|
||||
print(actual += '' + e);
|
||||
e = 47;
|
||||
if (e & 0) {
|
||||
var e;
|
||||
let e;
|
||||
}
|
||||
}
|
||||
|
||||
jit(false);
|
||||
|
||||
reportCompare(expect, actual, summary);
|
54
js/tests/js1_8/regress/regress-465567-02.js
Normal file
54
js/tests/js1_8/regress/regress-465567-02.js
Normal file
@ -0,0 +1,54 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Jesse Ruderman
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-465567-02.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 465567;
|
||||
var summary = 'TM: Do not assert: JSVAL_TAG(v) == JSVAL_OBJECT';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
jit(true);
|
||||
|
||||
for each (e in ['', true, 1, true, 1]) { e = null; if (0) { let e; var e; } }
|
||||
|
||||
jit(false);
|
||||
|
||||
reportCompare(expect, actual, summary);
|
61
js/tests/js1_8/regress/regress-467495-01.js
Normal file
61
js/tests/js1_8/regress/regress-467495-01.js
Normal file
@ -0,0 +1,61 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Gary Kwong
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-467495-01.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 467495;
|
||||
var summary = 'Do not crash @ js_Interpret';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
(function() { x = 0; function x() 4; var x; const y = 1; })();
|
||||
|
||||
reportCompare(expect, actual, summary);
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
67
js/tests/js1_8/regress/regress-467495-02.js
Normal file
67
js/tests/js1_8/regress/regress-467495-02.js
Normal file
@ -0,0 +1,67 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Gary Kwong
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-467495-02.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 467495;
|
||||
var summary = 'Do not crash @ js_Interpret';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
try
|
||||
{
|
||||
eval("(function(){const y = 1; function x() '' let functional, x})();");
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
}
|
||||
|
||||
reportCompare(expect, actual, summary);
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
80
js/tests/js1_8/regress/regress-467495-03.js
Normal file
80
js/tests/js1_8/regress/regress-467495-03.js
Normal file
@ -0,0 +1,80 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Brendan Eich
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-467495-03.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 467495;
|
||||
var summary = 'TCF_FUN_CLOSURE_VS_VAR is necessary';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
function f(x)
|
||||
{
|
||||
actual = '';
|
||||
var g;
|
||||
print(actual += typeof g + ',');
|
||||
|
||||
if (x)
|
||||
function g(){};
|
||||
|
||||
print(actual += g);
|
||||
}
|
||||
|
||||
expect = 'undefined,undefined';
|
||||
f(0);
|
||||
|
||||
reportCompare(expect, actual, summary + ': f(0): ');
|
||||
|
||||
expect = 'undefined,function g() {\n}';
|
||||
|
||||
f(1);
|
||||
|
||||
reportCompare(expect, actual, summary + ': f(1): ');
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
75
js/tests/js1_8/regress/regress-467495-04.js
Normal file
75
js/tests/js1_8/regress/regress-467495-04.js
Normal file
@ -0,0 +1,75 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Igor Bukanov
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-467495-04.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 467495;
|
||||
var summary = 'TCF_FUN_CLOSURE_VS_VAR is necessary';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
function g() {
|
||||
if (1)
|
||||
function x() {};
|
||||
var x;
|
||||
const y = 1;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
g();
|
||||
}
|
||||
catch(ex)
|
||||
{
|
||||
actual = ex + '';
|
||||
}
|
||||
|
||||
reportCompare(expect, actual, summary);
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
64
js/tests/js1_8/regress/regress-467495-05.js
Normal file
64
js/tests/js1_8/regress/regress-467495-05.js
Normal file
@ -0,0 +1,64 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Igor Bukanov
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-467495-05.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 467495;
|
||||
var summary = 'TCF_FUN_CLOSURE_VS_VAR is necessary';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
expect = 'function x() {\n}';
|
||||
|
||||
function g(x) { if (1) function x() {} return x; }
|
||||
print(actual = g(1) + '');
|
||||
|
||||
reportCompare(expect, actual, summary);
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
77
js/tests/js1_8/regress/regress-467495-06.js
Normal file
77
js/tests/js1_8/regress/regress-467495-06.js
Normal file
@ -0,0 +1,77 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Igor Bukanov
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-467495-06.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 467495;
|
||||
var summary = 'TCF_FUN_CLOSURE_VS_VAR is necessary';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
function f(x)
|
||||
{
|
||||
var y = 1;
|
||||
if (Math)
|
||||
function x() { }
|
||||
if (Math)
|
||||
function y() { }
|
||||
return [x, y];
|
||||
}
|
||||
|
||||
var r = f(0);
|
||||
|
||||
if (typeof(r[0]) != "function")
|
||||
actual += "Bad r[0]";
|
||||
|
||||
if (typeof(r[1]) != "function")
|
||||
throw "Bad r[1]";
|
||||
|
||||
reportCompare(expect, actual, summary);
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
65
js/tests/js1_8/regress/regress-468711.js
Normal file
65
js/tests/js1_8/regress/regress-468711.js
Normal file
@ -0,0 +1,65 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Jesse Ruderman
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-468711.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 468711;
|
||||
var summary = 'TM: Do not assert: !JS_ON_TRACE(cx)';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
jit(true);
|
||||
|
||||
(5).toString(); for each (let b in [3, this]) { b.toString(); }
|
||||
|
||||
jit(false);
|
||||
|
||||
reportCompare(expect, actual, summary);
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
66
js/tests/js1_8/regress/regress-472450-01.js
Normal file
66
js/tests/js1_8/regress/regress-472450-01.js
Normal file
@ -0,0 +1,66 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Gary Kwong
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-472450-01.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 472450;
|
||||
var summary = 'TM: Do not assert: StackBase(fp) + blockDepth == regs.sp';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
jit(true);
|
||||
|
||||
for each (let x in [function(){}, {}, {}, function(){}, function(){},
|
||||
function(){}]) { ([<y/> for (y in x)]); }
|
||||
|
||||
jit(false);
|
||||
|
||||
reportCompare(expect, actual, summary);
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
66
js/tests/js1_8/regress/regress-472450-02.js
Normal file
66
js/tests/js1_8/regress/regress-472450-02.js
Normal file
@ -0,0 +1,66 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Gary Kwong
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-472450-02.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 472450;
|
||||
var summary = 'TM: Do not assert: StackBase(fp) + blockDepth == regs.sp';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
jit(true);
|
||||
|
||||
for each (let x in [function(){}, {}, {}, function(){}, function(){}]) { ([<y/>
|
||||
for (y in x)]); }
|
||||
|
||||
jit(false);
|
||||
|
||||
reportCompare(expect, actual, summary);
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
56
js/tests/js1_8/regress/regress-479353.js
Executable file
56
js/tests/js1_8/regress/regress-479353.js
Executable file
@ -0,0 +1,56 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Gary Kwong
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-479353.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 479353;
|
||||
var summary = 'Do not assert: (uint32)(index_) < atoms_->length';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
function f(code)
|
||||
{
|
||||
(eval("(function(){" + code + "});"))();
|
||||
}
|
||||
x = <z/>;
|
||||
f("y = this;");
|
||||
f("x, y; for each (let x in [arguments]) {}");
|
||||
|
||||
reportCompare(expect, actual, summary);
|
116
js/tests/js1_8_1/trace/regress-451673.js
Normal file
116
js/tests/js1_8_1/trace/regress-451673.js
Normal file
@ -0,0 +1,116 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is JavaScript Engine testing utilities.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s): Boris Zbarsky
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var gTestfile = 'regress-451673.js';
|
||||
//-----------------------------------------------------------------------------
|
||||
var BUGNUMBER = 451673;
|
||||
var summary = 'TM: Tracing prime number generation';
|
||||
var actual = '';
|
||||
var expect = '';
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
test();
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function test()
|
||||
{
|
||||
enterFunc ('test');
|
||||
printBugNumber(BUGNUMBER);
|
||||
printStatus (summary);
|
||||
|
||||
function doTest(enablejit)
|
||||
{
|
||||
if (enablejit)
|
||||
jit(true);
|
||||
else
|
||||
jit(false);
|
||||
|
||||
var n = 1000000;
|
||||
var start = new Date();
|
||||
var i=0;
|
||||
var j=0;
|
||||
var numprimes=0;
|
||||
var limit=0;
|
||||
numprimes = 1; // 2 is prime
|
||||
var mceil = Math.floor;
|
||||
var msqrt = Math.sqrt;
|
||||
var isPrime = 1;
|
||||
|
||||
for (i = 3; i<= n; i+=2)
|
||||
{
|
||||
isPrime=1;
|
||||
limit = mceil(msqrt(i)+1) + 1;
|
||||
|
||||
for (j = 3; j < limit; j+=2)
|
||||
{
|
||||
if (i % j == 0)
|
||||
{
|
||||
isPrime = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (isPrime)
|
||||
{
|
||||
numprimes ++;
|
||||
}
|
||||
}
|
||||
|
||||
var end = new Date();
|
||||
|
||||
var timetaken = end - start;
|
||||
timetaken = timetaken / 1000;
|
||||
|
||||
if (enablejit)
|
||||
jit(false);
|
||||
|
||||
print((enablejit ? ' JIT' : 'Non-JIT') + ": Number of primes up to: " + n + " is " + numprimes + ", counted in " + timetaken + " secs.");
|
||||
|
||||
return timetaken;
|
||||
}
|
||||
|
||||
var timenonjit = doTest(false);
|
||||
var timejit = doTest(true);
|
||||
|
||||
expect = true;
|
||||
actual = timejit < timenonjit/4;
|
||||
|
||||
reportCompare(expect, actual, summary);
|
||||
|
||||
exitFunc ('test');
|
||||
}
|
@ -1732,7 +1732,7 @@ testNestedExitStackOuter.expected = 81;
|
||||
testNestedExitStackOuter.jitstats = {
|
||||
recorderStarted: 5,
|
||||
recorderAborted: 2,
|
||||
traceTriggered: 9
|
||||
traceTriggered: 11
|
||||
};
|
||||
test(testNestedExitStackOuter);
|
||||
|
||||
@ -2580,7 +2580,7 @@ function testThinLoopDemote() {
|
||||
function f()
|
||||
{
|
||||
var k = 1;
|
||||
for (var n = 0; n < 2; n++) {
|
||||
for (var n = 0; n < 4; n++) {
|
||||
k = (k * 10);
|
||||
}
|
||||
return k;
|
||||
@ -2588,12 +2588,12 @@ function testThinLoopDemote() {
|
||||
f();
|
||||
return f();
|
||||
}
|
||||
testThinLoopDemote.expected = 100;
|
||||
testThinLoopDemote.expected = 10000;
|
||||
testThinLoopDemote.jitstats = {
|
||||
recorderStarted: 2,
|
||||
recorderAborted: 0,
|
||||
traceCompleted: 2,
|
||||
traceTriggered: 1,
|
||||
traceTriggered: 3,
|
||||
unstableLoopVariable: 1
|
||||
};
|
||||
test(testThinLoopDemote);
|
||||
@ -2642,7 +2642,7 @@ recorderAborted: 1,
|
||||
traceCompleted: 6,
|
||||
traceTriggered: 14,
|
||||
unstableLoopVariable: 3,
|
||||
noCompatInnerTrees: 0
|
||||
noCompatInnerTrees: 1
|
||||
};
|
||||
test(testWeirdDateParse);
|
||||
|
||||
@ -4411,6 +4411,120 @@ function testGeneratorDeepBail() {
|
||||
testGeneratorDeepBail.expected = 3;
|
||||
test(testGeneratorDeepBail);
|
||||
|
||||
function testRegexpGet() {
|
||||
var re = /hi/;
|
||||
var a = [];
|
||||
for (let i = 0; i < 5; ++i)
|
||||
a.push(re.source);
|
||||
return a.toString();
|
||||
}
|
||||
testRegexpGet.expected = "hi,hi,hi,hi,hi";
|
||||
test(testRegexpGet);
|
||||
|
||||
function testThrowingObjectEqUndefined()
|
||||
{
|
||||
try
|
||||
{
|
||||
var obj = { toString: function() { throw 0; } };
|
||||
for (var i = 0; i < 5; i++)
|
||||
"" + (obj == undefined);
|
||||
return i === 5;
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
return "" + e;
|
||||
}
|
||||
}
|
||||
testThrowingObjectEqUndefined.expected = true;
|
||||
testThrowingObjectEqUndefined.jitstats = {
|
||||
sideExitIntoInterpreter: 1
|
||||
};
|
||||
test(testThrowingObjectEqUndefined);
|
||||
|
||||
function x4(v) { return "" + v + v + v + v; }
|
||||
function testConvertibleObjectEqUndefined()
|
||||
{
|
||||
var compares =
|
||||
[
|
||||
false, false, false, false,
|
||||
undefined, undefined, undefined, undefined,
|
||||
false, false, false, false,
|
||||
undefined, undefined, undefined, undefined,
|
||||
false, false, false, false,
|
||||
undefined, undefined, undefined, undefined,
|
||||
false, false, false, false,
|
||||
undefined, undefined, undefined, undefined,
|
||||
false, false, false, false,
|
||||
undefined, undefined, undefined, undefined,
|
||||
];
|
||||
var count = 0;
|
||||
var obj = { valueOf: function() { count++; return 1; } };
|
||||
var results = compares.map(function(v) { return "unwritten"; });
|
||||
|
||||
for (var i = 0, sz = compares.length; i < sz; i++)
|
||||
results[i] = compares[i] == obj;
|
||||
|
||||
return results.join("") + count;
|
||||
}
|
||||
testConvertibleObjectEqUndefined.expected =
|
||||
x4(false) + x4(false) + x4(false) + x4(false) + x4(false) + x4(false) +
|
||||
x4(false) + x4(false) + x4(false) + x4(false) + "20";
|
||||
testConvertibleObjectEqUndefined.jitstats = {
|
||||
sideExitIntoInterpreter: 3
|
||||
};
|
||||
test(testConvertibleObjectEqUndefined);
|
||||
|
||||
function testUndefinedPropertyAccess() {
|
||||
var x = [1,2,3];
|
||||
var y = {};
|
||||
var a = { foo: 1 };
|
||||
y.__proto__ = x;
|
||||
var z = [x, x, x, y, y, y, y, a, a, a];
|
||||
var s = "";
|
||||
for (var i = 0; i < z.length; ++i)
|
||||
s += z[i].foo;
|
||||
return s;
|
||||
}
|
||||
testUndefinedPropertyAccess.expected = "undefinedundefinedundefinedundefinedundefinedundefinedundefined111";
|
||||
testUndefinedPropertyAccess.jitstats = {
|
||||
traceCompleted: 3
|
||||
};
|
||||
test(testUndefinedPropertyAccess);
|
||||
|
||||
q = "";
|
||||
function g() { q += "g"; }
|
||||
function h() { q += "h"; }
|
||||
a = [g, g, g, g, h];
|
||||
for (i=0; i<5; i++) { f = a[i]; f(); }
|
||||
|
||||
function testRebranding() {
|
||||
return q;
|
||||
}
|
||||
testRebranding.expected = "ggggh";
|
||||
test(testRebranding);
|
||||
delete q;
|
||||
delete g;
|
||||
delete h;
|
||||
delete a;
|
||||
delete f;
|
||||
|
||||
function testLambdaCtor() {
|
||||
var a = [];
|
||||
for (var x = 0; x < RUNLOOP; ++x) {
|
||||
var f = function(){};
|
||||
a[a.length] = new f;
|
||||
}
|
||||
|
||||
// This prints false until the upvar2 bug is fixed:
|
||||
// print(a[HOTLOOP].__proto__ !== a[HOTLOOP-1].__proto__);
|
||||
|
||||
// Assert that the last f was properly constructed.
|
||||
return a[RUNLOOP-1].__proto__ === f.prototype;
|
||||
}
|
||||
|
||||
testLambdaCtor.expected = true;
|
||||
test(testLambdaCtor);
|
||||
|
||||
/*****************************************************************************
|
||||
* *
|
||||
* _____ _ _ _____ ______ _____ _______ *
|
||||
|
File diff suppressed because one or more lines are too long
@ -8,12 +8,6 @@ ecma_3/RegExp/regress-330684.js
|
||||
ecma_3/RegExp/regress-367888.js
|
||||
js1_5/Array/regress-330812.js
|
||||
js1_5/Array/regress-350256-03.js
|
||||
js1_5/extensions/regress-330569.js
|
||||
js1_5/extensions/regress-335700.js
|
||||
js1_5/extensions/regress-342960.js
|
||||
js1_5/extensions/regress-345967.js
|
||||
js1_5/extensions/regress-350531.js
|
||||
js1_5/extensions/regress-351448.js
|
||||
js1_5/Function/regress-338121-01.js
|
||||
js1_5/Function/regress-338121-02.js
|
||||
js1_5/GC/regress-311497.js
|
||||
@ -23,6 +17,12 @@ js1_5/Regress/regress-274035.js
|
||||
js1_5/Regress/regress-312588.js
|
||||
js1_5/Regress/regress-314401.js
|
||||
js1_5/Regress/regress-329530.js
|
||||
js1_5/extensions/regress-330569.js
|
||||
js1_5/extensions/regress-335700.js
|
||||
js1_5/extensions/regress-342960.js
|
||||
js1_5/extensions/regress-345967.js
|
||||
js1_5/extensions/regress-350531.js
|
||||
js1_5/extensions/regress-351448.js
|
||||
js1_6/extensions/regress-455464-04.js
|
||||
js1_6/extensions/regress-456826.js
|
||||
js1_7/extensions/regress-458679.js
|
||||
|
@ -4,11 +4,14 @@ ecma_3/Array/regress-322135-04.js
|
||||
ecma_3/RegExp/regress-307456.js
|
||||
ecma_3/RegExp/regress-330684.js
|
||||
js1_5/Array/regress-350256-03.js
|
||||
js1_5/extensions/regress-335700.js
|
||||
js1_5/extensions/regress-345967.js
|
||||
js1_5/extensions/regress-350531.js
|
||||
js1_5/GC/regress-346794.js
|
||||
js1_5/Regress/regress-271716-n.js
|
||||
js1_5/extensions/regress-335700.js
|
||||
js1_5/extensions/regress-342960.js
|
||||
js1_5/extensions/regress-345967.js
|
||||
js1_5/extensions/regress-350531.js
|
||||
js1_6/extensions/regress-455464-04.js
|
||||
js1_7/extensions/regress-458679.js
|
||||
js1_8/extensions/regress-452913.js
|
||||
js1_8/extensions/regress-476414-01.js
|
||||
js1_8/extensions/regress-476414-02.js
|
||||
|
@ -1,17 +1,11 @@
|
||||
e4x/GC/regress-324278.js
|
||||
e4x/Regress/regress-319872.js
|
||||
ecma/Statements/12.6.3-7-n.js
|
||||
ecma_3/Array/regress-322135-03.js
|
||||
ecma_3/Array/regress-322135-04.js
|
||||
ecma_3/RegExp/regress-307456.js
|
||||
ecma_3/RegExp/regress-330684.js
|
||||
ecma/Statements/12.6.3-7-n.js
|
||||
js1_5/Array/regress-350256-03.js
|
||||
js1_5/extensions/regress-335700.js
|
||||
js1_5/extensions/regress-336409-1.js
|
||||
js1_5/extensions/regress-336410-1.js
|
||||
js1_5/extensions/regress-342960.js
|
||||
js1_5/extensions/regress-345967.js
|
||||
js1_5/extensions/regress-350531.js
|
||||
js1_5/GC/regress-319980-01.js
|
||||
js1_5/GC/regress-338653.js
|
||||
js1_5/GC/regress-346794.js
|
||||
@ -20,6 +14,17 @@ js1_5/Regress/regress-274035.js
|
||||
js1_5/Regress/regress-303213.js
|
||||
js1_5/Regress/regress-3649-n.js
|
||||
js1_5/Regress/regress-451322.js
|
||||
js1_5/extensions/regress-335700.js
|
||||
js1_5/extensions/regress-336409-1.js
|
||||
js1_5/extensions/regress-336410-1.js
|
||||
js1_5/extensions/regress-342960.js
|
||||
js1_5/extensions/regress-345967.js
|
||||
js1_5/extensions/regress-350531.js
|
||||
js1_6/extensions/regress-455464-04.js
|
||||
js1_6/extensions/regress-456826.js
|
||||
js1_7/extensions/regress-455982-01.js
|
||||
js1_7/extensions/regress-458679.js
|
||||
js1_8/extensions/regress-476414-01.js
|
||||
js1_8/extensions/regress-476414-02.js
|
||||
js1_8/extensions/regress-476427.js
|
||||
js1_8/regress/regress-464096.js
|
||||
|
@ -1,16 +1,22 @@
|
||||
e4x/Regress/regress-319872.js
|
||||
ecma/Statements/12.6.3-7-n.js
|
||||
ecma_3/Array/regress-322135-03.js
|
||||
ecma_3/Array/regress-322135-04.js
|
||||
ecma_3/RegExp/regress-307456.js
|
||||
ecma_3/RegExp/regress-330684.js
|
||||
ecma/Statements/12.6.3-7-n.js
|
||||
js1_5/Array/regress-350256-03.js
|
||||
js1_5/GC/regress-338653.js
|
||||
js1_5/GC/regress-346794.js
|
||||
js1_5/Regress/regress-271716-n.js
|
||||
js1_5/Regress/regress-274035.js
|
||||
js1_5/Regress/regress-451322.js
|
||||
js1_5/extensions/regress-335700.js
|
||||
js1_5/extensions/regress-342960.js
|
||||
js1_5/extensions/regress-345967.js
|
||||
js1_5/extensions/regress-350531.js
|
||||
js1_5/GC/regress-338653.js
|
||||
js1_5/GC/regress-346794.js
|
||||
js1_5/Regress/regress-271716-n.js
|
||||
js1_5/Regress/regress-451322.js
|
||||
js1_6/extensions/regress-455464-04.js
|
||||
js1_7/extensions/regress-458679.js
|
||||
js1_8/extensions/regress-476414-01.js
|
||||
js1_8/extensions/regress-476414-02.js
|
||||
js1_8/extensions/regress-476427.js
|
||||
js1_8/regress/regress-464096.js
|
||||
|
@ -30,46 +30,10 @@ TEST_OS=darwin, TEST_KERNEL=8.11.1, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, T
|
||||
TEST_OS=darwin, TEST_KERNEL=8.11.1, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=none, TEST_BRANCH=1.9.2, TEST_REPO=mozilla-central, TEST_BUILDTYPE=debug, TEST_TYPE=shell
|
||||
TEST_OS=darwin, TEST_KERNEL=8.11.1, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=none, TEST_BRANCH=1.9.2, TEST_REPO=mozilla-central, TEST_BUILDTYPE=opt, TEST_TYPE=browser
|
||||
TEST_OS=darwin, TEST_KERNEL=8.11.1, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=none, TEST_BRANCH=1.9.2, TEST_REPO=mozilla-central, TEST_BUILDTYPE=opt, TEST_TYPE=shell
|
||||
TEST_OS=darwin, TEST_KERNEL=9.6.0, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=-j, TEST_BRANCH=1.9.1, TEST_REPO=mozilla-1.9.1, TEST_BUILDTYPE=debug, TEST_TYPE=browser
|
||||
TEST_OS=darwin, TEST_KERNEL=9.6.0, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=-j, TEST_BRANCH=1.9.1, TEST_REPO=mozilla-1.9.1, TEST_BUILDTYPE=debug, TEST_TYPE=shell
|
||||
TEST_OS=darwin, TEST_KERNEL=9.6.0, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=-j, TEST_BRANCH=1.9.1, TEST_REPO=mozilla-1.9.1, TEST_BUILDTYPE=opt, TEST_TYPE=browser
|
||||
TEST_OS=darwin, TEST_KERNEL=9.6.0, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=-j, TEST_BRANCH=1.9.1, TEST_REPO=mozilla-1.9.1, TEST_BUILDTYPE=opt, TEST_TYPE=shell
|
||||
TEST_OS=darwin, TEST_KERNEL=9.6.0, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=-j, TEST_BRANCH=1.9.1, TEST_REPO=tracemonkey, TEST_BUILDTYPE=debug, TEST_TYPE=browser
|
||||
TEST_OS=darwin, TEST_KERNEL=9.6.0, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=-j, TEST_BRANCH=1.9.1, TEST_REPO=tracemonkey, TEST_BUILDTYPE=debug, TEST_TYPE=shell
|
||||
TEST_OS=darwin, TEST_KERNEL=9.6.0, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=-j, TEST_BRANCH=1.9.1, TEST_REPO=tracemonkey, TEST_BUILDTYPE=opt, TEST_TYPE=browser
|
||||
TEST_OS=darwin, TEST_KERNEL=9.6.0, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=-j, TEST_BRANCH=1.9.1, TEST_REPO=tracemonkey, TEST_BUILDTYPE=opt, TEST_TYPE=shell
|
||||
TEST_OS=darwin, TEST_KERNEL=9.6.0, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=-j, TEST_BRANCH=1.9.2, TEST_REPO=mozilla-central, TEST_BUILDTYPE=debug, TEST_TYPE=browser
|
||||
TEST_OS=darwin, TEST_KERNEL=9.6.0, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=-j, TEST_BRANCH=1.9.2, TEST_REPO=mozilla-central, TEST_BUILDTYPE=debug, TEST_TYPE=shell
|
||||
TEST_OS=darwin, TEST_KERNEL=9.6.0, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=-j, TEST_BRANCH=1.9.2, TEST_REPO=mozilla-central, TEST_BUILDTYPE=opt, TEST_TYPE=browser
|
||||
TEST_OS=darwin, TEST_KERNEL=9.6.0, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=-j, TEST_BRANCH=1.9.2, TEST_REPO=mozilla-central, TEST_BUILDTYPE=opt, TEST_TYPE=shell
|
||||
TEST_OS=darwin, TEST_KERNEL=9.6.0, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=none, TEST_BRANCH=1.8.1, TEST_REPO=CVS, TEST_BUILDTYPE=debug, TEST_TYPE=browser
|
||||
TEST_OS=darwin, TEST_KERNEL=9.6.0, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=none, TEST_BRANCH=1.8.1, TEST_REPO=CVS, TEST_BUILDTYPE=debug, TEST_TYPE=shell
|
||||
TEST_OS=darwin, TEST_KERNEL=9.6.0, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=none, TEST_BRANCH=1.8.1, TEST_REPO=CVS, TEST_BUILDTYPE=opt, TEST_TYPE=browser
|
||||
TEST_OS=darwin, TEST_KERNEL=9.6.0, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=none, TEST_BRANCH=1.8.1, TEST_REPO=CVS, TEST_BUILDTYPE=opt, TEST_TYPE=shell
|
||||
TEST_OS=darwin, TEST_KERNEL=9.6.0, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=none, TEST_BRANCH=1.9.0, TEST_REPO=CVS, TEST_BUILDTYPE=debug, TEST_TYPE=browser
|
||||
TEST_OS=darwin, TEST_KERNEL=9.6.0, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=none, TEST_BRANCH=1.9.0, TEST_REPO=CVS, TEST_BUILDTYPE=debug, TEST_TYPE=shell
|
||||
TEST_OS=darwin, TEST_KERNEL=9.6.0, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=none, TEST_BRANCH=1.9.0, TEST_REPO=CVS, TEST_BUILDTYPE=opt, TEST_TYPE=browser
|
||||
TEST_OS=darwin, TEST_KERNEL=9.6.0, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=none, TEST_BRANCH=1.9.0, TEST_REPO=CVS, TEST_BUILDTYPE=opt, TEST_TYPE=shell
|
||||
TEST_OS=darwin, TEST_KERNEL=9.6.0, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=none, TEST_BRANCH=1.9.1, TEST_REPO=mozilla-1.9.1, TEST_BUILDTYPE=debug, TEST_TYPE=browser
|
||||
TEST_OS=darwin, TEST_KERNEL=9.6.0, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=none, TEST_BRANCH=1.9.1, TEST_REPO=mozilla-1.9.1, TEST_BUILDTYPE=debug, TEST_TYPE=shell
|
||||
TEST_OS=darwin, TEST_KERNEL=9.6.0, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=none, TEST_BRANCH=1.9.1, TEST_REPO=mozilla-1.9.1, TEST_BUILDTYPE=opt, TEST_TYPE=browser
|
||||
TEST_OS=darwin, TEST_KERNEL=9.6.0, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=none, TEST_BRANCH=1.9.1, TEST_REPO=mozilla-1.9.1, TEST_BUILDTYPE=opt, TEST_TYPE=shell
|
||||
TEST_OS=darwin, TEST_KERNEL=9.6.0, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=none, TEST_BRANCH=1.9.1, TEST_REPO=tracemonkey, TEST_BUILDTYPE=debug, TEST_TYPE=browser
|
||||
TEST_OS=darwin, TEST_KERNEL=9.6.0, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=none, TEST_BRANCH=1.9.1, TEST_REPO=tracemonkey, TEST_BUILDTYPE=debug, TEST_TYPE=shell
|
||||
TEST_OS=darwin, TEST_KERNEL=9.6.0, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=none, TEST_BRANCH=1.9.1, TEST_REPO=tracemonkey, TEST_BUILDTYPE=opt, TEST_TYPE=browser
|
||||
TEST_OS=darwin, TEST_KERNEL=9.6.0, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=none, TEST_BRANCH=1.9.1, TEST_REPO=tracemonkey, TEST_BUILDTYPE=opt, TEST_TYPE=shell
|
||||
TEST_OS=darwin, TEST_KERNEL=9.6.0, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=none, TEST_BRANCH=1.9.2, TEST_REPO=mozilla-central, TEST_BUILDTYPE=debug, TEST_TYPE=browser
|
||||
TEST_OS=darwin, TEST_KERNEL=9.6.0, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=none, TEST_BRANCH=1.9.2, TEST_REPO=mozilla-central, TEST_BUILDTYPE=debug, TEST_TYPE=shell
|
||||
TEST_OS=darwin, TEST_KERNEL=9.6.0, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=none, TEST_BRANCH=1.9.2, TEST_REPO=mozilla-central, TEST_BUILDTYPE=opt, TEST_TYPE=browser
|
||||
TEST_OS=darwin, TEST_KERNEL=9.6.0, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=none, TEST_BRANCH=1.9.2, TEST_REPO=mozilla-central, TEST_BUILDTYPE=opt, TEST_TYPE=shell
|
||||
TEST_OS=linux, TEST_KERNEL=2.6.18, TEST_PROCESSORTYPE=amd32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=none, TEST_BRANCH=1.9.0, TEST_REPO=CVS, TEST_BUILDTYPE=debug, TEST_TYPE=browser
|
||||
TEST_OS=linux, TEST_KERNEL=2.6.18, TEST_PROCESSORTYPE=amd32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=none, TEST_BRANCH=1.9.0, TEST_REPO=CVS, TEST_BUILDTYPE=debug, TEST_TYPE=shell
|
||||
TEST_OS=linux, TEST_KERNEL=2.6.18, TEST_PROCESSORTYPE=amd32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=none, TEST_BRANCH=1.9.0, TEST_REPO=CVS, TEST_BUILDTYPE=opt, TEST_TYPE=browser
|
||||
TEST_OS=linux, TEST_KERNEL=2.6.18, TEST_PROCESSORTYPE=amd32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=none, TEST_BRANCH=1.9.0, TEST_REPO=CVS, TEST_BUILDTYPE=opt, TEST_TYPE=shell
|
||||
TEST_OS=linux, TEST_KERNEL=2.6.18, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=3, TEST_TIMEZONE=-0800, TEST_OPTIONS=none, TEST_BRANCH=1.9.0, TEST_REPO=CVS, TEST_BUILDTYPE=debug, TEST_TYPE=browser
|
||||
TEST_OS=linux, TEST_KERNEL=2.6.18, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=3, TEST_TIMEZONE=-0800, TEST_OPTIONS=none, TEST_BRANCH=1.9.0, TEST_REPO=CVS, TEST_BUILDTYPE=debug, TEST_TYPE=shell
|
||||
TEST_OS=linux, TEST_KERNEL=2.6.18, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=3, TEST_TIMEZONE=-0800, TEST_OPTIONS=none, TEST_BRANCH=1.9.0, TEST_REPO=CVS, TEST_BUILDTYPE=opt, TEST_TYPE=browser
|
||||
TEST_OS=linux, TEST_KERNEL=2.6.18, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=3, TEST_TIMEZONE=-0800, TEST_OPTIONS=none, TEST_BRANCH=1.9.0, TEST_REPO=CVS, TEST_BUILDTYPE=opt, TEST_TYPE=shell
|
||||
TEST_OS=linux, TEST_KERNEL=2.6.18, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=-j, TEST_BRANCH=1.9.1, TEST_REPO=mozilla-1.9.1, TEST_BUILDTYPE=debug, TEST_TYPE=browser
|
||||
TEST_OS=linux, TEST_KERNEL=2.6.18, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=-j, TEST_BRANCH=1.9.1, TEST_REPO=mozilla-1.9.1, TEST_BUILDTYPE=debug, TEST_TYPE=shell
|
||||
TEST_OS=linux, TEST_KERNEL=2.6.18, TEST_PROCESSORTYPE=intel32, TEST_MEMORY=4, TEST_TIMEZONE=-0800, TEST_OPTIONS=-j, TEST_BRANCH=1.9.1, TEST_REPO=mozilla-1.9.1, TEST_BUILDTYPE=opt, TEST_TYPE=browser
|
||||
|
2
nsprpub/configure
vendored
2
nsprpub/configure
vendored
@ -6071,7 +6071,7 @@ s%\[%\\&%g
|
||||
s%\]%\\&%g
|
||||
s%\$%$$%g
|
||||
EOF
|
||||
DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' ' | tr '\015' ' '`
|
||||
DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
|
||||
rm -f conftest.defs
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user