зеркало из https://github.com/mozilla/gecko-dev.git
Fix strict-aliasing warning from 18d56745c3e6
--HG-- extra : rebase_source : 446fc01cba89ea45825cd1dc10716a05b9ec9818
This commit is contained in:
Родитель
2d417c6132
Коммит
fea36bd719
|
@ -704,10 +704,10 @@ MarkWordConservatively(JSTracer *trc, jsuword w)
|
|||
}
|
||||
|
||||
static void
|
||||
MarkRangeConservatively(JSTracer *trc, jsuword *begin, jsuword *end)
|
||||
MarkRangeConservatively(JSTracer *trc, const jsuword *begin, const jsuword *end)
|
||||
{
|
||||
JS_ASSERT(begin <= end);
|
||||
for (jsuword *i = begin; i != end; ++i)
|
||||
for (const jsuword *i = begin; i != end; ++i)
|
||||
MarkWordConservatively(trc, *i);
|
||||
}
|
||||
|
||||
|
@ -734,15 +734,15 @@ MarkThreadDataConservatively(JSTracer *trc, JSThreadData *td)
|
|||
void
|
||||
MarkStackRangeConservatively(JSTracer *trc, Value *beginv, Value *endv)
|
||||
{
|
||||
jsuword *begin = beginv->payloadWord();
|
||||
jsuword *end = endv->payloadWord();;
|
||||
const jsuword *begin = beginv->payloadWord();
|
||||
const jsuword *end = endv->payloadWord();;
|
||||
#ifdef JS_NUNBOX32
|
||||
/*
|
||||
* With 64-bit jsvals on 32-bit systems, we can optimize a bit by
|
||||
* scanning only the payloads.
|
||||
*/
|
||||
JS_ASSERT(begin <= end);
|
||||
for (jsuword *i = begin; i != end; i += sizeof(Value)/sizeof(jsuword))
|
||||
for (const jsuword *i = begin; i != end; i += sizeof(Value)/sizeof(jsuword))
|
||||
MarkWordConservatively(trc, *i);
|
||||
#else
|
||||
MarkRangeConservatively(trc, begin, end);
|
||||
|
|
|
@ -5077,7 +5077,7 @@ js_GetProperty(JSContext *cx, JSObject *obj, JSObject *receiver, jsid id, Value
|
|||
}
|
||||
|
||||
JSBool
|
||||
js::GetPropertyDefault(JSContext *cx, JSObject *obj, jsid id, Value def, Value *vp)
|
||||
js::GetPropertyDefault(JSContext *cx, JSObject *obj, jsid id, const Value &def, Value *vp)
|
||||
{
|
||||
JSProperty *prop;
|
||||
JSObject *obj2;
|
||||
|
|
|
@ -220,7 +220,7 @@ js_GetProperty(JSContext *cx, JSObject *obj, jsid id, js::Value *vp)
|
|||
namespace js {
|
||||
|
||||
extern JSBool
|
||||
GetPropertyDefault(JSContext *cx, JSObject *obj, jsid id, Value def, Value *vp);
|
||||
GetPropertyDefault(JSContext *cx, JSObject *obj, jsid id, const Value &def, Value *vp);
|
||||
|
||||
} /* namespace js */
|
||||
|
||||
|
|
|
@ -283,6 +283,7 @@ typedef union jsval_layout
|
|||
JSObject *obj;
|
||||
void *ptr;
|
||||
JSWhyMagic why;
|
||||
jsuword word;
|
||||
} payload;
|
||||
JSValueTag tag;
|
||||
} s;
|
||||
|
@ -305,6 +306,7 @@ typedef union jsval_layout
|
|||
int32 i32;
|
||||
uint32 u32;
|
||||
JSWhyMagic why;
|
||||
jsuword word;
|
||||
} payload;
|
||||
} s;
|
||||
double asDouble;
|
||||
|
@ -326,6 +328,7 @@ typedef union jsval_layout
|
|||
JSObject *obj;
|
||||
void *ptr;
|
||||
JSWhyMagic why;
|
||||
jsuword word;
|
||||
} payload;
|
||||
} s;
|
||||
double asDouble;
|
||||
|
|
|
@ -728,8 +728,8 @@ class Value
|
|||
return data.asPtr;
|
||||
}
|
||||
|
||||
jsuword *payloadWord() const {
|
||||
return (jsuword *)&data.s.payload;
|
||||
const jsuword *payloadWord() const {
|
||||
return &data.s.payload.word;
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
Загрузка…
Ссылка в новой задаче