Closed Bug 450274 Opened 16 years ago Closed 15 years ago

TM: js1_5/extensions/regress-164697.js FAIL

Categories

(Core :: JavaScript Engine, defect, P3)

x86
All
defect

Tracking

()

VERIFIED FIXED
mozilla1.9.1

People

(Reporter: bc, Assigned: crowderbt)

References

Details

(Keywords: verified1.9.1)

Attachments

(1 file, 1 obsolete file)

([]).__proto__ == Array.prototype reason: Expected value 'true', Actual value 'false'

([]).__proto__ == Array.prototype reason: Expected value 'true', Actual value 'false'

(new Array()).__proto__ == Array.prototype reason: Expected value 'true', Actual value 'false'

tracemonkey: 20f1f3c72ae7 tip
Flags: in-testsuite+
Flags: in-litmus-
occurs on mozilla-central now.
Blocks: landtm
OS: Mac OS X → All
Still occuring?
Priority: -- → P1
Target Milestone: --- → mozilla1.9.1b1
Yes, this is still occurring.  I'm looking at it.
Assignee: general → crowder
Okay.  Here's the problem.  The interpreter optimizes property look-ups in jsinterp.cpp at the do_getprop_with_obj label, and for dense-arrays, we use the object's prototype for prop-lookups using the property cache.  This means that when we lookup "__proto__" on [], we're actually looking for __proto__ on Array.prototype, and thus fail.

Fixing this requires more checking inside a very hot path, for an already non-standard feature.

Should we WONTFIX this?
sayrer: at the very least, I think we can safely drop the priority on this bug.
Agree.
Priority: P1 → P3
Target Milestone: mozilla1.9.1b1 → mozilla1.9.1
Suggest if we care that we add a JSOP_PROTO bytecode for this. We deprecate setting [].__proto__ so let's WONTFIX that part of the regression. Easy bug for someone who wants to add a new opcode.

/be
We'll need JSOP_PROTO, JSOP_COUNT, etc., right?
No. See the __count__ bug which I WONTFIXed. We should not be shy about getting away from failed experiments such as writable __proto__ (apart from the specific use-case of making a "dict": var o = {__proto__:null, ...}) and __count__.

So, just JSOP_PROTO.

/be
Brian, any updates here?
No, this dropped way off my radar, and still doesn't really seem worth fixing, relative to other things.  Has the priority been moved back up?
Attached patch stab (obsolete) — Splinter Review
Attachment #353104 - Flags: review?(brendan)
Depends on: 469625
Comment on attachment 353104 [details] [diff] [review]
stab

obj is non-native (a dense array) so can't be passed to js_GetPropertyHelper. I have JSOP_PROTO as part of the fix for bug 469625, will attach soon.

/be
Attachment #353104 - Flags: review?(brendan) → review-
Like so...?
Attachment #353104 - Attachment is obsolete: true
Attachment #359812 - Flags: review?(brendan)
Comment on attachment 359812 [details] [diff] [review]
deoptimize these cases

>+    if (pn->pn_atom == cx->runtime->atomState.protoAtom ||
>+        pn->pn_atom == cx->runtime->atomState.countAtom ||
>+        pn->pn_atom == cx->runtime->atomState.parentAtom) {
...
>+                } else if (pn2->pn_atom == cx->runtime->atomState.protoAtom ||
>+                           pn2->pn_atom == cx->runtime->atomState.countAtom ||
>+                           pn2->pn_atom == cx->runtime->atomState.parentAtom) {

Nir: prefer proto/parent/count order used in jsobj.cpp. r=me with that picked, thanks!

/be
Attachment #359812 - Flags: review?(brendan) → review+
This patch rode along in bug 469625 (we should reopen it if that landing does not stick, I suppose)
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
v 1.9.1-tracemonkey, 1.9.2
Status: RESOLVED → VERIFIED
verified fixed 1.9.1 by bug 469625
Keywords: verified1.9.1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: