Bug 720316 - Introduce GET_UINT8 and SET_UINT8 helpers for bytecode immediate examination/setting. r=luke

This commit is contained in:
Jeff Walden
2012-01-17 17:55:27 -08:00
parent 1a10eaa53b
commit eefa7e7de1
6 changed files with 32 additions and 22 deletions

View File

@@ -151,6 +151,18 @@ typedef enum JSOp {
* Immediate operand getters, setters, and bounds.
*/
static JS_ALWAYS_INLINE uint8_t
GET_UINT8(jsbytecode *pc)
{
return (uint8_t) pc[1];
}
static JS_ALWAYS_INLINE void
SET_UINT8(jsbytecode *pc, uint8_t u)
{
pc[1] = (jsbytecode) u;
}
/* Common uint16_t immediate format helpers. */
#define UINT16_LEN 2
#define UINT16_HI(i) ((jsbytecode)((i) >> 8))