Closed Bug 830586 Opened 7 years ago Closed 7 years ago

GC: JSObject::preventExtensions needs to be static

Categories

(Core :: JavaScript Engine, defect)

defect
Not set

Tracking

()

RESOLVED DUPLICATE of bug 833340

People

(Reporter: terrence, Unassigned)

References

Details

There is an accidental use of |this| that should be |self| causing the following tests to fail in a root analysis build:
    basic/testOverRecursed4.js
    jaeger/recompile/bug671943-1.js
Yeah what is the story with these anyway. Feels strange to have static and instance methods in JSObject.
(In reply to Tom Schuster [:evilpie] from comment #1)
> Yeah what is the story with these anyway. Feels strange to have static and
> instance methods in JSObject.

Yes it does. The problem, specifically, is |this|: it is on the stack implicitly through C++'s machinations, so we have no idea where it is. Thus, we cannot update it when we GC. So, if we do GC we have to not use |this| because the object |this| refers to could have moved. Initially we were re-rooting |this| as |self|, but given how many problems cropped up from accidentally using |this| where we shouldn't, we decided to just make most GCing methods static to prevent further regressions.

We do have some ideas to fix this. See bug 785452 in particular.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 833340
You need to log in before you can comment on or make changes to this bug.