зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1115477 - Fix -Wunused and -Wtype-limits warnings in js/src. r=jandem
This commit is contained in:
Родитель
ab256a8d8b
Коммит
793edf7daf
|
@ -119,10 +119,9 @@ class Logging
|
|||
ptr = nullptr;
|
||||
}
|
||||
|
||||
out = nsPrintfCString("<%s %s:%d:%p>", side, objDesc, id, ptr);
|
||||
out = nsPrintfCString("<%s %s:%d:%p>", side, objDesc, id.serialNumber(), ptr);
|
||||
}
|
||||
|
||||
|
||||
void format(const ReceiverObj &obj, nsCString &out) {
|
||||
formatObject(true, true, obj.id, out);
|
||||
}
|
||||
|
|
|
@ -113,17 +113,17 @@ AsmJSFrameIterator::computeLine(uint32_t *column) const
|
|||
#if defined(JS_CODEGEN_X64)
|
||||
# if defined(DEBUG)
|
||||
static const unsigned PushedRetAddr = 0;
|
||||
static const unsigned PostStorePrePopFP = 0;
|
||||
# endif
|
||||
static const unsigned PushedFP = 10;
|
||||
static const unsigned StoredFP = 14;
|
||||
static const unsigned PostStorePrePopFP = 0;
|
||||
#elif defined(JS_CODEGEN_X86)
|
||||
# if defined(DEBUG)
|
||||
static const unsigned PushedRetAddr = 0;
|
||||
static const unsigned PostStorePrePopFP = 0;
|
||||
# endif
|
||||
static const unsigned PushedFP = 8;
|
||||
static const unsigned StoredFP = 11;
|
||||
static const unsigned PostStorePrePopFP = 0;
|
||||
#elif defined(JS_CODEGEN_ARM)
|
||||
static const unsigned PushedRetAddr = 4;
|
||||
static const unsigned PushedFP = 16;
|
||||
|
@ -137,10 +137,10 @@ static const unsigned PostStorePrePopFP = 4;
|
|||
#elif defined(JS_CODEGEN_NONE)
|
||||
# if defined(DEBUG)
|
||||
static const unsigned PushedRetAddr = 0;
|
||||
static const unsigned PostStorePrePopFP = 0;
|
||||
# endif
|
||||
static const unsigned PushedFP = 1;
|
||||
static const unsigned StoredFP = 1;
|
||||
static const unsigned PostStorePrePopFP = 0;
|
||||
#else
|
||||
# error "Unknown architecture!"
|
||||
#endif
|
||||
|
|
|
@ -49,26 +49,31 @@ using mozilla::PodCopy;
|
|||
using mozilla::PodZero;
|
||||
|
||||
static inline jsid
|
||||
id_prototype(JSContext *cx) {
|
||||
id_prototype(JSContext *cx)
|
||||
{
|
||||
return NameToId(cx->names().prototype);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
static inline jsid
|
||||
id___proto__(JSContext *cx) {
|
||||
id___proto__(JSContext *cx)
|
||||
{
|
||||
return NameToId(cx->names().proto);
|
||||
}
|
||||
|
||||
static inline jsid
|
||||
id_constructor(JSContext *cx) {
|
||||
id_constructor(JSContext *cx)
|
||||
{
|
||||
return NameToId(cx->names().constructor);
|
||||
}
|
||||
|
||||
static inline jsid
|
||||
id_caller(JSContext *cx) {
|
||||
id_caller(JSContext *cx)
|
||||
{
|
||||
return NameToId(cx->names().caller);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
const char *
|
||||
types::TypeIdStringImpl(jsid id)
|
||||
{
|
||||
|
@ -84,6 +89,7 @@ types::TypeIdStringImpl(jsid id)
|
|||
PutEscapedString(bufs[which], 100, JSID_TO_FLAT_STRING(id), 0);
|
||||
return bufs[which];
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -62,12 +62,12 @@ namespace frontend {
|
|||
* for exception unwinding, but storing their boundaries here is helpful for
|
||||
* heuristics that need to know whether a given op is inside a loop.
|
||||
*/
|
||||
typedef enum JSTryNoteKind {
|
||||
enum JSTryNoteKind {
|
||||
JSTRY_CATCH,
|
||||
JSTRY_FINALLY,
|
||||
JSTRY_ITER,
|
||||
JSTRY_LOOP
|
||||
} JSTryNoteKind;
|
||||
};
|
||||
|
||||
/*
|
||||
* Exception handling record.
|
||||
|
@ -1872,9 +1872,13 @@ class LazyScript : public gc::TenuredCell
|
|||
// Heap allocated table with any free variables or inner functions.
|
||||
void *table_;
|
||||
|
||||
// Add padding so LazyScript is gc::Cell aligned. Make padding protected
|
||||
// instead of private to suppress -Wunused-private-field compiler warnings.
|
||||
protected:
|
||||
#if JS_BITS_PER_WORD == 32
|
||||
uint32_t padding;
|
||||
#endif
|
||||
private:
|
||||
|
||||
struct PackedView {
|
||||
// Assorted bits that should really be in ScriptSourceObject.
|
||||
|
|
|
@ -772,8 +772,10 @@ template <typename CharT>
|
|||
StaticStrings::isStatic(const CharT *chars, size_t length)
|
||||
{
|
||||
switch (length) {
|
||||
case 1:
|
||||
return chars[0] < UNIT_STATIC_LIMIT;
|
||||
case 1: {
|
||||
char16_t c = chars[0];
|
||||
return c < UNIT_STATIC_LIMIT;
|
||||
}
|
||||
case 2:
|
||||
return fitsInSmallChar(chars[0]) && fitsInSmallChar(chars[1]);
|
||||
case 3:
|
||||
|
|
Загрузка…
Ссылка в новой задаче