Bug 777383 - Don't add undefined type to property reads before test ops. r=bhackett

This commit is contained in:
Jan de Mooij 2012-08-31 13:16:01 +02:00
parent a877fc9bcf
commit 35bc031566

View File

@ -3486,29 +3486,6 @@ TypeObject::print(JSContext *cx)
// Type Analysis
/////////////////////////////////////////////////////////////////////
/*
* If the bytecode immediately following code/pc is a test of the value
* pushed by code, that value should be marked as possibly void.
*/
static inline bool
CheckNextTest(jsbytecode *pc)
{
jsbytecode *next = pc + GetBytecodeLength(pc);
switch ((JSOp)*next) {
case JSOP_IFEQ:
case JSOP_IFNE:
case JSOP_NOT:
case JSOP_OR:
case JSOP_AND:
case JSOP_TYPEOF:
case JSOP_TYPEOFEXPR:
return true;
default:
/* TRAP ok here */
return false;
}
}
static inline TypeObject *
GetInitializerType(JSContext *cx, JSScript *script, jsbytecode *pc)
{
@ -3775,9 +3752,6 @@ ScriptAnalysis::analyzeTypesBytecode(JSContext *cx, unsigned offset,
if (op == JSOP_CALLGNAME)
pushed[0].addPropagateThis(cx, script, pc, GetCalleeThisType(pc));
if (CheckNextTest(pc))
pushed[0].addType(cx, Type::UndefinedType());
break;
}
@ -3957,8 +3931,6 @@ ScriptAnalysis::analyzeTypesBytecode(JSContext *cx, unsigned offset,
}
seen->addSubset(cx, &pushed[0]);
if (CheckNextTest(pc))
pushed[0].addType(cx, Type::UndefinedType());
break;
}
@ -3988,8 +3960,6 @@ ScriptAnalysis::analyzeTypesBytecode(JSContext *cx, unsigned offset,
seen->addSubset(cx, &pushed[0]);
if (op == JSOP_CALLELEM)
pushed[0].addPropagateThis(cx, script, pc, Type::UndefinedType(), poppedTypes(pc, 1));
if (CheckNextTest(pc))
pushed[0].addType(cx, Type::UndefinedType());
break;
}