Closed Bug 1095145 Opened 11 years ago Closed 11 years ago

Debugger::onNewScript doesn't need its 'compileAndGoGlobal' argument

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla38

People

(Reporter: jimb, Assigned: jimb)

References

Details

Attachments

(1 file, 1 obsolete file)

The 'compileAndGoGlobal' argument to Debugger::onNewScript is redundant, and should be removed. Looking at the assertions at the top of Debugger::onNewScript: /* static */ void Debugger::onNewScript(JSContext *cx, HandleScript script, GlobalObject *compileAndGoGlobal) { MOZ_ASSERT_IF(script->compileAndGo(), compileAndGoGlobal); MOZ_ASSERT_IF(script->compileAndGo(), compileAndGoGlobal == &script->uninlinedGlobal()); ... MOZ_ASSERT_IF(!script->compileAndGo(), !compileAndGoGlobal); From these it clearly follows that compileAndGoGlobal is always equal to: script->compileAndGo() ? script->uninlinedGlobal() : nullptr and hence need not be passed to onNewScript, nor need onNewScript pass it to slowPathOnNewScript.
Blocks: 679939
Jim, is this still happening?
Flags: needinfo?(jimb)
Yeah, just got dropped. Let me give it a new push...
Flags: needinfo?(jimb)
Assignee: nobody → jimb
Comment on attachment 8554625 [details] [diff] [review] Remove compileAndGoGlobal argument to Debugger::onNewScript, and simplify accordingly. Review of attachment 8554625 [details] [diff] [review]: ----------------------------------------------------------------- Very nice. ::: js/src/vm/Debugger.cpp @@ -1312,5 @@ > - for (Debugger **p = src->begin(); p != src->end(); p++) { > - Debugger *dbg = *p; > - Value v = ObjectValue(*dbg->toJSObject()); > - if (dbg->observesScript(script) && dbg->observesNewScript() && > - (wasEmpty || Find(dest->begin(), dest->end(), v) == dest->end()) && I wonder why we ever needed to deduplicate the list of debuggers...
Attachment #8554625 - Flags: review?(shu) → review+
Attachment #8518519 - Attachment is obsolete: true
I wouldn't call that try push "clean", but nothing there seemed remotely related to this patch.
Flags: in-testsuite-
Target Milestone: --- → mozilla38
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: