Last Comment Bug 620316 - WrapEscapingClosure and js::GetCallVarChecked are dead code
: WrapEscapingClosure and js::GetCallVarChecked are dead code
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
-- normal (vote)
: mozilla8
Assigned To: Jason Orendorff [:jorendorff]
: Jason Orendorff [:jorendorff]
Depends on:
Blocks: 558451
  Show dependency treegraph
Reported: 2010-12-19 17:56 PST by Jeff Walden [:Waldo] (remove +bmo to email)
Modified: 2011-07-13 15:26 PDT (History)
7 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

WIP 1 (28.23 KB, patch)
2011-07-05 14:44 PDT, Jason Orendorff [:jorendorff]
no flags Details | Diff | Splinter Review
v2 (30.09 KB, patch)
2011-07-05 15:19 PDT, Jason Orendorff [:jorendorff]
brendan: review+
Details | Diff | Splinter Review

Description User image Jeff Walden [:Waldo] (remove +bmo to email) 2010-12-19 17:56:27 PST
It's unused right now, Brendan claims fallout from bug 558451.  Should it be used, or can it be removed?
Comment 1 User image Brendan Eich [:brendan] 2010-12-29 21:25:47 PST
We should be able to write a testcase (or find one from the bug that introduced it: bug 496790) and make it bark on a build before the patch-stack for bug 558451 landed. Checking...

Comment 2 User image Jason Orendorff [:jorendorff] 2011-07-05 10:31:14 PDT
I added JS_ASSERT(0) to the top of WrapEscapingClosure in jsfun.cpp and ran the test suite. No failures.

I think it has been dead since JSOP_UPVAR was removed (bug 592202). JSOP_UPVAR was used in closures on the assumption that they could not escape. Now we emit JSOP_GETFCSLOT or JSOP_NAME in such cases, and those are harmless (though JSOP_NAME gives the wrong answer).

If WrapEscapingClosure is dead, GetCallVarChecked is definitely dead, as are the _DBG opcodes. There may be more dead code here, but that's enough for one bug.

Comment 3 User image Jason Orendorff [:jorendorff] 2011-07-05 14:44:33 PDT
Created attachment 544069 [details] [diff] [review]

This passes tests just fine, but I can't think of any sane reason for keeping the needsWrapper assertions around, so I'm going to delete those too.
Comment 4 User image Jason Orendorff [:jorendorff] 2011-07-05 15:19:58 PDT
Created attachment 544077 [details] [diff] [review]
Comment 5 User image Brendan Eich [:brendan] 2011-07-08 23:13:33 PDT
Comment on attachment 544077 [details] [diff] [review]

Whew, that lightened the load. Should have cleaned this up when UPVAR went, thanks for doing it now.

Rather than leave JSOP_UNUSED23[01234] around, I'd just slide down the ops above.


Note You need to log in before you can comment on or make changes to this bug.