53 |
* for-in loops. |
* for-in loops. |
54 |
*/ |
*/ |
55 |
typedef enum JSTryNoteKind { |
typedef enum JSTryNoteKind { |
56 |
JSTN_CATCH, |
JSTRY_CATCH, |
57 |
JSTN_FINALLY, |
JSTRY_FINALLY, |
58 |
JSTN_ITER |
JSTRY_ITER |
59 |
} JSTryNoteKind; |
} JSTryNoteKind; |
60 |
|
|
61 |
/* |
/* |
156 |
(JS_ASSERT((script)->trynotesOffset != 0), \ |
(JS_ASSERT((script)->trynotesOffset != 0), \ |
157 |
(JSTryNoteArray *)((uint8 *)(script) + (script)->trynotesOffset)) |
(JSTryNoteArray *)((uint8 *)(script) + (script)->trynotesOffset)) |
158 |
|
|
159 |
#define JS_GET_SCRIPT_ATOM(script, index, atom) \ |
#define JS_GET_SCRIPT_ATOM(script_, index, atom) \ |
160 |
JS_BEGIN_MACRO \ |
JS_BEGIN_MACRO \ |
161 |
JSAtomMap *atoms_ = &(script)->atomMap; \ |
if (cx->fp && cx->fp->imacpc && cx->fp->script == script_) { \ |
162 |
JS_ASSERT((uint32)(index) < atoms_->length); \ |
JS_ASSERT((size_t)(index) < js_common_atom_count); \ |
163 |
(atom) = atoms_->vector[(index)]; \ |
(atom) = COMMON_ATOMS_START(&cx->runtime->atomState)[index]; \ |
164 |
|
} else { \ |
165 |
|
JSAtomMap *atoms_ = &(script_)->atomMap; \ |
166 |
|
JS_ASSERT((uint32)(index) < atoms_->length); \ |
167 |
|
(atom) = atoms_->vector[index]; \ |
168 |
|
} \ |
169 |
JS_END_MACRO |
JS_END_MACRO |
170 |
|
|
171 |
#define JS_GET_SCRIPT_OBJECT(script, index, obj) \ |
#define JS_GET_SCRIPT_OBJECT(script, index, obj) \ |
172 |
JS_BEGIN_MACRO \ |
JS_BEGIN_MACRO \ |
173 |
JSObjectArray *objects_ = JS_SCRIPT_OBJECTS(script); \ |
JSObjectArray *objects_ = JS_SCRIPT_OBJECTS(script); \ |
174 |
JS_ASSERT((uint32)(index) < objects_->length); \ |
JS_ASSERT((uint32)(index) < objects_->length); \ |
175 |
(obj) = objects_->vector[(index)]; \ |
(obj) = objects_->vector[index]; \ |
176 |
JS_END_MACRO |
JS_END_MACRO |
177 |
|
|
178 |
#define JS_GET_SCRIPT_FUNCTION(script, index, fun) \ |
#define JS_GET_SCRIPT_FUNCTION(script, index, fun) \ |
190 |
JS_BEGIN_MACRO \ |
JS_BEGIN_MACRO \ |
191 |
JSObjectArray *regexps_ = JS_SCRIPT_REGEXPS(script); \ |
JSObjectArray *regexps_ = JS_SCRIPT_REGEXPS(script); \ |
192 |
JS_ASSERT((uint32)(index) < regexps_->length); \ |
JS_ASSERT((uint32)(index) < regexps_->length); \ |
193 |
(obj) = regexps_->vector[(index)]; \ |
(obj) = regexps_->vector[index]; \ |
194 |
JS_ASSERT(STOBJ_GET_CLASS(obj) == &js_RegExpClass); \ |
JS_ASSERT(STOBJ_GET_CLASS(obj) == &js_RegExpClass); \ |
195 |
JS_END_MACRO |
JS_END_MACRO |
196 |
|
|
296 |
extern jssrcnote * |
extern jssrcnote * |
297 |
js_GetSrcNoteCached(JSContext *cx, JSScript *script, jsbytecode *pc); |
js_GetSrcNoteCached(JSContext *cx, JSScript *script, jsbytecode *pc); |
298 |
|
|
299 |
/* XXX need cx to lock function objects declared by prolog bytecodes. */ |
/* |
300 |
|
* NOTE: use js_FramePCToLineNumber(cx, fp) when you have an active fp, in |
301 |
|
* preference to js_PCToLineNumber (cx, fp->script fp->regs->pc), because |
302 |
|
* fp->imacpc may be non-null, indicating an active imacro. |
303 |
|
*/ |
304 |
|
extern uintN |
305 |
|
js_FramePCToLineNumber(JSContext *cx, JSStackFrame *fp); |
306 |
|
|
307 |
extern uintN |
extern uintN |
308 |
js_PCToLineNumber(JSContext *cx, JSScript *script, jsbytecode *pc); |
js_PCToLineNumber(JSContext *cx, JSScript *script, jsbytecode *pc); |
309 |
|
|