Closed Bug 664250 Opened 13 years ago Closed 10 years ago

Remove JSCLASS_FREEZE_{PROTO,CTOR}

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 924720
Tracking Status
blocking2.0 --- beta7+

People

(Reporter: brendan, Assigned: gal)

References

Details

Attachments

(1 file)

See blocked bug. This should have been a one-off freeze call in jsiter.cpp. We should try to "GC" other JSCLASS_* flags too.

A further work item is to avoid freezing StopIteration just so we can share it among a compartment's globals, but that item requires some new API proposed for ES.next. Separate bug to be filed...

Andreas, can you take this one?

/be
Attached patch patchSplinter Review
Assignee: general → gal
StopIteration is not wrapped when it crosses a membrane. Instead we translate the origin compartment's StopIteration object into the current global's StopIteration object. This is necessary because we inspect the StopIteration object's identity in various places and a wrapped StopIteration object has its own identity and we don't want to unwrap all over the engine. If we freeze the proto and ctor (which is the object really used when throwing StopIteration), we avoid strange behavior such as this one:

compartment A:

StopIteration.x
throw StopIteration

compartment B:

catch (e) {
   alert(e.x); // x is not present, since this is a different global's StopIteration
}

I think we can live with this and just remove the freezing code.
Attachment #539287 - Flags: review?(mrbkap)
Compartment per global would address a bit of the last few comments' concerns!
Attachment #539287 - Flags: review?(mrbkap) → review+
efaust landed an equivalent patch for bug 924720:

https://hg.mozilla.org/mozilla-central/rev/32aeb054f757
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: