[JAEGER] Removed more expensive bytecodeanalyzer assertions.

This commit is contained in:
David Anderson 2010-07-12 13:09:04 -07:00
parent 7b0af24a39
commit d5449384ae
2 changed files with 0 additions and 30 deletions

View File

@ -71,10 +71,6 @@ BytecodeAnalyzer::analyze(uint32 index)
jsbytecode *pc = doList[index]; jsbytecode *pc = doList[index];
uint32 stackDepth = ops[pc - script->code].stackDepth; uint32 stackDepth = ops[pc - script->code].stackDepth;
#ifdef DEBUG
bool canAssert = true;
#endif
for (;;) { for (;;) {
JSOp op = JSOp(pc[0]); JSOp op = JSOp(pc[0]);
OpcodeStatus &status = ops[pc - script->code]; OpcodeStatus &status = ops[pc - script->code];
@ -82,17 +78,6 @@ BytecodeAnalyzer::analyze(uint32 index)
if (status.visited) if (status.visited)
return true; return true;
#ifdef DEBUG
if (assertDepths) {
jssrcnote *sn = js_GetSrcNote(script, pc);
if (sn && SN_TYPE(sn) == SRC_HIDDEN)
canAssert = false;
JS_ASSERT_IF(canAssert && pc > script->main,
js_ReconstructStackDepth(cx, script, pc) == stackDepth);
}
#endif
status.visited = true; status.visited = true;
status.stackDepth = stackDepth; status.stackDepth = stackDepth;

View File

@ -62,27 +62,12 @@ namespace js
JSScript *script; JSScript *script;
OpcodeStatus *ops; OpcodeStatus *ops;
Vector<jsbytecode *, 16, ContextAllocPolicy> doList; Vector<jsbytecode *, 16, ContextAllocPolicy> doList;
#ifdef DEBUG
bool assertDepths;
#endif
public: public:
BytecodeAnalyzer(JSContext *cx, JSScript *script) BytecodeAnalyzer(JSContext *cx, JSScript *script)
: cx(cx), script(script), ops(NULL), : cx(cx), script(script), ops(NULL),
doList(ContextAllocPolicy(cx)) doList(ContextAllocPolicy(cx))
{ {
#ifdef DEBUG
// This takes a very long time with SunSpider's string-tagcloud.
if (script->filename) {
const char *filename = script->filename;
size_t flen = strlen(filename);
const char *pat = "string-tagcloud.js";
size_t plen = strlen(pat);
bool endswith = (plen < flen &&
memcmp(filename + flen - plen, pat, plen) == 0);
assertDepths = !endswith;
}
#endif
} }
~BytecodeAnalyzer(); ~BytecodeAnalyzer();