Closed Bug 579158 Opened 15 years ago Closed 15 years ago

js_XDRAtom creates unnecessary JSString during decoding

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: luke, Assigned: luke)

References

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file, 1 obsolete file)

Attached patch fix (obsolete) — Splinter Review
bug 579140 comment 8 points out that js_XDRAtom creates an unnecessary JSString for already-atomized strings. Since atoms may only be strings, it seems the fix is just to fold js_XDRStringAtom into js_XDRAtom.
Attachment #457663 - Flags: review?(igor)
Oops, wrong dependency.
Blocks: 579140
No longer blocks: 457653
Comment on attachment 457663 [details] [diff] [review] fix When you are fixing this it would be nice to rename those jsval_ tags into xdr_ ones to avoid any confusion with jsval internals.
Attachment #457663 - Flags: review?(igor) → review+
Attached patch fix with nitsSplinter Review
Oops, I forgot to address your other requests.
Assignee: general → lw
Attachment #457663 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Whiteboard: fixed-in-tracemonkey
Comment on attachment 457726 [details] [diff] [review] fix with nits >-enum jsvaltag { >+enum XDRValueTag { > JSVAL_OBJECT = 0x0, > JSVAL_INT = 0x1, > JSVAL_DOUBLE = 0x2, > JSVAL_STRING = 0x4, > JSVAL_SPECIAL = 0x6, > JSVAL_XDRNULL = 0x8, > JSVAL_XDRVOID = 0xA > }; I should have been more clear in comments and stated that the nit was not only about the enum type name but also about constants names. They should be renamed to XDRTAG_OBJECT etc to avoid any resemblance to JSVAL internals and their indexes can be simply 0,1,2 etc. Note that the latter change at this point would need a bumping ox xdr version.
Of course, d'oh! Will fix.
Status: ASSIGNED → RESOLVED
Closed: 15 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: