Remove unnecessary use of address()

RESOLVED FIXED

Status

()

Core
JavaScript: GC
RESOLVED FIXED
3 years ago
5 months ago

People

(Reporter: jonco, Assigned: jonco)

Tracking

({leave-open})

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

3 years ago
Created attachment 8484912 [details] [diff] [review]
1 - remove-address-use

There are several places where a function takes e.g. a Value *out parameter and all uses have a mutable handle which they then have to call address() on.  We can change these functions to take just mutable handles themselves.
Attachment #8484912 - Flags: review?(sphink)
Comment on attachment 8484912 [details] [diff] [review]
1 - remove-address-use

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

Nice

::: js/src/jsapi.cpp
@@ +3722,5 @@
>              shape = shape->previous();
>  
>          if (!shape->previous()) {
>              JS_ASSERT(shape->isEmptyShape());
> +            idp.set(JSID_VOID);

idp.setUndefined()

@@ +3733,5 @@
>          JSIdArray *ida = (JSIdArray *) iterobj->getPrivate();
>          JS_ASSERT(i <= ida->length);
>          STATIC_ASSUME(i <= ida->length);
>          if (i == 0) {
> +            idp.set(JSID_VOID);

setUndefined

::: js/src/jsapi.h
@@ +3287,5 @@
>   * property to visit using iterobj, or JSID_IS_VOID if there is no such property
>   * left to visit.  Return false on error.
>   */
>  extern JS_PUBLIC_API(bool)
> +JS_NextProperty(JSContext *cx, JS::Handle<JSObject*> iterobj, JS::MutableHandleId idp);

While you're here, this is supposed to be using HandleObject, isn't it?
Attachment #8484912 - Flags: review?(sphink) → review+
(Assignee)

Comment 2

3 years ago
(In reply to Steve Fink [:sfink] from comment #1)

Cheers.

> idp.setUndefined()

This is MutableHandleId and we don't provide setUndefined() for that.
(Assignee)

Comment 3

3 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/247172569e8c
https://hg.mozilla.org/mozilla-central/rev/247172569e8c
(Assignee)

Comment 5

3 years ago
Created attachment 8493707 [details] [diff] [review]
2 - remove-more-address-use

Remove some more uses of address().  Also, I was able to get rid of three overloads of JSCompartment::wrap().
Attachment #8493707 - Flags: review?(sphink)
(Assignee)

Updated

3 years ago
Attachment #8493707 - Attachment description: remove-more-address-use → 2 - remove-more-address-use
(Assignee)

Updated

3 years ago
Attachment #8484912 - Flags: checkin+
Comment on attachment 8493707 [details] [diff] [review]
2 - remove-more-address-use

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

Good to see those overloads die.
Attachment #8493707 - Flags: review?(sphink) → review+
(Assignee)

Comment 7

3 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/239d373ebd6b
https://hg.mozilla.org/mozilla-central/rev/239d373ebd6b
(Assignee)

Updated

3 years ago
Attachment #8493707 - Flags: checkin+
(Assignee)

Updated

5 months ago
Status: NEW → RESOLVED
Last Resolved: 5 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.