Propagated changes from JS_STABLE_10131998_BRANCH, required to build mozilla.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12861 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
Binary file not shown.
@@ -40,52 +40,70 @@ endif
|
||||
|
||||
MODULE = js
|
||||
|
||||
CSRCS = jsapi.c \
|
||||
jsarray.c \
|
||||
jsatom.c \
|
||||
jsbool.c \
|
||||
jscntxt.c \
|
||||
jsdate.c \
|
||||
jsdbgapi.c \
|
||||
jsemit.c \
|
||||
jsfun.c \
|
||||
jsgc.c \
|
||||
jsinterp.c \
|
||||
jsmath.c \
|
||||
jsnum.c \
|
||||
jsobj.c \
|
||||
jsopcode.c \
|
||||
jsparse.c \
|
||||
jsregexp.c \
|
||||
jsscan.c \
|
||||
jsscope.c \
|
||||
jsscript.c \
|
||||
jsstr.c \
|
||||
jslock.c \
|
||||
jsxdrapi.c \
|
||||
prmjtime.c \
|
||||
CSRCS = jsapi.c \
|
||||
jsarena.c \
|
||||
jsarray.c \
|
||||
jsatom.c \
|
||||
jsbool.c \
|
||||
jscntxt.c \
|
||||
jsdate.c \
|
||||
jsdbgapi.c \
|
||||
jsdtoa.c \
|
||||
jsemit.c \
|
||||
jsexn.c \
|
||||
jsfun.c \
|
||||
jsgc.c \
|
||||
jshash.c \
|
||||
jsinterp.c \
|
||||
jslock.c \
|
||||
jslog2.c \
|
||||
jslong.c \
|
||||
jsmath.c \
|
||||
jsnum.c \
|
||||
jsobj.c \
|
||||
jsopcode.c \
|
||||
jsparse.c \
|
||||
jsprf.c \
|
||||
jsregexp.c \
|
||||
jsscan.c \
|
||||
jsscope.c \
|
||||
jsscript.c \
|
||||
jsstr.c \
|
||||
jsutil.c \
|
||||
jsxdrapi.c \
|
||||
prmjtime.c \
|
||||
$(NULL)
|
||||
|
||||
EXPORTS = jsapi.h \
|
||||
EXPORTS = js.msg \
|
||||
jsapi.h \
|
||||
jsarray.h \
|
||||
jsarena.h \
|
||||
jsatom.h \
|
||||
jsbit.h \
|
||||
jsbool.h \
|
||||
jsclist.h \
|
||||
jscntxt.h \
|
||||
jscompat.h \
|
||||
jsconfig.h \
|
||||
jscpucfg.h \
|
||||
jsdate.h \
|
||||
jsdbgapi.h \
|
||||
jsemit.h \
|
||||
jsfun.h \
|
||||
jsgc.h \
|
||||
jshash.h \
|
||||
jsinterp.h \
|
||||
jslock.h \
|
||||
jslong.h \
|
||||
jsmath.h \
|
||||
jsnum.h \
|
||||
jsobj.h \
|
||||
jsopcode.def \
|
||||
jsopcode.tbl \
|
||||
jsopcode.h \
|
||||
jsosdep.h \
|
||||
jsotypes.h \
|
||||
jsparse.h \
|
||||
jsprf.h \
|
||||
jsprvtd.h \
|
||||
jspubtd.h \
|
||||
jsregexp.h \
|
||||
@@ -93,6 +111,8 @@ EXPORTS = jsapi.h \
|
||||
jsscope.h \
|
||||
jsscript.h \
|
||||
jsstr.h \
|
||||
jstypes.h \
|
||||
jsutil.h \
|
||||
jsxdrapi.h \
|
||||
$(NULL)
|
||||
|
||||
@@ -107,7 +127,6 @@ JS_SAFE_ARENA = 1
|
||||
|
||||
ifdef JS_SAFE_ARENA
|
||||
DEFINES += -DJS_USE_SAFE_ARENA
|
||||
CSRCS += prarena.c
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
@@ -202,7 +221,7 @@ $(OBJDIR)/js$(BIN_SUFFIX): $(OBJDIR)/js.o $(LIBRARY)
|
||||
endif
|
||||
|
||||
# hardwire dependencies on jsopcode.def
|
||||
jsopcode.h jsopcode.c: jsopcode.def
|
||||
jsopcode.h jsopcode.c: jsopcode.tbl
|
||||
|
||||
# this section was put in the merged by danda into the
|
||||
# JAVA_*_MERGE section and normally would have
|
||||
|
||||
@@ -35,7 +35,7 @@ CPU_ARCH = x86
|
||||
endif
|
||||
GFX_ARCH = x
|
||||
|
||||
OS_CFLAGS = -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DLINUX
|
||||
OS_CFLAGS = -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE
|
||||
OS_LIBS = -lm -lc
|
||||
|
||||
ASFLAGS += -x assembler-with-cpp
|
||||
|
||||
@@ -57,12 +57,6 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef linux
|
||||
#ifndef LINUX
|
||||
# error "LINUX is not defined"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef bsdi
|
||||
#ifndef BSDI
|
||||
# error "BSDI is not defined"
|
||||
|
||||
@@ -345,7 +345,7 @@
|
||||
#define PR_WORDS_PER_DWORD_LOG2 1L
|
||||
|
||||
|
||||
#elif defined(LINUX)
|
||||
#elif defined(linux)
|
||||
|
||||
#ifdef __powerpc__
|
||||
#undef IS_LITTLE_ENDIAN
|
||||
|
||||
@@ -62,7 +62,7 @@ JS_END_EXTERN_C
|
||||
#elif defined(IRIX)
|
||||
#define HAVE_LONG_LONG
|
||||
|
||||
#elif defined(LINUX)
|
||||
#elif defined(linux)
|
||||
#undef HAVE_LONG_LONG
|
||||
|
||||
#elif defined(OSF1)
|
||||
|
||||
@@ -32,7 +32,9 @@
|
||||
#define PROTYPES_H
|
||||
|
||||
/* SVR4 typedef of uint is commonly found on UNIX machines. */
|
||||
#ifndef XP_UNIX
|
||||
#ifdef XP_UNIX
|
||||
#include <sys/types.h>
|
||||
#else
|
||||
typedef JSUintn uint;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <ctype.h>
|
||||
#include "jspubtd.h"
|
||||
#include "jsprvtd.h"
|
||||
#include "jshash.h"
|
||||
|
||||
JS_BEGIN_EXTERN_C
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
#ifdef _WIN32
|
||||
# define JS_IMPORT_DATA(__x) _declspec(dllimport) __x
|
||||
#else
|
||||
# define JS_IMPORT_DATA(__x) JS_EXPORT_DATA(__x)
|
||||
# define JS_IMPORT_DATA(__x) __x
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
@@ -28,6 +28,93 @@
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifdef XP_MAC
|
||||
# include <Types.h>
|
||||
# include <stdarg.h>
|
||||
# include "jsprf.h"
|
||||
#endif
|
||||
|
||||
#ifdef XP_MAC
|
||||
/*
|
||||
* PStrFromCStr converts the source C string to a destination
|
||||
* pascal string as it copies. The dest string will
|
||||
* be truncated to fit into an Str255 if necessary.
|
||||
* If the C String pointer is NULL, the pascal string's length is
|
||||
* set to zero.
|
||||
*/
|
||||
static void PStrFromCStr(const char* src, Str255 dst)
|
||||
{
|
||||
short length = 0;
|
||||
|
||||
/* handle case of overlapping strings */
|
||||
if ( (void*)src == (void*)dst )
|
||||
{
|
||||
unsigned char* curdst = &dst[1];
|
||||
unsigned char thisChar;
|
||||
|
||||
thisChar = *(const unsigned char*)src++;
|
||||
while ( thisChar != '\0' )
|
||||
{
|
||||
unsigned char nextChar;
|
||||
|
||||
/*
|
||||
* Use nextChar so we don't overwrite what we
|
||||
* are about to read
|
||||
*/
|
||||
nextChar = *(const unsigned char*)src++;
|
||||
*curdst++ = thisChar;
|
||||
thisChar = nextChar;
|
||||
|
||||
if ( ++length >= 255 )
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if ( src != NULL )
|
||||
{
|
||||
unsigned char* curdst = &dst[1];
|
||||
/* count down so test it loop is faster */
|
||||
short overflow = 255;
|
||||
register char temp;
|
||||
|
||||
/*
|
||||
* Can't do the K&R C thing of while (*s++ = *t++)
|
||||
* because it will copy trailing zero which might
|
||||
* overrun pascal buffer. Instead we use a temp variable.
|
||||
*/
|
||||
while ( (temp = *src++) != 0 )
|
||||
{
|
||||
*(char*)curdst++ = temp;
|
||||
|
||||
if ( --overflow <= 0 )
|
||||
break;
|
||||
}
|
||||
length = 255 - overflow;
|
||||
}
|
||||
dst[0] = length;
|
||||
}
|
||||
|
||||
static void debugstr(const char *debuggerMsg)
|
||||
{
|
||||
Str255 pStr;
|
||||
|
||||
PStrFromCStr(debuggerMsg, pStr);
|
||||
DebugStr(pStr);
|
||||
}
|
||||
|
||||
static void dprintf(const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
char *buffer;
|
||||
|
||||
va_start(ap, format);
|
||||
buffer = (char *)JS_vsmprintf(format, ap);
|
||||
va_end(ap);
|
||||
|
||||
debugstr(buffer);
|
||||
JS_DELETE(buffer);
|
||||
}
|
||||
#endif /* XP_MAC */
|
||||
|
||||
JS_EXPORT_API(void) JS_Assert(const char *s, const char *file, JSIntn ln)
|
||||
{
|
||||
#if defined(XP_UNIX) || defined(XP_OS2)
|
||||
|
||||
@@ -392,7 +392,7 @@ JSClass JavaArray_class = {
|
||||
JavaArray_getObjectOps,
|
||||
};
|
||||
|
||||
extern JS_FRIEND_DATA(JSObjectOps) js_ObjectOps;
|
||||
extern JS_IMPORT_DATA(JSObjectOps) js_ObjectOps;
|
||||
|
||||
|
||||
/* Initialize the JS JavaArray class */
|
||||
|
||||
@@ -576,7 +576,7 @@ getClass(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
extern JS_FRIEND_DATA(JSObjectOps) js_ObjectOps;
|
||||
extern JS_IMPORT_DATA(JSObjectOps) js_ObjectOps;
|
||||
|
||||
JSBool
|
||||
jsj_init_JavaClass(JSContext *cx, JSObject *global_obj)
|
||||
|
||||
@@ -674,7 +674,7 @@ JSClass JavaObject_class = {
|
||||
JavaObject_getObjectOps,
|
||||
};
|
||||
|
||||
extern JS_FRIEND_DATA(JSObjectOps) js_ObjectOps;
|
||||
extern JS_IMPORT_DATA(JSObjectOps) js_ObjectOps;
|
||||
|
||||
|
||||
JSBool
|
||||
|
||||
@@ -44,7 +44,10 @@
|
||||
|
||||
#ifdef XP_UNIX
|
||||
|
||||
#ifdef SOLARIS
|
||||
/* The following line used to be ifdef SOLARIS, which seems to be required
|
||||
to build on some SOLARIS platforms, but on others it causes duplicate
|
||||
function declaration errors. mccabe will have to investigate further. */
|
||||
#if 0
|
||||
extern int gettimeofday(struct timeval *tv);
|
||||
#endif
|
||||
|
||||
@@ -278,7 +281,10 @@ PRMJ_Now(void)
|
||||
#endif
|
||||
|
||||
#ifdef XP_UNIX
|
||||
#if defined(SOLARIS)
|
||||
/* The following line used to be ifdef SOLARIS, which seems to be required
|
||||
to build on some SOLARIS platforms, but on others it causes duplicate
|
||||
function declaration errors. mccabe will have to investigate further. */
|
||||
#if 0
|
||||
gettimeofday(&tv);
|
||||
#else
|
||||
gettimeofday(&tv, 0);
|
||||
|
||||
Reference in New Issue
Block a user