Bug 1409295 part 4 - Use little endian for int32/uint32 bytecode operands. r=luke

--HG--
extra : rebase_source : e78ea0debc959ab8c94d372c50745bffdf015b76
This commit is contained in:
Jan de Mooij 2017-10-19 13:53:09 +01:00
parent 334c5719e0
commit 890dd39ca8
2 changed files with 9 additions and 12 deletions

View File

@ -10214,10 +10214,7 @@ BytecodeEmitter::replaceNewInitWithNewObject(JSObject* obj, ptrdiff_t offset)
MOZ_ASSERT(code[0] == JSOP_NEWINIT);
code[0] = JSOP_NEWOBJECT;
code[1] = jsbytecode(index >> 24);
code[2] = jsbytecode(index >> 16);
code[3] = jsbytecode(index >> 8);
code[4] = jsbytecode(index);
SET_UINT32(code, index);
return true;
}

View File

@ -177,19 +177,19 @@ GET_INT8(const jsbytecode* pc)
static MOZ_ALWAYS_INLINE uint32_t
GET_UINT32(const jsbytecode* pc)
{
return (uint32_t(pc[1]) << 24) |
(uint32_t(pc[2]) << 16) |
(uint32_t(pc[3]) << 8) |
uint32_t(pc[4]);
return (uint32_t(pc[4]) << 24) |
(uint32_t(pc[3]) << 16) |
(uint32_t(pc[2]) << 8) |
uint32_t(pc[1]);
}
static MOZ_ALWAYS_INLINE void
SET_UINT32(jsbytecode* pc, uint32_t u)
{
pc[1] = jsbytecode(u >> 24);
pc[2] = jsbytecode(u >> 16);
pc[3] = jsbytecode(u >> 8);
pc[4] = jsbytecode(u);
pc[1] = jsbytecode(u);
pc[2] = jsbytecode(u >> 8);
pc[3] = jsbytecode(u >> 16);
pc[4] = jsbytecode(u >> 24);
}
static MOZ_ALWAYS_INLINE int32_t