Merge MC -> JM

This commit is contained in:
Brian Hackett
2011-10-19 14:26:08 -07:00
5747 changed files with 148783 additions and 122546 deletions

View File

@@ -243,7 +243,7 @@ typedef enum JSOp {
(pc)[3] = (jsbytecode)((uint32)(i) >> 8), \
(pc)[4] = (jsbytecode)(uint32)(i))
/* Index limit is determined by SN_3BYTE_OFFSET_FLAG, see jsemit.h. */
/* Index limit is determined by SN_3BYTE_OFFSET_FLAG, see frontend/BytecodeGenerator.h. */
#define INDEX_LIMIT_LOG2 23
#define INDEX_LIMIT ((uint32)1 << INDEX_LIMIT_LOG2)
@@ -562,6 +562,24 @@ FlowsIntoNext(JSOp op)
op != JSOP_GOTO && op != JSOP_GOTOX && op != JSOP_RETSUB;
}
/*
* AutoScriptUntrapper mutates the given script in place to replace JSOP_TRAP
* opcodes with the original opcode they replaced. The destructor mutates the
* script back into its original state.
*/
class AutoScriptUntrapper
{
JSContext *cx;
JSScript *origScript;
jsbytecode *origCode;
size_t nbytes;
bool saveOriginal(JSScript *script);
public:
AutoScriptUntrapper();
bool untrap(JSContext *cx, JSScript *script);
~AutoScriptUntrapper();
};
}
#endif