Closed Bug 510673 Opened 15 years ago Closed 15 years ago

Add a quickstub for document.write

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.3a1

People

(Reporter: peterv, Assigned: peterv)

Details

Attachments

(1 file)

Attached patch v1Splinter Review
document.write can take any number of arguments, we currently handle that in nsHTMLDocument itself but we can do it in a quickstub instead. This speeds up 2 iBench JS testcases (download_table.html and gen_page.html) by about 10%.

The quickstub string converters can already deal with JSVAL_NULL, and in that case they don't need a pointer to a jsval to root something. So instead of passing in just a |jsval*|, we can pass a |jsval| and a |jsval*|, and if the first is JSVAL_NULL we can allow NULL for the second. This change makes quickstubs possible for methods with optional string arguments. I also made it possible for a quickstub with custom code to fail (we still try to call the regular DOM method and compare the result on failure, I think that's fine).

This changes a frozen interface (nsIDOMHTMLDocument), but the change should be binary compatible and shouldn't need an IID change.
Attachment #394651 - Flags: superreview?(jst)
Attachment #394651 - Flags: review?(jst)
Attachment #394651 - Flags: superreview?(jst)
Attachment #394651 - Flags: superreview+
Attachment #394651 - Flags: review?(jst)
Attachment #394651 - Flags: review+
Comment on attachment 394651 [details] [diff] [review]
v1

Looks good!
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a1
This actually changed the behavior of document.write(null) (from writing "null" to writing ""). I guess we should push forward with bug 478251 to fix that...  And perhaps add some tests for write(null) and write(undefined)?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: