Closed Bug 257602 Opened 20 years ago Closed 20 years ago

Add hooks to the JS engine to tell declaring resolves appart from non-declaring resolves.

Categories

(Core :: JavaScript Engine, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla1.8alpha4

People

(Reporter: jst, Assigned: brendan)

References

Details

(Keywords: fixed-aviary1.0, fixed1.7.5, js1.5)

Attachments

(4 files, 5 obsolete files)

Bug 256932 made us walk through the document looking for random things by
name/id while declaring javascript variables, and also while looking up
constructors when creating new objects. We should have flags in the newResolve
hook to tell these types of resolves appart from normal ones, and avoid walking
the document in those cases.
Depends on: 256932
Want this for PR1.

/be
Status: NEW → ASSIGNED
Flags: blocking1.7.x+
Flags: blocking-aviary1.0PR+
Keywords: js1.5
Priority: -- → P1
Target Milestone: --- → mozilla1.8alpha4
Attached patch proposed extension (obsolete) — Splinter Review
Add JSRESOLVE_DECLARING, for var/const/function declaration prolog ops, and
JSRESOLVE_CONSTRUCTING, for constructor calls.

/be
Comment on attachment 157557 [details] [diff] [review]
proposed extension

Good for what ails us, the extra layer of subroutining for js_LookupProperty
should not hurt us.  Much ;-).

/be
Attachment #157557 - Flags: superreview?(jst)
Attachment #157557 - Flags: review?(shaver)
s/JSRESOLVE_CONSTRUCTING/JSRESOLVE_CLASSNAME/ in comment 2.

/be
Comment on attachment 157557 [details] [diff] [review]
proposed extension

Oops, out of order LookupPropertyWithFlags call.  New patch in a trice.

/be
Attachment #157557 - Attachment is obsolete: true
Attachment #157557 - Flags: superreview?(jst)
Attachment #157557 - Flags: review?(shaver)
Attached patch better proposed extension (obsolete) — Splinter Review
Should work on trunk.  Aviary/1.7 require some undoing of
gcc-strict-alias-warning fixes, jst says.

/be
Attachment #157559 - Flags: superreview?(jst)
Attachment #157559 - Flags: review?(shaver)
Comment on attachment 157559 [details] [diff] [review]
better proposed extension

Argh.  Stand by.

/be
Attachment #157559 - Attachment is obsolete: true
Attachment #157559 - Flags: superreview?(jst)
Attachment #157559 - Flags: review?(shaver)
Attached patch best proposed extension (obsolete) — Splinter Review
Ok, this is it!

/be
Attachment #157561 - Flags: superreview?(jst)
Attachment #157561 - Flags: review?(shaver)
Comment on attachment 157561 [details] [diff] [review]
best proposed extension

Forgot to remove these two lines:

+			 if (cx->fp->flags & JSFRAME_CONSTRUCTING)
+			     flags |= JSRESOLVE_CLASSNAME;

Patch to remove these two lines coming up.

/be
Attachment #157561 - Attachment is obsolete: true
Attachment #157561 - Flags: superreview?(jst)
Attachment #157561 - Flags: review?(shaver)
Attached patch bestest proposed extension (obsolete) — Splinter Review
Comment on attachment 157563 [details] [diff] [review]
bestest proposed extension

Works great (in combination with the DOM diff I just attached). sr=jst
Attachment #157563 - Flags: superreview+
BL patch in a minute.

/be
Attachment #157563 - Attachment is obsolete: true
Attachment #157580 - Flags: superreview?(jst)
Attachment #157580 - Flags: review?(bzbarsky)
Attachment #157563 - Flags: superreview+
Comment on attachment 157575 [details] [diff] [review]
The DOM side of the equation

Update the comment in the "then" clause to match, and r+sr=me.

/be
Attachment #157575 - Flags: superreview+
Attachment #157575 - Flags: review+
Comment on attachment 157579 [details] [diff] [review]
even better, expose API for XBL to avoid doc searches

sr=jst
Attachment #157579 - Flags: superreview+
Comment on attachment 157580 [details] [diff] [review]
Help XBL avoid document searches for scrollbar binding from quirky docs

sr=jst
Attachment #157580 - Flags: superreview?(jst) → superreview+
Attachment #157579 - Flags: review?(shaver)
Attachment #157574 - Attachment is obsolete: true
Comment on attachment 157580 [details] [diff] [review]
Help XBL avoid document searches for scrollbar binding from quirky docs

r=bzbarsky.  Looks good.
Attachment #157580 - Flags: review?(bzbarsky) → review+
Attachment #157579 - Flags: approval1.7.x?
Attachment #157579 - Flags: approval-aviary?
Attachment #157575 - Flags: approval1.7.x?
Attachment #157575 - Flags: approval-aviary?
Attachment #157580 - Flags: approval1.7.x?
Attachment #157580 - Flags: approval-aviary?
js/src and xbl/content/src changes checked into the trunk -- jst is doing the
dom chores there.

/be
DOM changes checked in on the trunk now too.
Comment on attachment 157575 [details] [diff] [review]
The DOM side of the equation

a=asa for branches checkin.
Attachment #157575 - Flags: approval1.7.x?
Attachment #157575 - Flags: approval1.7.x+
Attachment #157575 - Flags: approval-aviary?
Attachment #157575 - Flags: approval-aviary+
Comment on attachment 157579 [details] [diff] [review]
even better, expose API for XBL to avoid doc searches

a=asa for branches checkin.
Attachment #157579 - Flags: approval1.7.x?
Attachment #157579 - Flags: approval1.7.x+
Attachment #157579 - Flags: approval-aviary?
Attachment #157579 - Flags: approval-aviary+
Comment on attachment 157580 [details] [diff] [review]
Help XBL avoid document searches for scrollbar binding from quirky docs

a=asa for branches checkin.
Attachment #157580 - Flags: approval1.7.x?
Attachment #157580 - Flags: approval1.7.x+
Attachment #157580 - Flags: approval-aviary?
Attachment #157580 - Flags: approval-aviary+
All patches landed on the aviary branch.
Keywords: fixed-aviary1.0
I synced 1.7 js/src from aviary, after jst landed the js/src patch here on
aviary branch.  That was easy, cvs update -j without conflicts.

I also put the nsXBLBinding.cpp change on the 1.7 branch, which makes the 1.7
and aviary branch versions of that file match.

The DOM changes for document.all and global scope pollution quirks are not on
the 1.7 branch yet, but jst'll do those in due course.

/be
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
So should this one have "fixed1.7.x"? Is it waiting on the jst tasks mentioned
in comment 27 or are those tracked elsewhere?
Fixed on the 1.7 branch.
Keywords: fixed1.7.x
Flags: testcase-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: