Remove all mentions of imacros from js/src. Bug 708836, r=sfink.

This commit is contained in:
Jason Orendorff 2011-12-08 16:17:55 -06:00
parent ae09d526fb
commit 6ec53cbaee
9 changed files with 9 additions and 52 deletions

View File

@ -755,7 +755,7 @@ PopulateReportBlame(JSContext *cx, JSErrorReport *report)
for (FrameRegsIter iter(cx); !iter.done(); ++iter) {
if (iter.fp()->isScriptFrame()) {
report->filename = iter.fp()->script()->filename;
report->lineno = js_FramePCToLineNumber(cx, iter.fp(), iter.pc());
report->lineno = js_PCToLineNumber(cx, iter.fp()->script(), iter.pc());
break;
}
}

View File

@ -340,7 +340,7 @@ InitExnPrivate(JSContext *cx, JSObject *exnObject, JSString *message,
}
if (fp->isScriptFrame()) {
frame.filename = fp->script()->filename;
frame.ulineno = js_FramePCToLineNumber(cx, fp, i.pc());
frame.ulineno = js_PCToLineNumber(cx, fp->script(), i.pc());
} else {
frame.ulineno = 0;
frame.filename = NULL;
@ -765,7 +765,7 @@ Exception(JSContext *cx, uintN argc, Value *vp)
if (!ToUint32(cx, args[2], &lineno))
return false;
} else {
lineno = iter.done() ? 0 : js_FramePCToLineNumber(cx, iter.fp(), iter.pc());
lineno = iter.done() ? 0 : js_PCToLineNumber(cx, iter.fp()->script(), iter.pc());
}
intN exnType = args.callee().toFunction()->getExtendedSlot(0).toInt32();

View File

@ -3083,11 +3083,6 @@ BEGIN_CASE(JSOP_LENGTH)
}
}
/*
* We do not impose the method read barrier if in an imacro,
* assuming any property gets it does (e.g., for 'toString'
* from JSOP_NEW) will not be leaked to the calling script.
*/
JSObject *obj;
VALUE_TO_OBJECT(cx, vp, obj);
JSObject *aobj = js_GetProtoIfDenseArray(obj);

View File

@ -580,8 +580,7 @@ js_Disassemble1(JSContext *cx, JSScript *script, jsbytecode *pc,
if (op == JSOP_DOUBLE) {
v = script->getConst(index);
} else {
JSAtom *atom;
JS_GET_SCRIPT_ATOM(script, pc, index, atom);
JSAtom *atom = script->getAtom(index);
v = STRING_TO_JSVAL(atom);
}
} else {
@ -674,8 +673,7 @@ js_Disassemble1(JSContext *cx, JSScript *script, jsbytecode *pc,
uintN index = js_GetIndexFromBytecode(cx, script, pc, SLOTNO_LEN);
jsval v;
if (type == JOF_SLOTATOM) {
JSAtom *atom;
JS_GET_SCRIPT_ATOM(script, pc, index, atom);
JSAtom *atom = script->getAtom(index);
v = STRING_TO_JSVAL(atom);
} else {
v = OBJECT_TO_JSVAL(script->getObject(index));

View File

@ -342,7 +342,7 @@ js_GetIndexFromBytecode(JSContext *cx, JSScript *script, jsbytecode *pc,
JS_BEGIN_MACRO \
JS_ASSERT(*(pc) != JSOP_DOUBLE); \
uintN index_ = js_GetIndexFromBytecode(cx, (script), (pc), (pcoff)); \
JS_GET_SCRIPT_ATOM(script, pc, index_, atom); \
(atom) = (script)->getAtom(index_); \
JS_END_MACRO
#define GET_DOUBLE_FROM_BYTECODE(script, pc, pcoff, dbl) \

View File

@ -1442,12 +1442,6 @@ js_GetSrcNoteCached(JSContext *cx, JSScript *script, jsbytecode *pc)
return result;
}
uintN
js_FramePCToLineNumber(JSContext *cx, StackFrame *fp, jsbytecode *pc)
{
return js_PCToLineNumber(cx, fp->script(), pc);
}
uintN
js_PCToLineNumber(JSContext *cx, JSScript *script, jsbytecode *pc)
{
@ -1564,7 +1558,7 @@ namespace js {
uintN
CurrentLine(JSContext *cx)
{
return js_FramePCToLineNumber(cx, cx->fp(), cx->regs().pc);
return js_PCToLineNumber(cx, cx->fp()->script(), cx->regs().pc);
}
const char *
@ -1579,7 +1573,7 @@ CurrentScriptFileAndLineSlow(JSContext *cx, uintN *linenop)
return NULL;
}
*linenop = js_FramePCToLineNumber(cx, iter.fp(), iter.pc());
*linenop = js_PCToLineNumber(cx, iter.fp()->script(), iter.pc());
return iter.fp()->script()->filename;
}

View File

@ -821,23 +821,6 @@ StackDepth(JSScript *script)
return script->nslots - script->nfixed;
}
/*
* If pc_ does not point within script_'s bytecode, then it must point into an
* imacro body, so we use cx->runtime common atoms instead of script_'s atoms.
* This macro uses cx from its callers' environments in the pc-in-imacro case.
*/
#define JS_GET_SCRIPT_ATOM(script_, pc_, index, atom) \
JS_BEGIN_MACRO \
if ((pc_) < (script_)->code || \
(script_)->code + (script_)->length <= (pc_)) { \
JS_ASSERT((size_t)(index) < js_common_atom_count); \
(atom) = cx->runtime->atomState.commonAtomsStart()[index]; \
} else { \
(atom) = script_->getAtom(index); \
} \
JS_END_MACRO
extern void
js_MarkScriptFilename(const char *filename);
@ -884,14 +867,6 @@ CheckScript(JSScript *script, JSScript *prev)
extern jssrcnote *
js_GetSrcNoteCached(JSContext *cx, JSScript *script, jsbytecode *pc);
/*
* NOTE: use js_FramePCToLineNumber(cx, fp) when you have an active fp, in
* preference to js_PCToLineNumber (cx, fp->script fp->regs->pc), because
* fp->imacpc may be non-null, indicating an active imacro.
*/
extern uintN
js_FramePCToLineNumber(JSContext *cx, js::StackFrame *fp, jsbytecode *pc);
extern uintN
js_PCToLineNumber(JSContext *cx, JSScript *script, jsbytecode *pc);

View File

@ -1797,7 +1797,7 @@ ParseXMLSource(JSContext *cx, JSString *src)
op = (JSOp) *i.pc();
if (op == JSOP_TOXML || op == JSOP_TOXMLLIST) {
filename = i.fp()->script()->filename;
lineno = js_FramePCToLineNumber(cx, i.fp(), i.pc());
lineno = js_PCToLineNumber(cx, i.fp()->script(), i.pc());
for (endp = srcp + srclen; srcp < endp; srcp++) {
if (*srcp == '\n')
--lineno;

View File

@ -1478,11 +1478,6 @@ InlineGetProp(VMFrame &f)
Value rval;
do {
/*
* We do not impose the method read barrier if in an imacro,
* assuming any property gets it does (e.g., for 'toString'
* from JSOP_NEW) will not be leaked to the calling script.
*/
JSObject *aobj = js_GetProtoIfDenseArray(obj);
PropertyCacheEntry *entry;