- Shaver hacked this fix with advice from me, and I carried it to check-in. We now avoid a heavyweight outer function when the inner one is defined at top-level or in an expression (is not a JSOP_CLOSURE, IOW), and it doesn't refer to any non-local names. See bug 65308 for details on the win. (r=rogerl, sr=brendan)
- Fix scope chain for nested functions at top-level (JSOP_DEFFUN), in a part of another statement (JSOP_CLOSURE), and unnamed in an expression (JSOP_ANONFUNOBJ) to match ECMA-262 13.2. My bad: fp->varobj was used up till now, instead of fp->scopeChain; we still *bind* the name of a statement-level (top or not) nested function in fp->varobj. This fixes bug 69559. (r=rogerl, sr=jband) - Add an Intern command to the shell, for GC vs. intern'ed atom testing.
This commit is contained in:
@@ -65,6 +65,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_DEFLOCALVAR 8 /* define local var with initial value */
|
||||
#define JOF_TYPEMASK 0x000f /* mask for above immediate types */
|
||||
#define JOF_NAME 0x0010 /* name operation */
|
||||
#define JOF_PROP 0x0020 /* obj.prop operation */
|
||||
@@ -109,8 +110,10 @@ typedef enum JSOp {
|
||||
/* 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
|
||||
|
||||
struct JSCodeSpec {
|
||||
const char *name; /* JS bytecode name */
|
||||
|
||||
Reference in New Issue
Block a user