First big wave of js1.7 changes (326466, 336376, r=mrbkap).

This commit is contained in:
brendan@mozilla.org
2006-05-20 22:27:28 +00:00
parent 8a42db4f2d
commit 0118a9bd35
39 changed files with 2397 additions and 962 deletions

View File

@@ -72,7 +72,7 @@ typedef enum JSOp {
#define JOF_LOOKUPSWITCH 5 /* lookup switch */
#define JOF_QARG 6 /* quickened get/set function argument ops */
#define JOF_QVAR 7 /* quickened get/set local variable ops */
#define JOF_INDEXCONST 8 /* arg or var index + constant pool index */
#define JOF_INDEXCONST 8 /* uint16 slot index + constant pool index */
#define JOF_JUMPX 9 /* signed 32-bit jump offset immediate */
#define JOF_TABLESWITCHX 10 /* extended (32-bit offset) table switch */
#define JOF_LOOKUPSWITCHX 11 /* extended (32-bit offset) lookup switch */
@@ -80,6 +80,7 @@ typedef enum JSOp {
#define JOF_LITOPX 13 /* JOF_UINT24 followed by op being extended,
where op if JOF_CONST has no unsigned 16-
bit immediate operand */
#define JOF_LOCAL 14 /* block-local operand stack variable */
#define JOF_TYPEMASK 0x000f /* mask for above immediate types */
#define JOF_NAME 0x0010 /* name operation */
#define JOF_PROP 0x0020 /* obj.prop operation */
@@ -187,19 +188,29 @@ JS_STATIC_ASSERT(sizeof(jsatomid) * JS_BITS_PER_BYTE >=
ATOM_INDEX_LIMIT_LOG2 + 1);
#endif
/* Common uint16 immediate format helpers. */
#define UINT16_HI(i) ((jsbytecode)((i) >> 8))
#define UINT16_LO(i) ((jsbytecode)(i))
#define GET_UINT16(pc) ((uintN)(((pc)[1] << 8) | (pc)[2]))
#define SET_UINT16(pc,i) ((pc)[1] = UINT16_HI(i), (pc)[2] = UINT16_LO(i))
#define UINT16_LIMIT ((uintN)1 << 16)
/* Actual argument count operand format helpers. */
#define ARGC_HI(argc) ((jsbytecode)((argc) >> 8))
#define ARGC_LO(argc) ((jsbytecode)(argc))
#define GET_ARGC(pc) ((uintN)(((pc)[1] << 8) | (pc)[2]))
#define ARGC_LIMIT ((uint32)1 << 16)
#define ARGC_HI(argc) UINT16_HI(argc)
#define ARGC_LO(argc) UINT16_LO(argc)
#define GET_ARGC(pc) GET_UINT16(pc)
#define ARGC_LIMIT UINT16_LIMIT
/* Synonyms for quick JOF_QARG and JOF_QVAR bytecodes. */
#define GET_ARGNO(pc) GET_ARGC(pc)
#define SET_ARGNO(pc,argno) SET_JUMP_OFFSET(pc,argno)
#define ARGNO_LEN JUMP_OFFSET_LEN
#define GET_VARNO(pc) GET_ARGC(pc)
#define SET_VARNO(pc,varno) SET_JUMP_OFFSET(pc,varno)
#define VARNO_LEN JUMP_OFFSET_LEN
#define GET_ARGNO(pc) GET_UINT16(pc)
#define SET_ARGNO(pc,argno) SET_UINT16(pc,argno)
#define ARGNO_LEN 2
#define ARGNO_LIMIT UINT16_LIMIT
#define GET_VARNO(pc) GET_UINT16(pc)
#define SET_VARNO(pc,varno) SET_UINT16(pc,varno)
#define VARNO_LEN 2
#define VARNO_LIMIT UINT16_LIMIT
struct JSCodeSpec {
const char *name; /* JS bytecode name */