Closed Bug 556866 Opened 14 years ago Closed 14 years ago

nameinc-type ops don't fill the property cache correctly

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file, 1 obsolete file)

Since they have JOF_INCDEC set we end up filling the sprop, not the slot.  But the code in jsinterp for these ops can only use a slot cache entry, so we lose.

It should be safe, we think, to use a slot cache for JOF_INCDEC if the setter is default.
Yeah, this is one of those cases I left for "later" early in 2008, the Firefox 3 property cache come-back. Thanks for getting to it!

/be
Attached patch Like so, perhaps (obsolete) — Splinter Review
Attachment #436766 - Flags: review?(jorendorff)
Comment on attachment 436766 [details] [diff] [review]
Like so, perhaps

>+        /* If getting a value via a stub getter, or doing an INCDEC op
>+           with stub getters and setters, we can cache the slot. */

Please use major comment style.

>+        if ((!(cs->format & (JOF_SET | JOF_FOR)) &&
>+             (sprop->hasDefaultSetter() || (!(cs->format & JOF_INCDEC)))) &&

1. The !(cs->format & JOF_INCDEC) expression is overparenthesized against ||.

2. Would it be easier to read to apply De Morgan and write

>+             !((cs->format & JOF_INCDEC) && !sprop->hasDefaultSetter())) &&

or just transpose the terms of your inner ||:

>+             (!(cs->format & JOF_INCDEC) || sprop->hasDefaultSetter())) &&

The fewer double-negatives, the better, I say!

/be
Attachment #436766 - Attachment is obsolete: true
Attachment #436781 - Flags: review?(jorendorff)
Attachment #436766 - Flags: review?(jorendorff)
Flags: in-testsuite?
Attachment #436781 - Flags: review?(jorendorff) → review+
Pushed http://hg.mozilla.org/tracemonkey/rev/eb0d26f8598d
Whiteboard: [fixed-in-tracemonkey]
Whiteboard: [fixed-in-tracemonkey] → fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/eb0d26f8598d
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: