Match TypeInferenceOracle assertions for getCallTarget (Bug 732864, r=dvander)

This commit is contained in:
Nicolas Pierron 2012-03-09 11:09:21 -08:00
parent 26f2347830
commit 6eb139944a
3 changed files with 25 additions and 3 deletions

View File

@ -321,8 +321,7 @@ TypeSet *
TypeInferenceOracle::getCallTarget(JSScript *caller, uint32 argc, jsbytecode *pc)
{
JS_ASSERT(caller == this->script);
JS_ASSERT(JSOp(*pc) == JSOP_CALL || JSOp(*pc) == JSOP_NEW ||
JSOp(*pc) == JSOP_FUNCALL || JSOp(*pc) == JSOP_FUNAPPLY);
JS_ASSERT(js_CodeSpec[*pc].format & JOF_INVOKE && JSOp(*pc) != JSOP_EVAL);
ScriptAnalysis *analysis = script->analysis();
return analysis->poppedTypes(pc, argc + 1);

View File

@ -153,7 +153,8 @@ class TypeOracle
/* |pc| must be a |JSOP_CALL|. */
virtual types::TypeSet *getCallTarget(JSScript *caller, uint32 argc, jsbytecode *pc) {
JS_ASSERT(JSOp(*pc) == JSOP_CALL);
// Same assertion as TypeInferenceOracle::getCallTarget.
JS_ASSERT(js_CodeSpec[*pc].format & JOF_INVOKE && JSOp(*pc) != JSOP_EVAL);
return NULL;
}
virtual types::TypeSet *getCallArg(JSScript *script, uint32 argc, uint32 arg, jsbytecode *pc) {

View File

@ -0,0 +1,22 @@
function BigInteger() { }
function bnpCopyTo(g) {
var this_array = g.array;
for (var i = g.t; i >= 0; --i)
;
g.t = g.t;
}
function bnpFromString(n) {
n.t = 0;
var i = 100;
while (--i >= 0) {
n.t++;
}
}
n = new BigInteger();
n.array = new Array();
bnpFromString(n);
g = new BigInteger();
g.array = new Array();
g.t = 100;
bnpCopyTo(g);