Fixed Linux 64-bit opt build.

This commit is contained in:
David Anderson 2010-06-28 15:51:50 -07:00
parent 452e333382
commit da423a57a7
4 changed files with 14 additions and 53 deletions

View File

@ -536,11 +536,6 @@ JSRuntime::init(uint32 maxbytes)
if (!js_InitGC(this, maxbytes) || !js_InitAtomState(this))
return false;
#ifdef JS_64BIT
if (!JSString::initStringTables())
return false;
#endif
deflatedStringCache = new js::DeflatedStringCache();
if (!deflatedStringCache || !deflatedStringCache->init())
return false;

View File

@ -2639,11 +2639,7 @@ static const jschar UnitStringData[] = {
#pragma pack(push, 8)
#endif
#ifndef JS_64BIT
JSString JSString::unitStringTable[]
#else
JSString JSString::staticUnitStringTable[]
#endif
#ifdef __GNUC__
__attribute__ ((aligned (8)))
#endif
@ -2682,11 +2678,6 @@ __attribute__ ((aligned (8)))
U(0xf8), U(0xf9), U(0xfa), U(0xfb), U(0xfc), U(0xfd), U(0xfe), U(0xff)
};
#ifdef JS_64BIT
JSString *JSString::unitStringTable = staticUnitStringTable;
size_t JSString::unitStringTableSize = sizeof(staticUnitStringTable);
#endif
#ifdef __SUNPRO_CC
#pragma pack(0)
#else
@ -2757,11 +2748,7 @@ static const jschar Hundreds[] = {
#pragma pack(push, 8)
#endif
#ifndef JS_64BIT
JSString JSString::intStringTable[]
#else
JSString JSString::staticIntStringTable[]
#endif
#ifdef __GNUC__
__attribute__ ((aligned (8)))
#endif
@ -2800,11 +2787,6 @@ __attribute__ ((aligned (8)))
L3(0xf8), L3(0xf9), L3(0xfa), L3(0xfb), L3(0xfc), L3(0xfd), L3(0xfe), L3(0xff)
};
#ifdef JS_64BIT
JSString *JSString::intStringTable = staticIntStringTable;
size_t JSString::intStringTableSize = sizeof(staticIntStringTable);
#endif
#ifdef __SUNPRO_CC
#pragma pack(0)
#else

View File

@ -289,20 +289,8 @@ struct JSString {
#pragma align 8 (__1cIJSStringPunitStringTable_, __1cIJSStringOintStringTable_)
#endif
#ifndef JS_64BIT
static JSString unitStringTable[];
static JSString intStringTable[];
#else
static JSString staticUnitStringTable[];
static JSString staticIntStringTable[];
static JSString *unitStringTable;
static JSString *intStringTable;
static size_t unitStringTableSize;
static size_t intStringTableSize;
static bool initStringTables();
static void freeStringTables();
#endif
static const char *deflatedIntStringTable[];
static const char deflatedUnitStringTable[];

View File

@ -232,17 +232,6 @@ public:
}
JS_AddNamedStringRoot(cx, &mStr, "Value ToString helper");
}
ToString(JSContext *aCx, jsid id, JSBool aThrow = JS_FALSE)
: cx(aCx)
, mThrow(aThrow)
{
mStr = JS_ValueToString(cx, IdToJsval(id));
if (!aThrow && !mStr && JS_IsExceptionPending(cx)) {
if (!JS_ReportPendingException(cx))
JS_ClearPendingException(cx);
}
JS_AddNamedStringRoot(cx, &mStr, "Value ToString helper");
}
~ToString() {
JS_RemoveStringRoot(cx, &mStr);
}
@ -257,6 +246,13 @@ private:
JSBool mThrow;
};
class IdToString : public ToString {
public:
IdToString(JSContext *cx, jsid id, JSBool aThrow = JS_FALSE)
: ToString(cx, IdToJsval(id), aThrow)
{ }
};
static char *
GetLine(FILE *file, const char * prompt)
{
@ -4313,7 +4309,7 @@ its_addProperty(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
if (!its_noisy)
return JS_TRUE;
ToString idString(cx, id);
IdToString idString(cx, id);
fprintf(gOutFile, "adding its property %s,", idString.getBytes());
ToString valueString(cx, *vp);
fprintf(gOutFile, " initial value %s\n", valueString.getBytes());
@ -4326,7 +4322,7 @@ its_delProperty(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
if (!its_noisy)
return JS_TRUE;
ToString idString(cx, id);
IdToString idString(cx, id);
fprintf(gOutFile, "deleting its property %s,", idString.getBytes());
ToString valueString(cx, *vp);
fprintf(gOutFile, " initial value %s\n", valueString.getBytes());
@ -4339,7 +4335,7 @@ its_getProperty(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
if (!its_noisy)
return JS_TRUE;
ToString idString(cx, id);
IdToString idString(cx, id);
fprintf(gOutFile, "getting its property %s,", idString.getBytes());
ToString valueString(cx, *vp);
fprintf(gOutFile, " initial value %s\n", valueString.getBytes());
@ -4349,7 +4345,7 @@ its_getProperty(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
static JSBool
its_setProperty(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
{
ToString idString(cx, id);
IdToString idString(cx, id);
if (its_noisy) {
fprintf(gOutFile, "setting its property %s,", idString.getBytes());
ToString valueString(cx, *vp);
@ -4419,7 +4415,7 @@ its_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags,
JSObject **objp)
{
if (its_noisy) {
ToString idString(cx, id);
IdToString idString(cx, id);
fprintf(gOutFile, "resolving its property %s, flags {%s,%s,%s}\n",
idString.getBytes(),
(flags & JSRESOLVE_QUALIFIED) ? "qualified" : "",
@ -4698,7 +4694,7 @@ env_setProperty(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
#if !defined XP_BEOS && !defined XP_OS2 && !defined SOLARIS
int rv;
ToString idstr(cx, id, JS_TRUE);
IdToString idstr(cx, id, JS_TRUE);
if (idstr.threw())
return JS_FALSE;
ToString valstr(cx, *vp, JS_TRUE);
@ -4777,7 +4773,7 @@ env_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags,
if (flags & JSRESOLVE_ASSIGNING)
return JS_TRUE;
ToString idstr(cx, id, JS_TRUE);
IdToString idstr(cx, id, JS_TRUE);
if (idstr.threw())
return JS_FALSE;