The default bug view has changed. See this FAQ.

Status

()

Core
JavaScript Engine
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: bhackett, Assigned: bhackett)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

This is straightforward to do on top of bug 684505; obj->clasp is already identical to obj->lastProp->base->clasp.
Created attachment 563418 [details] [diff] [review]
patch

Note: with bug 684505 a shape guard also guards on class (there is no longer a shared non-native shape, instead one EmptyShape/BaseShape per non-native class in a compartment), so the cost of class guards in e.g. PIC'ed element accesses is unchanged.

https://hg.mozilla.org/projects/jaegermonkey/rev/55a63871f966
Attachment #563418 - Flags: review?(luke)
Created attachment 563645 [details] [diff] [review]
remove background sweep calls to clasp->finalize

Followup fix to work with background finalization.  JSObject::finalize could access the object's clasp->finalize, which now requires the shape to be intact.  This is fine when objects are finalized during GC sweep (shapes are finalized after objects), but when doing background finalization the object's shape is no longer usable.  This patch fixes things so that background finalization does not call clasp->finalize, so objects with finalize hooks cannot be finalized in the background.  This only happened for function and iterator objects.  Iterators are very rare so it's fine to finalize them during sweep.  The function class finalizer only does stuff if the function is a flat closure, and flat closures are due to be removed by bug 687185, which would let functions be finalized in the background again (if that bug doesn't pan out, flat closures should store their data in the function's slots anyways, which would also avoid the need for fun_finalize).

https://hg.mozilla.org/projects/jaegermonkey/rev/c9be55115ad8
Attachment #563645 - Flags: review?(wmccloskey)
Depends on: 690943
Comment on attachment 563645 [details] [diff] [review]
remove background sweep calls to clasp->finalize

Review of attachment 563645 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/jsobjinlines.h
@@ +168,5 @@
>  
> +    if (!background) {
> +        /*
> +         * Finalize obj first, in case it needs map and slots. Objects with
> +         * finalize hooks are not called finalized in the background, as the

"are not called finalized" -> "are not finalized"
Attachment #563645 - Flags: review?(wmccloskey) → review+

Comment 4

6 years ago
Comment on attachment 563418 [details] [diff] [review]
patch

Review of attachment 563418 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/jsobjinlines.h
@@ +1611,5 @@
>      return obj->isDenseArray() ? obj->getProto() : obj;
>  }
>  
> +inline js::Class *
> +JSObject::getClass() const {

newline for {, here and below.
Attachment #563418 - Flags: review?(luke) → review+
Created attachment 564738 [details] [diff] [review]
move inline methods to *inlines.h

Move inline methods depending on getClass() and related methods into *inlines.h files.  Otherwise can get weird link errors if someone includes jsobj.h but not jsobjinlines.h.
Attachment #564738 - Flags: review?(luke)

Updated

6 years ago
Attachment #564738 - Flags: review?(luke) → review+
Setting owner according to patch author.
Assignee: general → bhackett1024
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.