Back out 08f4fc94e27b f3ceed05f6b7 f87d25461d6c 317e842f6c65 57adfe804b56 (bug 720316, bug 722260)

This commit is contained in:
Matt Brubeck
2012-01-31 17:34:26 -08:00
parent ef8f7f31e0
commit 98ad648b6d
28 changed files with 183 additions and 273 deletions

View File

@@ -207,10 +207,11 @@ SET_UINT32_INDEX(jsbytecode *pc, uint32_t index)
}
/*
* A literal is indexed by a per-script atom map. Most scripts have relatively
* few literals, so the standard JOF_ATOM format specifies a fixed 16 bits of
* immediate operand index. A script with more than 64K literals must wrap the
* bytecode into an JSOP_INDEXBASE and JSOP_RESETBASE pair.
* A literal is indexed by a per-script atom or object maps. Most scripts
* have relatively few literals, so the standard JOF_ATOM and JOF_OBJECT
* format specifies a fixed 16 bits of immediate operand index.
* A script with more than 64K literals must wrap the bytecode into
* JSOP_INDEXBASE and JSOP_RESETBASE pair.
*/
#define INDEX_LEN 2
#define INDEX_HI(i) ((jsbytecode)((i) >> 8))
@@ -359,6 +360,18 @@ js_GetIndexFromBytecode(JSScript *script, jsbytecode *pc, ptrdiff_t pcoff);
(dbl) = (script)->getConst(index_).toDouble(); \
JS_END_MACRO
#define GET_OBJECT_FROM_BYTECODE(script, pc, pcoff, obj) \
JS_BEGIN_MACRO \
uintN index_ = js_GetIndexFromBytecode((script), (pc), (pcoff)); \
obj = (script)->getObject(index_); \
JS_END_MACRO
#define GET_FUNCTION_FROM_BYTECODE(script, pc, pcoff, fun) \
JS_BEGIN_MACRO \
uintN index_ = js_GetIndexFromBytecode((script), (pc), (pcoff)); \
fun = (script)->getFunction(index_); \
JS_END_MACRO
#ifdef __cplusplus
namespace js {